Skip navigation
24421 Views 8 Replies Latest reply: Apr 15, 2008 3:12 AM by rene-1 RSS
handband2 Bronze 7 posts since
Jun 3, 2005
Currently Being Moderated

Sep 18, 2007 1:15 PM

Howto: Openfire - Ubuntu 6.06 LTS LAMP

Installing openfire

http://www.igniterealtime.org/projec...fire/index.jsp

 

Install Ubuntu 6.06 LTS LAMP - Recommended sites to setup your LAMP server:

http://www.howtoforge.com/ubuntu_lamp_for_newbies

https://help.ubuntu.com/community/ApacheMySQLPHP

 

Check which version of Java you are running. Note the following: the .tar.gz build does not contain a bundled Java runtime (JRE). Therefore, you must have JDK or JRE 1.5.0 (Java 5) or later installed on your system. You can check your java version by typing "java -version" at the command line and (if necessary) upgrade your Java installation by visiting http://java.sun.com.)

 

Java 6 is available for 6.06 LTS via the "backports" repository. If

this is a fresh install of Ubuntu, you will need to edit your

SOURCES.LIST to enable this repository.

 

$ sudo vi /etc/apt/sources.list

 

Uncomment the following line(s):

    1. deb http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse*

    2. deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse*

 

$ sudo apt-get update

 

$ sudo apt-get install sun-java6-bin

 

- Thanks for the edit SkydiverFL

$ java -version

 

Install java6 If you don't have java already installed.

 

$ sudo apt-get install sun-java6-bin

 

Set java6 as your default.

 

$ sudo update-alternatives --config java

select /usr/lib/jvm/java-6-sun/jre/bin/java

 

To create a database for openfire MySQL, Oracle, Microsoft SQLServer, PostgreSQL, IBM DB2, or HSQLDB can be used. I chose MySQL since it was installed with my LAMP setup.

 

Now use phpmyadmin or the terminal to create the database. The following is through the terminal.

 

Login as root

 

$ su

 

Login to MySQL

 

    1. mysql*

 

or the following if you setup a user and a password.

 

    1. mysql -u USERNAME -p*

 

Create the database in MySQL

 

    1. mysql> CREATE DATABASE openfire;*

 

    1. mysql> exit*

 

If you need more help setting up and/or configuring MySQL I recommend these two sites:

http://www.howtoforge.com/perfect_setup_ubuntu_6.06_p4
http://stanton-finley.net/fedora_core_5_installation_notes.html#MySQL

Download Openfire to a directory. I chose the /opt/ directory.

 

    1. cd /opt*

 

Download File or go here to get the most recent: http://www.igniterealtime.org/downloads/index.jsp#openfire

 

    1. wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3_3_2.t ar.gz*

 

    1. mv downloadServlet\?filename\=openfire%2Fopenfire_3_3_2.tar.gz openfire_3_3_2.tar.gz*

 

Extract the files.

 

    1. tar -zxvf openfire_3_3_2.tar.gz*

 

Create a symlink

 

    1. ln -s /opt/openfire/bin/openfire /etc/init.d/*

 

Make the symlink executible

 

    1. chmod +x /etc/init.d/openfire*

 

Add openfire to our startup.

 

    1. update-rc.d openfire defaults*

 

Fix the nohup output.

 

    1. vim /opt/openfire/bin/openfire*

 

Modify openfire script with the following:  >../logs/SDTOUT.log 2>../logs/SDTERR.log into

 

ORIGINAL:

Code:

-----

nohup "$app_java_home/bin/java" -server -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname"  $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.Launcher start org.jivesoftware.openfire.starter.ServerStarter false false "$prg_dir/../logs/stderror.log" "$prg_dir/../logs/stdoutt.log" true true false "" true true 0 0 "" 20 20 "Arial" "0,0,0" 8 500 "version 3.3.2" 20 40 "Arial" "0,0,0" 8 500 -1 -DopenfireHome=$app_home -Dopenfire.lib.dir=$app_home/lib &

-----

 

Goto line 262 of /opt/openfire/bin/openfire and insert the following at the end of nohup .... with >../logs/STDOUT.log 2>../logs/STDERR.log

 

MODIFIED:

Code:

-----

nohup "$app_java_home/bin/java" -server -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname"  $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.Launcher start org.jivesoftware.openfire.starter.ServerStarter false false "$prg_dir/../logs/stderror.log" "$prg_dir/../logs/stdoutt.log" true true false "" true true 0 0 "" 20 20 "Arial" "0,0,0" 8 500 "version 3.3.2" 20 40 "Arial" "0,0,0" 8 500 -1 -DopenfireHome=$app_home -Dopenfire.lib.dir=$app_home/lib >../logs/STDOUT.log 2>../logs/STDERR.log &

-----

 

Restart or run the following command to start Openfire

 

    1. /opt/openfire/bin/openfire start*

 

Now setup the rest of Openfire through your browser.

 

http://localhost:9090

  • Bronze 1 posts since
    Sep 3, 2007
    Currently Being Moderated
    Sep 3, 2007 4:52 PM (in response to handband2)
    Re: Howto: Openfire - Ubuntu 6.06 LTS LAMP

     

    Hi!

    I followed exacty this HowTo but still cant start openfire. i still get the nohup: appending output to `nohup.out' !!

     

     

    I tried this a thousand times:

     


    Fix the nohup error.
    Run the following command or you will get the following error: nohup: appending output to `nohup.out'
    # nohup ls >ls.log 2>&1 &
    Restart or run the following command to start Openfire
    # /opt/openfire/bin/openfire start

    Pls help a lost Noob!
    Thanks,
    mapero

     

    • LG KeyContributor 5,935 posts since
      Dec 13, 2005
      Currently Being Moderated
      Sep 4, 2007 12:49 PM (in response to Jochen)
      Re: Howto: Openfire - Ubuntu 6.06 LTS LAMP

      Hi Mapero,

       

      "nohup: appending output to `nohup.out'" is not an error - it is the normal output of "nohup" if STDOUT and STDERR are not redirected to a file. So if you want to fix this error you should edit the openfire start script and add there to the start command which looks like

      "nohup ............. &" the redirection parameters so it will look like

      "nohup ............. >../logs/STDOUT.log 2>../logs/STDERR.log &"

       

      If you run "nohup ls &" you'll get the same "error" which can be hidden by running "nohup ls >ls.log 2>&1 &".

      In the first case you'll find the output of 'ls' in nohup.out, in the second case it's in ls.log.

       

      LG

  • Coolcat KeyContributor 797 posts since
    Mar 19, 2007
    Currently Being Moderated
    Sep 4, 2007 2:52 AM (in response to handband2)
    Re: Howto: Openfire - Ubuntu 6.06 LTS LAMP

    You should not run openfire as root. The script /opt/openfire/bin/extra/openfired will do this for you. Just start this script as root, it will start openfire as user "jive". (below in my guide I changed this to 'openfire')

     

     

    Here my small guide

     

    extract openfire_x_x_x.tar.gz to /opt/openfire

    shell> cd /opt

    shell> tar -xzf openfire_x_x_x.tar.gz

     

    create new user 'openfire' and group

    shell> useradd openfire

    appending to your operating system, you will have to create a group to (some systems, e.g. Cent-OS will do this automatically if you create an user)

    shell> groupadd openfire

    shell> usermod -g openfire openfire

     

    set rights for user 'openfire' for openfire directory

    shell> chown -R openfire /opt/openfire/

    shell> chgrp -R openfire /opt/openfire/

    protect some special files

    shell> chmod -R g-rwx /opt/openfire/conf

    shell> chmod -R o-rwx /opt/openfire/conf

    shell> chmod -R g-rwx /opt/openfire/resources/security

    shell> chmod -R o-rwx /opt/openfire/resources/security

    set execution rights for scripts

    shell> chmod u+x /opt/openfire/bin/extra/openfired

    shell> chmod u+x /opt/openfire/bin/openfire

     

    workaround for small bug in openfired script

    shell> ln -s /opt/openfire/bin/openfire /opt/openfire/bin/openfire.sh

     

    Open file '/opt/openfire/bin/extra/openfired' with your favorite editor and set used user to 'openfire'

    export OPENFIRE_USER=openfire

     

    Open file '/opt/openfire/bin/openfire' and set some extra VM parameters. This will extends your memory from 64 to 128 MB.

    INSTALL4J_ADD_VM_PARAMS="-Xms128m -Xmx128m"

     

    If necessary you can config the path to your JavaVM in the same file:

    INSTALL4J_JAVA_HOME_OVERRIDE=/usr/java/jdk1.6.0_02

     

     

     

    Setup your database

    Login to mysql

    shell> mysql -p -u root

    create database

    mysql> CREATE DATABASE openfire;

     

    create new user 'openfire' (MySQL 5.1)

    mysql> CREATE USER openfire IDENTIFIED BY 'newpwd';

    config rights for user 'openfire'

    mysql> REVOKE ALL ON *.* FROM openfire;

    mysql> GRANT ALL ON openfire.* TO openfire;

     

    logout

    mysql> exit

     

    import necessary tables

    shell> mysql -p -u openfire openfire </opt/openfire/resources/database/openfire_mysql.sql

     

    Message was edited by: Coolcat

     

    Message was edited by: Coolcat

    • Bronze 13 posts since
      Nov 12, 2007
      Currently Being Moderated
      Nov 14, 2007 9:55 AM (in response to Coolcat)
      Re: Howto: Openfire - Ubuntu 6.06 LTS LAMP

       

      This guide has been a great help.  However, when I run "/opt/openfire/bin/extra/openfired" it returns an error:

       

       

      openfired: 50: Syntax error: "(" unexpected

       

       

      I didn't change that line in the script; everything is default except for changing the "openfire" user.  I'm running Ubuntu server 7.10.  Could that be the problem?

       

       

  • LG KeyContributor 5,935 posts since
    Dec 13, 2005
    Currently Being Moderated
    Sep 4, 2007 12:54 PM (in response to handband2)
    Re: Howto: Openfire - Ubuntu 6.06 LTS LAMP

    Hi,

     

    I see little need in describing how to setup a MySQL database or how to install Java for Ubuntu, one should know how to manage it's server and the database of one's choice.

    You run too much commands as root, this looks a lot like how M$-administrators behave. Except for the start scripts there's no need to have a root account.

     

    LG

  • Bronze 2 posts since
    Sep 5, 2007
    Currently Being Moderated
    Sep 5, 2007 12:03 PM (in response to handband2)
    Java 6 Requirement

     

    Small note, if you are looking for Java 6 on Ubuntu 6.06 LTS...

     

    Java 6 is available for 6.06 LTS via the "backports" repository. If this is a fresh install of Ubuntu, you will need to edit your SOURCES.LIST to enable this repository.

     

     

     

     

     

    $ sudo vi /etc/apt/sources.list

     

     

    Uncomment the following line(s):

     

     

      1. deb http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse*

      2. deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse*

     

     

    $ sudo apt-get update

     

     

    $ sudo apt-get install sun-java6-bin

     

     

  • rene-1 Silver 190 posts since
    Feb 12, 2007
    Currently Being Moderated
    Apr 28, 2008 10:36 AM (in response to handband2)
    Re: Howto: Openfire - Ubuntu 6.06 LTS LAMP

    Hi there,

     

    thanks for this great how-to. a month ago i made a fresh install of openfire 3.4.5 on a ubuntu dapper drake box using your guide. everthing worked perfectly, but today i became a serious problem. after stopping the openfire deamon it does not start again.

     

    /opt/openfire/bin/openfire.sh start

    Starting openfire

    root@my-ip:~# nohup: appending output to `nohup.out'

     

    /opt/openfire/bin/openfire.sh status

    The daemon is stopped.

     

    I also tried this:

     

     

    /opt/openfire/bin/extra/openfired start

    testing JVM in /usr ...

    ./openfire.sh: line 63: /home/openfire/.install4j: No such file or directory

    Starting openfire

     

    /opt/openfire/bin/extra/openfired status

    openfire is not running

     

     

     

     

     

     

     

     

     

    But the deamon did not start !?

     

     

     

     

     

     

     

     

     

    Openfire was running for a month and today i liked to restart the openfire server but i can`t start it. i also followed the small guide from Coolcat to "fix" the openfire.sh. As i sad before - it worked until today ?!

     

     

     

     

     

     

     

     

     

    What shall i do?

More Like This

  • Retrieving data ...

Bookmarked By (0)