Hi.

I have Fedora 17 (Kernel Linux 3.6.6-1.fc17.i686) installed in an ASUS
laptop (A6Jseries).

I have Apache/2.2.22 installed that came with the Fedora 17.

I have the following Java:
java version "1.7.0_09-icedtea" 
OpenJDK Runtime Environment (fedora-2.3.3.fc17.1-i386) 
OpenJDK Client VM (build 23.2-b09, mixed mode) 
and is installed in /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9/

I have downloaded Tomcat 7 and installed in /usr/local/tomcat7 (tar
-zxvf apache-tomcat-7.0.27.tar.gz)

After starting Tomcat (/usr/local/tomcat7/bin/startup.sh) it works fine.
When openning the browser http://localhost:8080 the “Apache
Tomcat/7.0.32” page opens without problems.

To integrate Apache with Tomcat I have installed Tomcat Connectors JK
1.2 (mod_jk module) as follows:
su - 
[root@asuslaptop ~]# cd /etc/httpd/modules
[root@asuslaptop modules]#wget
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.31/i386/mod_jk-1.2.31-httpd-2.2.x.so
[root@asuslaptop modules]# mv mod_jk-1.2.31-httpd-2.2.x.so mod_jk.so
[root@asuslaptop modules]# chmod 755 mod_jk.so

I have created file workers.properties in /etc/httpd/conf.d/ (as
follows)
[root@asuslaptop modules]# cd /etc/httpd/conf.d/
[root@asuslaptop conf.d]# cat > /etc/httpd/conf.d/workers.properties
workers.tomcat_home=/usr/local/tomcat7/ 
workers.java_home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9/ 
ps=/ 
worker.list=worker1 
worker.worker1.type=ajp13 
worker.worker1.host=localhost 
worker.worker1.port=8009 
worker.worker1.lbfactor=50 

I have created file mod_jk.conf in /etc/httpd/conf.d/ (as follows)
[root@asuslaptop conf.d]#cat > /etc/httpd/conf.d/mod_jk.conf
JkWorkersFile "/etc/httpd/conf.d/workers.properties" 
JkLogFile "logs/mod_jk.log" 
JkLogLevel info 
JkMount /*.jsp worker1 
JkMount /servlet/* worker1 
JkMount /*.do worker1 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 

I have edited httpd.conf as follows:
[root@asuslaptop conf.d]# cd /etc/httpd/conf/
[root@asuslaptop conf]# vi httpd.conf
- added the line:
LoadModule jk_module modules/mod_jk.so
- Edited the following line to be:
DirectoryIndex index.htm default.htm default.jsp
- I have added the following virtual host:
<VirtualHost *:80> 
    ServerAdmin fhai...@odline.com 
    DocumentRoot /var/www/html/lofttreasures 
    ServerName www.lofttreasures.com 
    ErrorLog logs/lofttreasures.com-error_log 
    CustomLog logs/lofttreasures.com-access_log common 
</VirtualHost> 
- At the end if the file I have inserted:
Include conf.d/*.conf

I have edited the file server.xml:
[root@asuslaptop conf]# cd /usr/local/tomcat7/conf/
[root@asuslaptop conf]# vi server.xml
Before “</Engine>” tag I have inserted the following:
<Host name="www.lofttreasures.com" debug="0" appBase="/var/www/html" 
        unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false"> 
</Host> 

In Catalina directory I have created the following:
[root@asuslaptop conf]# cd /usr/local/tomcat7/conf/Catalina/
[root@asuslaptop Catalina]# mkdir  www.lofttreasures.com
[root@asuslaptop Catalina]# cd www.lofttreasures.com/
Created the file context.xml and edit as follows:
[root@asuslaptop www.lofttreasures.com]# vi context.xml
<Context path="" docBase="lofttreasures" debug="0" reloadable="false"
crossContext="false"> 
</Context> 

I have restarted the Tomcat with:
[root@asuslaptop ~]# /usr/local/tomcat7/bin/shutdown.sh 
[root@asuslaptop ~]# /usr/local/tomcat7/bin/startup.sh 

I have started Apache with:
[root@asuslaptop ~]# service httpd start

I have checked if the Tomcat and Apache started with:
[root@asuslaptop ~]# ps -U root -u root u
The result is:
//bin/java
-Djava.util.logging.config.file=/usr/local/tomcat7/conf/logging ...
/usr/sbin/httpd -k start

Tomcat seems to work fine when I test in a browser with
http://localhost:8080/ it opens  the “Apache Tomcat/7.0.32” page.

If I test the Apache only by trying in the browser
www.lofttreasures.com it open the test HTML page without problems.

The problem is when I try to open a JSP page with
www.lofttreasures.com/index.jsp I get the page with the JSP source code.

I would appreciate it very much if I could get help to solve this
problem.

Thanks in anticipation.

Best regards
Farid Haider




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to