Wednesday, December 14, 2011

Installing OpenFire on CentOS 6.0 (64 Bit)

Download rpm package from
cd /tmp
and install it
rpm -ivh openfire-3.7.1-1.i386.rpm
Because openfire is a 32-bit application and requires 32-bit versions of OS system libraries. These libraries are not installed on CentOS x86_64 (64-bit) by default. You must install these 32-bit libraries on your system before you run openfire.

Resolving the problem

The required libraries are available on the CentOS 6.0 distribution DVD. To install the required libraries:
1. Mount the DVD to the system. Insert the DVD into the DVD drive.
2. Select open a terminal window as a root.
3. Execute the commands:
mkdir /media/cdrommount /dev/cdrom /media/cdrom
4. Edit file CentOS-Media.repo in the /etc/yum.repos.d directory, and change enabled=0 to enabled=1
mcedit /etc/yum.repos.d/CentOS-Media.repo
name=CentOS-$releasever - Media
5. Execute the command:
yum clean all
6. Execute the command to import related public keys:
rpm --import /media/cdrom/*GPG*
7. Execute the commands to install the required libraries:
yum install nss-softokn-freebl.i686yum install glibc.i686
During the install you might receive prompts similar to the example. Answer with ‘y’.
Package Arch Version Repository Size---------------------------------------------------------Installing:nss-softokn-freebl i686 3.12.8-1.el6_0 updates 109 kInstalling for dependencies:glibc i686 2.12-1.7.el6_0.5 updates 4.3 MTransaction Summary---------------------------------------------------------Install 2 Package(s)Upgrade 0 Package(s)Total download size: 4.4 MInstalled size: 13 MIs this ok [y/N]: yDownloading Packages:(1/2): glibc-2.12-1.7.el6_0.5.i686.rpm | 4.3 MB 00:17(2/2): nss-softokn-freebl-3.12.8-1.el6_0.i686.rpm | 109 kB 00:00---------------------------------------------------------Total 243 kB/s | 4.4 MB 00:18Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning TransactionWarning: RPMDB altered outside of yum.Installing : nss-softokn-freebl-3.12.8-1.el6_0.i686 1/2Installing : glibc-2.12-1.7.el6_0.5.i686 2/2Installed:nss-softokn-freebl.i686 0:3.12.8-1.el6_0Dependency Installed:glibc.i686 0:2.12-1.7.el6_0.5Complete!
Openfire has an embedded database that you can use in case you don’t have MySQL installed, I prefer using MySQL though, I also tried using the embedded database, works just fine too.
Create the database using mysql command line.
mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 3 to server version: 5.0.22Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.mysql> CREATE DATABASE `openfire`;Query OK, 1 row affected (0.00 sec)mysql> CREATE USER ‘openfire’@’localhost’ IDENTIFIED BY ‘password’; <-- yours password for user openfireQuery OK, 0 rows affected (0.01 sec)mysql> GRANT USAGE ON *.* TO ‘openfire’@’localhost’ IDENTIFIED BY ‘password’ WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;Query OK, 0 rows affected (0.00 sec)mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON `openfire`.* TO ‘openfire’@’localhost’;Query OK, 0 rows affected (0.01 sec)mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.02 sec)mysql> quitBye
Open Ports in your Firewall

If you have a firewall in place you’ll need to open some ports before we can start configuring Openfire through its web interface. Openfire uses ports 5222, 7777, 9090, 9091 for client connections, file transfer proxy, http web administration and the secured administration respectively. If you use iptables tables like I do, add these lines to your /etc/sysconfig/iptables rules file and reload.
-A INPUT -p tcp -i eth0 --dport 5222 -j ACCEPT-A INPUT -p udp -i eth0 --dport 5222 -j ACCEPT-A INPUT -p tcp -i eth0 --dport 7777 -j ACCEPT-A INPUT -p udp -i eth0 --dport 7777 -j ACCEPT-A INPUT -p tcp -i eth0 --dport 9090 -j ACCEPT-A INPUT -p udp -i eth0 --dport 9090 -j ACCEPT-A INPUT -p tcp -i eth0 --dport 9091 -j ACCEPT-A INPUT -p udp -i eth0 --dport 9091 -j ACCEPT
Then reload iptables to accept the new directives.
iptables-restore < /etc/sysconfig/iptables
Before start openfire as service, you must
chown daemon:daemon /opt/openfire/conf/openfire.xml
Now start your openfire
service openfire start
chkconfig --level 235 openfire on
Then launch your browser (Firefox) and enter this at the url box --> https://localhost:9091 or http://localhost:9090 then follow the procedure on screen and complete the installation process.
Verify English is selected and click ContinueClick Continue for the Server SettingsVerify Standard Database Connection is chosen and click ContinueSet the following Database Settings (then click Continue):Database Driver Presets: MySQLDatabase URL: jdbc:mysql://localhost:3306/openfireUsername: openfire <-- your mysql username for database openfire, if you follow my instruction, then it  should be openfirePassword: password <-- your mysql password
That’s all!


Referensi : Referensi 01 Referensi 02 Referensi 03

1 comment:

Kavirajan said...

Nice tutorial thanks for sharing.
For Video tutorial you can check out this link.