Installing Openfire
Find the lastest version of openfire These instructions were created against version 3.3.3. Also AssUMed that you are going to use MySQL. There are many choices LDAP among them. Just make sure that what ever database method you choose that you update the path in the SMF file below.
Pre flight check list
- Java version
java -version
needs to be 1.5 or later
- MySQL version
mysql --version
needs to be 4.12 or later 5.X preferred
Getting the distribution
We will be installing openfire into /opt/openfire.
cd /opt/src curl http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3_3_3.tar.gz >openfire_3_3_3.tar.gz gtar xvzf openfire_3_3_3.tar.gz mv openfile ../
You now have the official installation instructions in /opt/openfire/documentation/index.html
Setting up Database
mysql -u USERNAME -pPASSWORD Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 948 to server version: 5.0.22 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database openfire; Query OK, 1 row affected (0.00 sec) mysql> exit Bye
Then populate the database
mysql -u USERNAME -pPASSWORD openfire </opt/openfire/resources/database/openfire_mysql.sql
Grab the plugins
Depending on what you want to do there are quite a few plug-ins to choose from. Here is an example of installing the gateway plugin.
cd /opt/openfire/plugins curl http://www.igniterealtime.org/projects/openfire/plugins/gateway.jar >gateway.jar
That is all you need to do. When openfire is up and running it will see the new .jar file and install it automatically.
Getting reboot ready
<envvar name="PATH" value=""/>
element contains everything required to access that database.
smf-openfire.xml
<?xml version="1.0" encoding="UTF-8" ?> <!-- smf_openfire Created by Linda Derezinski on 2007-10-21. --> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle type='manifest' name='XMPP/openfire'> <service name='network/XMPP/openfire' type='service' version='0'> <create_default_instance enabled='true'/> <single_instance/> <dependency name='fs' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local'/> </dependency> <dependency name='net' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/loopback'/> </dependency> <dependent name='mongrel_multi-user' restart_on='none' grouping='optional_all'> <service_fmri value='svc:/milestone/multi-user'/> </dependent> <exec_method name='start' type='method' exec='/opt/openfire/bin/openfire start' timeout_seconds='60'> <method_context working_directory='/opt/openfire'> <method_credential user='root' group='root' /> <method_environment> <envvar name="PATH" value="/opt/csw/gnu:/usr/sbin:/usr/bin:/usr/sfw/bin:/opt/csw/bin:/opt/csw/sbin:/opt/csw/mysql5/bin:/opt/csw/postgresql/bin" /> </method_environment> </method_context> </exec_method> <exec_method name='stop' type='method' exec='/opt/openfire/bin/openfire stop' timeout_seconds='60'> <method_context/> </exec_method> </service> </service_bundle>
Install SMF
sudo svccfg import smf_openfire.xml
Make sure it came up ok
# svcs -a |grep openfire online 13:37:25 svc:/network/XMPP/openfire:default
Run the admin console to finish up installation
Point your browser to http://your-public-ip:9090/ and finish up the installation.