Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache + Tomcat + mod_JK
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
LL0rd
l33t
l33t


Joined: 24 May 2004
Posts: 652
Location: Schlundcity

PostPosted: Mon Mar 17, 2008 3:19 pm    Post subject: apache + Tomcat + mod_JK Reply with quote

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
View user's profile Send private message
ceric35
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 115

PostPosted: Mon Mar 17, 2008 4:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
LL0rd
l33t
l33t


Joined: 24 May 2004
Posts: 652
Location: Schlundcity

PostPosted: Mon Mar 17, 2008 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
ceric35
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 115

PostPosted: Mon Mar 17, 2008 5:44 pm    Post subject: Reply with quote

you want http://10.2.0.200/site123 point to http://10.2.0.200:8080/site123 ?
Back to top
View user's profile Send private message
LL0rd
l33t
l33t


Joined: 24 May 2004
Posts: 652
Location: Schlundcity

PostPosted: Mon Mar 17, 2008 6:18 pm    Post subject: Reply with quote

ceric35 wrote:
you want http://10.2.0.200/site123 point to http://10.2.0.200:8080/site123 ?


No, I want http://10.2.0.200/ or http://www.mysite.tld point to http://10.2.0.200:8080/site123
_________________
Alte Mathematiker sterben nicht - sie verlieren nur einige ihrer Funktionen.
Back to top
View user's profile Send private message
ceric35
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 115

PostPosted: Tue Mar 18, 2008 9:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum