LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-13-2009, 03:06 PM   #1
ziggy25
Member
 
Registered: Aug 2005
Distribution: Debian 5.2
Posts: 56

Rep: Reputation: 15
Apache2, Tomcat 6 and mod_jk


Hi all,

I cant figure out what i need to do to configure apache2 to talk to tomcat on my Debian linux environment. I have liferay running on Tomcat which i can access via the following URL

Code:
http://192.168.0.2:8080/web/guest
I am trying to configure Apache2 using mod_jk to allow me to access liferay using something like http://192.168.0.2/liferay but everything i do just returns the following error

Code:
The requested URL /liferay was not found on this server.
Apache/2.2.9 (Debian) mod_jk/1.2.26 PHP/5.2.6-1+lenny3 with Suhosin-Patch Server at 192.168.0.2 Port 80
Here is my configuration

workers.properties
Code:
workers.java_home=/data/resourceRepository/external/bin/SDK/jdk
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
/etc/apache2/sites-available/liferay

Code:
hpmedia:/etc/apache2/sites-available# cat liferay
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        JkMount /liferay default
        DirectoryIndex index.php index.html

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

</VirtualHost>
hpmedia:/etc/apache2/sites-available#
There is a symbolik link in sites-enabled that points to the above file.

changes to /etc/apache2/apache2.conf
Code:
JkWorkersFile /data/resourceRepository/internal/workarea/liferay/liferay_home/apache-tomcat-6.0.20/conf/workers.properties

JkLogFile /data/resourceRepository/internal/workarea/liferay/liferay_home/apache-tomcat-6.0.20/logs/jk.log

JkLogLevel info

JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

JkRequestLogFormat "%w %V %T"
/etc/apache2/mods-enabled/jk.load
Code:
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
My environment is as follows

Debian 5.2
Java5
Tomcat 6
Liferay 5.2.3
Apache2

Is there anything i am doing wrong in the above configuration?

Thanks in advance.
 
Old 09-13-2009, 03:07 PM   #2
ziggy25
Member
 
Registered: Aug 2005
Distribution: Debian 5.2
Posts: 56

Original Poster
Rep: Reputation: 15
I just had a look at the error.log file and it contains the following lines

Code:
[Sun Sep 13 20:21:16 2009] [notice] Apache/2.2.9 (Debian) mod_jk/1.2.26 PHP/5.2.6-1+lenny3 with Suhosin-Patch configured -- resuming normal operations
[Sun Sep 13 20:21:21 2009] [error] [client 192.168.0.3] File does not exist: /data/resourceRepository/internal/workarea/joomla/bravaonline/liferay
[Sun Sep 13 20:21:23 2009] [error] [client 192.168.0.3] File does not exist: /data/resourceRepository/internal/workarea/joomla/bravaonline/liferay
[Sun Sep 13 20:21:30 2009] [error] [client 192.168.0.3] File does not exist: /data/resourceRepository/internal/workarea/joomla/bravaonline/liferay
[Sun Sep 13 20:22:37 2009] [notice] caught SIGTERM, shutting down
[Sun Sep 13 20:22:38 2009] [warn] No JkShmFile defined in httpd.conf. Using default /var/log/apache2/jk-runtime-status
[Sun Sep 13 20:22:38 2009] [warn] No JkShmFile defined in httpd.conf. Using default /var/log/apache2/jk-runtime-status
[Sun Sep 13 20:22:38 2009] [notice] Apache/2.2.9 (Debian) mod_jk/1.2.26 PHP/5.2.6-1+lenny3 with Suhosin-Patch configured -- resuming normal operations
[Sun Sep 13 20:22:39 2009] [error] [client 192.168.0.3] File does not exist: /data/resourceRepository/internal/workarea/joomla/bravaonline/liferay
[Sun Sep 13 20:22:40 2009] [error] [client 192.168.0.3] File does not exist: /data/resourceRepository/internal/workarea/joomla/bravaonline/liferay
[Sun Sep 13 20:23:04 2009] [error] [client 192.168.0.3] File does not exist: /data/resourceRepository/internal/workarea/joomla/bravaonline/liferay
it looks like whenever i enter the http://192.168.0.1/liferay it is looking for a file inside an existing virtual host that does work. Does this mean that the second virtual host is not active?


here are my virtual hosts files in /etc/apache2/sites-enabled

Code:
<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /data/resourceRepository/internal/workarea/joomla/bravaonline
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /data/resourceRepository/internal/workarea/joomal/bravaonline/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
</VirtualHost>

and the second one which i want to point to the tomcat installation is

Code:
<VirtualHost www.brava1.com>
        ServerAdmin webmaster@localhost
        ServerName www.brava1.com
        ServerAlias brava1.com

        JkMount /lifer* default
        DirectoryIndex index.php index.html

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

</VirtualHost>
i changed it slightly to try and access it using http://www.brava1.com/liferay but i still get the same problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat 6 / apache 2.2.3 / mod_jk help mikelawford Linux - Server 11 08-20-2009 03:05 PM
apache, tomcat & mod_jk jonathon Linux - General 1 06-29-2006 01:06 AM
Apache/Tomcat/Mod_JK chantman Linux - Software 1 04-05-2006 04:32 AM
Apache Tomcat mod_jk connector dashp Linux - Newbie 0 03-24-2005 07:12 PM
connecting Apache 1.3.x and Tomcat 5.5: mod_jk [GOD]Anck Slackware 0 03-22-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration