You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andreas Hirner <an...@projektinter.net> on 2003/01/09 11:43:36 UTC

Virtual hosting and mod_jk

Hello,

I have successfully integrated tomcat (4.0.6) with apache (1.3.26) on linux
and I am able to access a single virtual host (e.g. myapplication) located
in the tomcat/webapps/myapplication directory using a url like that:

http://www.mydomain.com/myapplication/index.jsp

However I would like to be able to access the files in that directory
without using the path /myapplication, i.e.

http://www.mydomain.com/index.jsp

I have been playing around with the configuration files but I have not been
able to alter the configuration according to my needs. Does anybody know if
this is possible?

Thanks in advance.

Andreas

PS: The relevant sections of httpd.conf and server.xml are listed below.


http.conf
#########################
<VirtualHost *:80>
   ServerName meinfotoalbum.com
   ServerAlias www.meinfotoalbum.com

   DocumentRoot /usr/local/tomcat/mywebapps/meinfoto
   <Directory "/usr/local/tomcat/mywebapps/meinfoto">
         DirectoryIndex index.htm index.html
        Options Indexes FollowSymLinks
   </Directory>

    #mod_jk link to tomcat
   JkMount / ajp13
   JkMount /*jsp ajp13

   #prohibit access of WEB-INF
    <Location "/WEB-INF/">
        AllowOverride None
        deny from all
   </Location>

    #prohibit access of META-INF
   <Location "/META-INF/">
      AllowOverride None
       deny from all
   </Location>

   </VirtualHost>
################################
server.xml
################################
  <Host name="meinfotoalbum.com" debug="0" appBase="mywebapps"
unpackWARs="true">
    <Alias>www.meinfotoalbum.com</Alias>
    <Logger className="org.apache.catalina.logger.FileLogger"
        directory="logs" prefix="meinfotoalbum_log." suffix=".txt"
        timestamp="true" />
    <Context path="" docBase="meinfoto" debug="0" reloadable="false"/>
    <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
        append="true"  />
   </Host>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Virtual hosting and mod_jk

Posted by Andreas Hirner <an...@projektinter.net>.
Hi,

Thank you for your help. Unfortunately I had already solved the problem
myself.

The only thing I did is uncomment the folowing line in the httpd.conf

Include /usr/local/tomcat/conf/auto/mod_jk.conf

and replace with the following block, so that the automatic configuration is
disabled.

 <IfModule mod_jk.c>
    JkWorkersFile "/usr/local/tomcat/conf/jk/workers.properties"
    JkLogFile "/usr/local/tomcat/logs/mod_jk.log"
    JkLogLevel error
 </IfModule>

Cheers
Andreas


----- Original Message -----
From: "Eric Ricker" <er...@techtarget.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 3:40 PM
Subject: Re: Virtual hosting and mod_jk


> Alias myapplications /your/path/here/tomcat/webapps/myapplications
>
> slap that in your httpd.conf and you should be happy.
> --
> Eric Ricker
> ericricker@usa.net
> ----- Original Message -----
> From: "Andreas Hirner" <an...@projektinter.net>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Thursday, January 09, 2003 5:43 AM
> Subject: Virtual hosting and mod_jk
>
>
> > Hello,
> >
> > I have successfully integrated tomcat (4.0.6) with apache (1.3.26) on
> linux
> > and I am able to access a single virtual host (e.g. myapplication)
located
> > in the tomcat/webapps/myapplication directory using a url like that:
> >
> > http://www.mydomain.com/myapplication/index.jsp
> >
> > However I would like to be able to access the files in that directory
> > without using the path /myapplication, i.e.
> >
> > http://www.mydomain.com/index.jsp
> >
> > I have been playing around with the configuration files but I have not
> been
> > able to alter the configuration according to my needs. Does anybody know
> if
> > this is possible?
> >
> > Thanks in advance.
> >
> > Andreas
> >
> > PS: The relevant sections of httpd.conf and server.xml are listed below.
> >
> >
> > http.conf
> > #########################
> > <VirtualHost *:80>
> >    ServerName meinfotoalbum.com
> >    ServerAlias www.meinfotoalbum.com
> >
> >    DocumentRoot /usr/local/tomcat/mywebapps/meinfoto
> >    <Directory "/usr/local/tomcat/mywebapps/meinfoto">
> >          DirectoryIndex index.htm index.html
> >         Options Indexes FollowSymLinks
> >    </Directory>
> >
> >     #mod_jk link to tomcat
> >    JkMount / ajp13
> >    JkMount /*jsp ajp13
> >
> >    #prohibit access of WEB-INF
> >     <Location "/WEB-INF/">
> >         AllowOverride None
> >         deny from all
> >    </Location>
> >
> >     #prohibit access of META-INF
> >    <Location "/META-INF/">
> >       AllowOverride None
> >        deny from all
> >    </Location>
> >
> >    </VirtualHost>
> > ################################
> > server.xml
> > ################################
> >   <Host name="meinfotoalbum.com" debug="0" appBase="mywebapps"
> > unpackWARs="true">
> >     <Alias>www.meinfotoalbum.com</Alias>
> >     <Logger className="org.apache.catalina.logger.FileLogger"
> >         directory="logs" prefix="meinfotoalbum_log." suffix=".txt"
> >         timestamp="true" />
> >     <Context path="" docBase="meinfoto" debug="0" reloadable="false"/>
> >     <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
> >         append="true"  />
> >    </Host>
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Virtual hosting and mod_jk

Posted by "Noel J. Bergman" <no...@devtech.com>.
The default docBase for "" is webapps/ROOT/, which is why this:

        <!--
          <Context path="" docBase="ROOT" debug="0"/>
        -->

still happens even though it is commented out.  One can either replace the
contents of ROOT/, or uncomment and modify that <Context> element.

Did he mention that he was running from a .war?

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Virtual hosting and mod_jk

Posted by Andoni <an...@indigo.ie>.
It is definitely not necessary to rename the .war file to ROOT.  There is no
special significance in that name.

Andoni.
----- Original Message -----
From: "Noel J. Bergman" <no...@devtech.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 5:32 PM
Subject: RE: Virtual hosting and mod_jk


> > and I am able to access a single virtual host (e.g. myapplication)
located
> > in the tomcat/webapps/myapplication directory using a url like that:
> > http://www.mydomain.com/myapplication/index.jsp
>
> > However I would like to be able to access the files in that directory
> > without using the path /myapplication, i.e.
> >
> > http://www.mydomain.com/index.jsp
>
> Have you tried to rename myapplication/ to ROOT/, or adjust your <Context
> path="" ... /> element?
>
> --- Noel
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Virtual hosting and mod_jk

Posted by "Noel J. Bergman" <no...@devtech.com>.
> and I am able to access a single virtual host (e.g. myapplication) located
> in the tomcat/webapps/myapplication directory using a url like that:
> http://www.mydomain.com/myapplication/index.jsp

> However I would like to be able to access the files in that directory
> without using the path /myapplication, i.e.
>
> http://www.mydomain.com/index.jsp

Have you tried to rename myapplication/ to ROOT/, or adjust your <Context
path="" ... /> element?

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Virtual hosting and mod_jk

Posted by Eric Ricker <er...@techtarget.com>.
Alias myapplications /your/path/here/tomcat/webapps/myapplications

slap that in your httpd.conf and you should be happy.
--
Eric Ricker
ericricker@usa.net
----- Original Message -----
From: "Andreas Hirner" <an...@projektinter.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, January 09, 2003 5:43 AM
Subject: Virtual hosting and mod_jk


> Hello,
>
> I have successfully integrated tomcat (4.0.6) with apache (1.3.26) on
linux
> and I am able to access a single virtual host (e.g. myapplication) located
> in the tomcat/webapps/myapplication directory using a url like that:
>
> http://www.mydomain.com/myapplication/index.jsp
>
> However I would like to be able to access the files in that directory
> without using the path /myapplication, i.e.
>
> http://www.mydomain.com/index.jsp
>
> I have been playing around with the configuration files but I have not
been
> able to alter the configuration according to my needs. Does anybody know
if
> this is possible?
>
> Thanks in advance.
>
> Andreas
>
> PS: The relevant sections of httpd.conf and server.xml are listed below.
>
>
> http.conf
> #########################
> <VirtualHost *:80>
>    ServerName meinfotoalbum.com
>    ServerAlias www.meinfotoalbum.com
>
>    DocumentRoot /usr/local/tomcat/mywebapps/meinfoto
>    <Directory "/usr/local/tomcat/mywebapps/meinfoto">
>          DirectoryIndex index.htm index.html
>         Options Indexes FollowSymLinks
>    </Directory>
>
>     #mod_jk link to tomcat
>    JkMount / ajp13
>    JkMount /*jsp ajp13
>
>    #prohibit access of WEB-INF
>     <Location "/WEB-INF/">
>         AllowOverride None
>         deny from all
>    </Location>
>
>     #prohibit access of META-INF
>    <Location "/META-INF/">
>       AllowOverride None
>        deny from all
>    </Location>
>
>    </VirtualHost>
> ################################
> server.xml
> ################################
>   <Host name="meinfotoalbum.com" debug="0" appBase="mywebapps"
> unpackWARs="true">
>     <Alias>www.meinfotoalbum.com</Alias>
>     <Logger className="org.apache.catalina.logger.FileLogger"
>         directory="logs" prefix="meinfotoalbum_log." suffix=".txt"
>         timestamp="true" />
>     <Context path="" docBase="meinfoto" debug="0" reloadable="false"/>
>     <Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
>         append="true"  />
>    </Host>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>