|
This is a community page. The official installation instructions are here. |
Below are instructions on installing Confluence and supporting software (MySQL 5, Resin) on a Fedora or RHEL/Centos Linux system. Some seemingly little things here took many hours to figure out. Some of the information may not apply to you (e.g. my reference to a host named "linus" for mounting to get RPM files). Also, some of the information may not be perfectly refined. The phpMyAdmin info is a bit rough and may not be as useful as the rest. Nevertheless, you may find it useful as a general guide.
(Originally provided by Keith R. Bennett on confluence-user.)
Installing Confluence and its Prerequisite Tools
| SELinux SELinux seems to cause problems with some of the software we will need. For now, we are disabling SELinux on this server. As time permits, we can test adding back SELinux a little at a time. (Although it can be disabled specifically for httpd and mysql, that was apparently not enough.) To enable/disable/configure SELinux, run system-config-securitylevel. |
Installing Confluence on our RedHat or Fedora Linux server, as we have chosen to configure it, involves the following steps:
- Upgrading the MySQL data base from version 4 to 5. (This is our first use of MySQL, and we might as well take advantage of the new features (such as views) of the most recent stable version of the MySQL database.)
- Installing the Resin application server, and doing so in such a way that Apache remains the primary web server, referring only servlet requests to Resin.
- Installing phpMyAdmin as a GUI front end for administration of MySQL.
- Installing Confluence so that Resin can find and run it.
Some of these instructions assume you have nfs mounted linus:/mnt/bigdrive/downloads.
We address here these steps in detail.
| Suggestion You can save time and reduce errors by copying the commands from this page and pasting them into your shell rather than retyping them. |
Installing MySQL
The book "The Definitive Guide to MySQL 5" is an excellent reference for MySQL and phpMyAdmin.
Note: At any time, you can see which mysql packages are installed by executing:
rpm -qa | grep -i mysql
Note that some of these will be MySQL itself, and others will be other products that use MySQL. In general, the MySQL packages will be the ones with "server", "client", "shared", and "bench" in their names. One way to reduce the false positives is to search for ^mysql (note the leading caret); currently all the files you'll be installing from MySQL will match that.
The RPM's are already on linus. However, if you cannot find them there, or need a more recent version, you can download the RPM's from http://dev.mysql.com/downloads/mysql/5.0.html. Select the RedHat Enterprise Linux RPM's if you are installing on a Fedora or RHEL system. Note that the 32 and 64 bit OS's use different RPM's.
There is a potential problem with removing MySQL 4 and replacing it with MySQL 5. You may have other software installed that specifically references a MySQL 4 library. For example, when I did this, I got the following error message when I restarted httpd:
Starting httpd: Syntax error on line 6 of /etc/httpd/conf.d/auth_mysql.conf:
Cannot load /etc/httpd/modules/mod_auth_mysql.so into server:
libmysqlclient.so.14: cannot open shared object file: No such file or directory
[FAILED]
Doing a web search, you may find some online messages that recommend installing the MySQL-shared-compat rpm rather than the MySQL-shared-standard rpm. However, I had some problems finding and doing this. I was more successful using another method: saving the library in question (libmysqlclient.so.14) before upgrading to MySQL 5, and then copying it back after the upgrade (which deletes it).
Here are some instructions for doing this:
Copy /usr/lib64/mysql (substitute "lib" for "lib64" if you are working on a 32-bit system) to a temporary place (e.g. /tmp):
mkdir -p /tmp/usr/lib64/mysql cp -R /usr/lib64/mysql/* /tmp/usr/lib64/mysql
Erase the version 4 rpm's by executing the command below. Some other packages will depend on these, but we will tell rpm to ignore those dependencies, since the new version 5 rpm's will satisfy those dependencies. (The files specified here are for 32-bit systems; substitute the equivalent files for 64-bit as necessary.)
# Fedora Core 4: rpm --nodeps --allmatches -e \ mysql-4.1.11-2 \ mysql-server-4.1.11-2 \ mysqlclient10-3.23.58-6 \ mysqlclient10-devel-3.23.58-6 \ mysql-bench-4.1.11-2 # RHEL 4: rpm --nodeps --allmatches -e \ mysql-server-4.1.12-3.RHEL4.1 \ mysqlclient10-3.23.58-4.RHEL4.1 \ mysql-4.1.12-3.RHEL4.1 \ mysql-devel-4.1.12-3.RHEL4.1 \ mysql-bench-4.1.12-3.RHEL4.1
Stop the MySQL 4 demon. From a root prompt:
/sbin/service mysqld stop
If service reports that the stop operation failed, that's all right - it just means that the service had not been running.
Now install the new packages:
# For 32-bit systems: cd /mnt/linus-downloads/mysql/rhel4-x86 rpm -ivh \ MySQL-client-standard-5.0.18-0.rhel4.i386.rpm \ MySQL-shared-compat-5.0.18-0.i386.rpm \ MySQL-server-standard-5.0.18-0.rhel4.i386.rpm # For 64-bit systems: cd /mnt/linus-downloads/mysql/rhel4-em64t rpm -ivh \ MySQL-server-standard-5.0.18-0.rhel4.x86_64.rpm \ MySQL-client-standard-5.0.18-0.rhel4.x86_64.rpm \ MySQL-shared-standard-5.0.18-0.rhel4.x86_64.rpm
Now copy back libmysqlclient*.so.14* into both /usr/lib64 and /usr/lib64/mysql (TODO: find out which is the one that's actually needed by mod_auth_sql, and remove the reference to the other one below).
cp /tmp/usr/lib64/mysql/libmysqlclient*14* /usr/lib64 cp /tmp/usr/lib64/mysql/libmysqlclient*14* /usr/lib64/mysql
The installation of the server rpm will probably result in the mysql demon being started. If it does not, start MySQL by doing the following:
/sbin/service mysql start
On RHEL and Centos, if SELinux is enabled, this does not work, but the following will:
sh /etc/init.d/mysql start
However, this does not solve the problem of starting mysql as a service, so the better solution is to disable SELinux.
Now we'll need to change the root password, and remove blank user names. In your shell, start mysql as root in the mysql database:
mysql -u root mysql
Then issue the following commands:
UPDATE user SET Password=PASSWORD('l@sEr$cA6') WHERE user='root';
DELETE FROM user WHERE user='';
FLUSH PRIVILEGES;
QUIT
Now install Resin by following the instructions below, then come back here to proceed.
Although Resin ships with a JDBC driver for MySQL, there are problems with it. Therefore, we are advised to use MySQL's own driver, by copying it to /opt/resin/lib. It is available at http://dev.mysql.com/downloads/connector/j/3.0.html or at linus:
cp /mnt/linus-downloads/mysql/jdbc-driver/mysql-connector-java-3.0.17-ga-bin.jar \ /opt/resin/lib
NOTE: This is not the most recent driver, but according to http://confluence.atlassian.com/display/DOC/MySQL+Tips, there are problems with the newer driver.
Add the following to the /opt/resin/conf/resin.conf, just above or below the commented out text regarding mysql:
<database>
<jndi-name>jdbc/mysql</jndi-name>
<driver>
<type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
<url>jdbc:mysql://localhost:3306/webserver</url>
<user>webserver</user>
<password>webserver_password</password>
</driver>
</database>
Note that the userid/password and database will be global to all resin apps, so they should probably not be named confluence. Since you'd want the password to make sense if you switched to a product other than resin, "webserver" is probably a better name than "resin". The password "webserver-password" is used for illustrative purposes only.
Now create the user specified above in MySQL:
mysql -u root -p mysql # then, in MySQL: create database webserver; grant all on webserver.* to webserver@localhost identified by 'webserver_password'; quit
Now we need to enable the starting of the MySQL daemon on system startup. Do:
chkconfig --level 2345 mysql on
chkconfig is a very easy to use text mode utility for modifying service startups; see its man pages for more information.
Installing Resin
First, we download the Linux tar file resin-3.0.17.tar.gz from http://www.caucho.com/download/index.xtp, untar it into opt, and create a symbolic link for easier access:
cd /opt tar xvzf /mnt/linus-downloads/resin/resin-3.0.17.tar.gz ln -s resin-3.0.17 resin cd /opt/resin ./configure --with-apxs=/usr/sbin/apxs
After running configure, it is necessary to edit modules/c/src/Makefile and change "apache1" to "apache2". Then do:
make make install
Now we will need to edit /opt/resin/conf/resin.conf, the Resin configuration file.
Search for "dependency-check-interval" and change the value to "600s" as recommended in the comment.
We are setting up Resin to collaborate with the Apache web server. Some of the instructions here are copied from http://www.caucho.com/resin-3.0/install/cse-apache.xtp. The /opt/resin/conf/resin.conf file must be edited so that the apache httpd user and group is specified. Search the file for "user-name" to find something like this:
<!--
- If starting bin/resin as root on Unix, specify the user name
- and group name for the web server user.
-
- <user-name>resin</user-name>
- <group-name>resin</group-name>
-->
Just below that add something like this:
<!-- Added KRB, 2/06: --> <user-name>apache</user-name> <group-name>apache</group-name>
Resin is a Java application, so it uses a Java runtime provided by your system. If you do a "java -version" and it reports that you're using a GNU version, download and install JDK from Sun instead. See Installing the Sun JDK for instructions on how to do this.
Start the Apache web server:
service httpd start
We'll need to tell Resin to use more than the default amount of memory. The following commands will create a one-line shell script that will do this (see http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp for more on this).
cd /opt/resin/bin echo '#!/bin/sh' > run-resin-with-more-memory.sh echo /opt/resin/bin/httpd.sh -Xmn100M -Xms500M -Xmx500M >> run-resin-with-more-memory.sh chmod +x run-resin-with-more-memory.sh
Start resin by going to the bin subdirectory of resin's home, and running run-resin-with-more-memory.sh as root using sudo. (Note: We should try to find a way to run it as a nonroot user.) For example:
/opt/resin/bin/run-resin-with-more-memory.sh
To test that Apache and Resin are both working right:
- Point your browser to the default location on that host (e.g. "http://localhost"). Assuming you haven't yourself added an index.html or the like, you should get an Apache page such as "Fedora Core Test Page".
- Point your browser to "resin-doc" on that host (e.g. "http://localhost/resin-doc"). Resin's online documentation should be displayed.
To set up the system so that Resin will start automatically on system startup, add the following (with appropriate changes to the comment) to the end of /etc/profile:
# Added KRB, 2/06: RESIN_HOME=/opt/resin export RESIN_HOME
Also, add this to /etc/rc.local:
# Added KRB 2/06 to run Resin: . /etc/profile /opt/resin/bin/run-resin-with-more-memory.sh &
Make sure the Apache server will start on system startup by doing the following:
chkconfig --level 2345 httpd on
Installing Confluence
Do the following:
cd /opt tar xvzf /mnt/linus-downloads/confluence/confluence-2.1.2.tar.gz ln -s confluence-2.1.2 confluence cd /opt/confluence cp -r confluence /opt/resin/webapps cd /opt/resin/webapps/confluence/WEB-INF/classes # # see note below, edit & save this file; you can substitute your own editor for kedit kedit confluence-init.properties # # see note below about editing this file. kedit /opt/resin/webapps/confluence/WEB-INF/web.xml
Edit /opt/resin/webapps/confluence/WEB-INF/classes/confluence-init.properties to add the following to the end of the file:
confluence.home=/var/confluence
The information below is in large part taken from http://confluence.atlassian.com/display/DOC/Installing+the+Confluence+EAR-WAR+edition.
As per http://confluence.atlassian.com/display/DOC/Release+Notes+2.1, remove the following from /opt/resin/webapps/confluence/WEB-INF/web.xml:
<servlet>
<servlet-name>SeleneseServletSpike</servlet-name>
<servlet-class>com.thoughtworks.selenium.outbedded.CommandBridge</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SeleneseServletSpike</servlet-name>
<url-pattern>/selenium-driver/driver</url-pattern>
</servlet-mapping>
Restart the Apache web server:
/sbin/service httpd restart
Point your web browser to localhost/confluence. You should see the "Confluence Setup Wizard".
If this is the LSI Confluence main wiki server (and not an experimental one on a trial version, for example), copy and paste the license contained in /mnt/linus-downloads/confluence/license.txt.
Select "Custom Installation".
Select "MySQL" as the external database, then click "External Database".
Select "Direct JDBC Connection".
On the Configure Database page, you should use the following values:
| Driver Class Name: | com.mysql.jdbc.Driver |
| Database URL: | jdbc:mysql://localhost/webserver?autoReconnect=true&useUnicode=true&characterEncoding=utf8 |
| User Name: | webserver |
| Password: | webserver_password |
Click "Next".
We also want to install an extension to Confluence that supports task lists with progress feedback. A description and instructions regarding this can be found here.
Installing phpMyAdmin (Optional)
Some of the instructions here are copied from http://www.wampserver.com/en/faq4.php.
The files can be downloaded at http://www.phpmyadmin.net/home_page/downloads.php. Untar the file into /opt, create a symlink named phpMyAdmin that resolves to the installed version's directory, and make a copy of the default configuration file:
# cd /opt # tar xvzf phpMyAdmin-2.7.0-pl2 # ln -s phpMyAdmin-2.7.0-pl2 phpMyAdmin # cd phpMyAdmin # cp config.default.php config.inc.php
config.inc.php is the configuration file that will be read by phpMyAdmin when it starts up.
We need to find out how to get phpMyAdmin to prompt for a user name and password. Currently the password is hardcoded into the configuration file
. This is using the "config" auth_type. There are others available as well.
Edit the config.inc.php file in the phpmyadmin directory. (Editor suggestion: kedit is a simple, lightweight, graphical text editor.)
For each row in the table below, find the line with the string in the Key column, and assign to that key the string in the value column. Replace 'your new password' with your preferred password.
| Key | Value |
|---|---|
| $cfg['PmaAbsoluteUri'] | 'localhost/phpmyadmin/' |
| $cfg['Servers'][$i]['user'] | 'root' |
| $cfg['Servers'][$i]['password'] | 'your new password' |
| $cfg['ThemeDefault'] | 'darkblue_orange' |
Save your file and it's done.
This configuration is a basic configuration with one user having all rights on all the databases. For more security, it is better to create one user per database and to assign that user rights only on this database. Please read the MySQL documentation for more information.
There is a bug in the current version that prevents the pages' images from displaying correctly. This is the reason for modifying the theme default; "darkblue_orange" seems to behave better than the original theme.
Installing the Sun JDK
I had some problems trying to use the GNU Java shipped with Fedora. Using's Sun's Java instead solved the problems.
You can determine which one you are using by typing:
java -version
Sun Java will report:
java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
GNU Java will report:
gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Here's how to install Sun's Java:
rpm -ivh /mnt/linus-downloads/java/jdk-1_5_0_06-linux-i586.rpm
Create a symbolic link "jdk1.5" something like this:
cd /usr/java ln -s jdk1.5.0_06 jdk1.5
Add to the bottom your /etc/profile something like this:
# Added KRB, 2/06: JAVA_HOME=/usr/java/jdk1.5 PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME PATH
You may need to re-login or restart your system for these changes to take effect. Try "java -version" as described above to test this.
