View previous topic :: View next topic |
Author |
Message |
LL0rd l33t
Joined: 24 May 2004 Posts: 652 Location: Schlundcity
|
Posted: Mon Mar 17, 2008 3:19 pm Post subject: apache + Tomcat + mod_JK |
|
|
Hi,
I have several sites, that uses Java Servlets. For that sites I use the
Quote: | jkMount /routing/* ajp13 |
command to "mount" the servlet /routing to the /routing/ path of the domain. But now I have a site written completely in Java and want to "mount" it to the root path of a domain. How can I do that? _________________ Alte Mathematiker sterben nicht - sie verlieren nur einige ihrer Funktionen. |
|
Back to top |
|
|
ceric35 Tux's lil' helper
Joined: 27 Aug 2006 Posts: 115
|
Posted: Mon Mar 17, 2008 4:57 pm Post subject: |
|
|
If i understand, you want a virtualhost that route / to tomcat ?
if yes, you can do that:
Code: | <IfDefine JK>
<VirtualHost *:80>
ServerName your.domain
JkMount /* ajp13
</VirtualHost>
</IfDefine> |
|
|
Back to top |
|
|
LL0rd l33t
Joined: 24 May 2004 Posts: 652 Location: Schlundcity
|
Posted: Mon Mar 17, 2008 5:30 pm Post subject: |
|
|
ceric35 wrote: | If i understand, you want a virtualhost that route / to tomcat ?
|
On my tomcat server I have a servlet on the path /site123. I can access the site using tomcat with URL: http://10.2.0.200:8080/site123.
Now I want to access the servlet (not tomcat) by apache and a VirtualHost. _________________ Alte Mathematiker sterben nicht - sie verlieren nur einige ihrer Funktionen. |
|
Back to top |
|
|
ceric35 Tux's lil' helper
Joined: 27 Aug 2006 Posts: 115
|
|
Back to top |
|
|
LL0rd l33t
Joined: 24 May 2004 Posts: 652 Location: Schlundcity
|
|
Back to top |
|
|
ceric35 Tux's lil' helper
Joined: 27 Aug 2006 Posts: 115
|
Posted: Tue Mar 18, 2008 9:58 am Post subject: |
|
|
I would make this,
Code: | <IfDefine JK>
<VirtualHost *:80>
ServerName www.mysite.tld
JkMount /* ajp13
</VirtualHost>
</IfDefine> |
all / request goes to localhost tomcat,
and then in your web.xml that /* request goes to "site123" servlet:
Code: | <servlet>
<servlet-name>
site123
</servlet-name>
<servlet-class>
tld.mysite.site123
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>site123</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping> |
Was that your request ? |
|
Back to top |
|
|
|