From WeWeWeb Wiki
Jump to navigationJump to search

Apache 2 + tomcat 5 in Fedora

Steps (only steps, fetches online resources if you would like to understand the rational behind)

1. install the following packages if you missed

-- httpd
-- httpd-devel
-- tomcat5

1.1. Install tomcat manually

1.1.1 Go to and download the Linux Tomcat, current version is apache-tomcat-6.0.26.tar.gz

1.1.2. Extract it under /opt (say)

1.1.3. Create a symbolic link

 ln -s /opt/apache-tomcat-6.0.26 /opt/tomcat

1.1.4. Create a system service file tomcat and put it under /etc/rc.d/init.d. Remember a add "x" attribute to the file with the command:

 chmod +x tomcat

1.1.5. Add tomcat user and group

 groupadd -g 232 tomcat
 useradd -g tomcat -d /opt/tomcat -u 232 tomcat

1.1.6. Change the tomcat folder to tomcat:tomcat

 chown -R tomcat:tomcat /opt/tomcat
 chown -R tomcat:tomcat /opt/apache-tomcat-6.0.26

1.1.7. In the file in the bin folder of tomcat, add jdk location


2. Prepare Tomcat Connectors (Starting from Apache 2.2, mod_proxy_ajp will be used to replace mod_jk)

2.1. Build from source

2.1.1. download Tomcat Connectors

-- JK 1.2

2.1.2. extract the download file and go to the directory jakarta-tomcat-connectors-1.2.15-src/jk/native have a look on BUILDING if you want

2.1.3. Build

-- go to the directory


-- run the following command

./configure --with-apxs=/usr/sbin/apxs

if there is an error, check with config.log (for me, i miss a cpp complier, and i choose to install gcc-c++)

-- run make


2.2. Download the prebuild module

Go to the url

download the current vesion:

3. copy the module

cp ./apache-2.0/ /usr/lib/httpd/modules/

4. JKWorkersFile

-- go to directory


-- edit the

i. find the tomcat home and java home directory variable


and change the path point to the corresponding home directory in your system you may reference to /etc/tomcat5/tomcat5.conf

ii. change the java lib for the worker find the following comments

# The JVM that we are about to use

!!! and change the setting according to your java version and platform

-- run the following command cp /etc/httpd/conf/

5. edit httpd.conf -- open /etc/httpd/conf/httpd.conf in your favorable editor

-- find the section LoadModule and add the following line on the last LoadModule declaration

# for integrate tomcat 5
LoadModule jk_module modules/

-- find the section IfModule and add the following at last

# for integrate tomcat 5
<IfModule mod_jk.c>
    JkWorkersFile /etc/httpd/conf/
    JkLogFile /var/log/httpd/mod_jk.log
    JkLogLevel info
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
    JkMount /* ajp13

6. test configuration is error-free apachectl -t

7. restart httpd and tomcat5

8. test your server

Goto Linux