You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rathna <ge...@gmail.com> on 2010/06/01 20:34:28 UTC

apache2 tomcat6.0.26 mod_jk

Let's say I own two websites.
1) batman.com
2) superman.com

I have two web applications hosted in tomcat6 under webapps.
1) /usr/local/tomcat6/webapps/
batman
2) /usr/local/tomcat6/webapps/superman

I would like to configure apache in such a way that when I type the url
http://www.batman.com the website under /batman should be served. Likewise
if I type the url http://www.superman.com the website under /superman should
be served.

Right now, I can only get it working if I type http://www.batman.com/batmanor
http://www.superman.com/superman.

My settings are as follows:

/etc/apache2/sites-enabled/batman:
<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    ServerName batman.com
    ServerAlias www.batman.com

    JkMount / worker1
    JkMount /* worker1

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

/etc/apache2/sites-enabled/superman:
<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    ServerName superman.com
    ServerAlias www.superman.com

    JkMount / worker1
    JkMount /* worker1

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

/etc/apache2/worker.properties:
# Define worker
worker.list=worker1
# Set properties for worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

/etc/apache2/apache2.conf:
#Load jk_module
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
# workers.properties path
JkWorkersFile /etc/apache2/workers.properties
# JK shared memory path
JkShmFile /var/log/apache2/mod_jk.shm
# JK Log path
JkLogFile /var/log/apache2/mod_jk.log
# JK log level [debug/error/info]
JkLogLevel info
# Log Timestamp format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


I'm running this on Ubuntu 9.0.4 OS. I'm really stuck. Any help would be
much appreciated. Thank you.

Re: apache2 tomcat6.0.26 mod_jk

Posted by Rathna <ge...@gmail.com>.
Thank you. That solved my problem.


Regards,
Rathna




On Tue, Jun 1, 2010 at 10:40 AM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Rathna [mailto:genterie@gmail.com]
> > Subject: apache2 tomcat6.0.26 mod_jk
> >
> > Let's say I own two websites.
> > 1) batman.com
> > 2) superman.com
> >
> > I have two web applications hosted in tomcat6 under webapps.
> > 1) /usr/local/tomcat6/webapps/batman
> > 2) /usr/local/tomcat6/webapps/superman
>
> Don't know about doing this in httpd (do you really need it?), but for
> Tomcat, try the following:
>
> 1) Create two <Host> entries in Tomcat's server.xml, one for
> www.batman.com, one for www.superman.com.
>
> 2) Configure a separate appBase directory for each <Host>.
>
> 3) Move the batman webapp to the batman <Host> appBase directory as ROOT
> (case sensitive).
>
> 4) Likewise, move the superman webapp to the superman <Host> appBase
> directory as ROOT.
>
> You're done.
>
> Details are here:
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: apache2 tomcat6.0.26 mod_jk

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rathna [mailto:genterie@gmail.com]
> Subject: apache2 tomcat6.0.26 mod_jk
> 
> Let's say I own two websites.
> 1) batman.com
> 2) superman.com
> 
> I have two web applications hosted in tomcat6 under webapps.
> 1) /usr/local/tomcat6/webapps/batman
> 2) /usr/local/tomcat6/webapps/superman

Don't know about doing this in httpd (do you really need it?), but for Tomcat, try the following:

1) Create two <Host> entries in Tomcat's server.xml, one for www.batman.com, one for www.superman.com.

2) Configure a separate appBase directory for each <Host>.

3) Move the batman webapp to the batman <Host> appBase directory as ROOT (case sensitive).

4) Likewise, move the superman webapp to the superman <Host> appBase directory as ROOT.

You're done.

Details are here:
http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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