728x90

XML에 기반한 실시간 메시지 지향 공개 표준 통신프로토콜인 XMPP(Extensible Messaging and Presence Protocol)을 사용한 오픈소스 서버와 클라이언트가 이미 공개돼 있다.

이를 이용해서 간단히 메신저를 구축 할 수 있다.


유투브 동영상 강좌를 우연히 보다가 openfire 메신저를 설치해봤다.


설치환경 : CentOS 6.6 64bit, MySQL 5.6.30


설치하면서 MySQL 구동중인 것이 장애가 발생하는 증상이 있어서 MySQL 문제발생을 조치하고 나서, MySQL을 stop시킨 후 openfire 를 Stop ==> Remove 한 다음 재설치를 하고 나서 성공했다.


OpenFire 사이트 : https://www.igniterealtime.org/downloads/index.jsp


/etc/init.d/mysqld start
/etc/init.d/mysqld stop

0. 가장 먼저 해야 할 일은 MySQL DB를 stop 시키고 나서 설치를 하기 바란다.
    에러가 나면 에러 원인 찾아서 해결하기가 쉽지 않더라.

1. mkdir -p /home/openfire

2. openfire.rpm 다운받기
   wget http://igniterealtime.org/openfire/openfire-4.2.3-1.x86_64.rpm  

3. rpm 설치하기
   yum install openfire-4.2.3-1.x86_64.rpm
   설치를 하면 /opt/openfire 디렉토리에 설치된다.
   설치했던 openfire 를 삭제하는 방법은 yum remove openfire 다. MySQL DB를 stop하고 하는 것이 좋을 거 같다.

4. service 시작하기
   service openfire start

5. 방화벽 설정에 9090 포트를 추가한다.


6. MySQL DB에서 openfire 라는 DB를 생성한다.

    /etc/init.d/mysqld start

    MySQL 접속 후 openfire DB 생성


7. Web 브라우저 콘솔 접속
   http://ipaddress:9090

   순서에 따라 설치
   DB Setting 화면에서 설정을 잘못하면 고생을 할 수 있다.


Database URL : jdbc:mysql://localhost:3306/openfire

Username : root 또는 별도 생성한 db_username

Password : root 패스워드 또는 db_username의 패스워드


이 부분을 신경쓰면 설치하는데는 문제없이 잘 넘어간다.

admin 과 지정한 패스워드를 입력하면 관리자 화면으로 접속된다.



phpMyAdmin 으로 살펴보면

openfire DB에 테이블이 34개 생성되어 있는 걸 알 수 있다.




이제 http://www.igniterealtime.org/downloads/index.jsp 에서 Spark 를 받아서 설치한다.





시스템이 재부팅되어도 openfire 자동 실행되도록 설정
#chkconfig --add openfire
#chkconfig openfire on


Android 어플 개발시에 OpenFire 서버와 통신하기 위해서 Security : SSL Certificates 가 필요하다고 한다.
Because our server doesn’t have a public facing domain name, and is running locally, we can’t set up an SSL certificate for it. So we will need to disable security when connecting to our server as shown below
.setDebuggerEnabled(true)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled) // Should make required on Public Server with SSL Configured
.setCompressionEnabled(true).build();


검색하다보니 XMPP 또다른 서버가 있다.




블로그 이미지

Link2Me

,