Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tomcat vhosts && apache [solved]
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
BlinkEye
Veteran
Veteran


Joined: 21 Oct 2003
Posts: 1046
Location: Gentoo Forums

PostPosted: Sun Aug 22, 2004 7:09 pm    Post subject: tomcat vhosts && apache [solved] Reply with quote

i'm curious if there is a way i could set up a virtual tomcat host, i.e. that i could access a tomcat project via

my_tomcat_project.mydomain

instead of

mydomain/my_tomcat_project

how would this apache-vhost.conf file look like?
_________________
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick


Last edited by BlinkEye on Tue Aug 24, 2004 12:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
sf_alpha
Tux's lil' helper
Tux's lil' helper


Joined: 19 Sep 2002
Posts: 136
Location: Bangkok, TH

PostPosted: Sun Aug 22, 2004 8:15 pm    Post subject: Reply with quote

You need to add new host in Tomcat (Catalina Services) Using Tomcat Admin

First, add new tomcat users with role admin,manager to /etc/tomcat5/tomcat-users.xml

Goto tomcat page, Goto Tomcat Admin and login with user/password you set it. Add new host to catalina server, You can give same webapps root as localhost (Default). And the add new context (/) to specific directory you want it to be.

If you interested in mod_jk2, I have an ebuild for it :)
http://sf-alpha.bjgang.org/gentoo/mod_jk2/
I may submit to portage soon :roll:

add this to /etc/apache2/conf/worker2.properties

Code:

# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009


You should comment all [uri:xxxx] section (that is examples) too.

edit /etc/conf.d/apache2 add/append '-D JK2' to APACHE2_OPTS

For vhosts, This is my vhosts

Code:

<IfModule mod_jk2.c>

<VirtualHost bulldog.scphost.com:80>
        ServerName bulldog.scphost.com
        DocumentRoot /home/sf_alpha/webapps
        <Location /*>
                JkUriSet worker ajp13:localhost:8009
        </Location>
        DirectoryIndex index.html index.jsp
</VirtualHost>

</IfModule>


I have add new host in tomcat admin page (I use port 8080 on localhost to access tomcat directly). Useing applicaton base as DocumentRoot above and add new (/) Context to ROOT subdirs inside it (like tomcat's apps base)[/code]
_________________
Gentoo Mirrors in Thailand (and AP)
http://gentoo.in.th
Back to top
View user's profile Send private message
BlinkEye
Veteran
Veteran


Joined: 21 Oct 2003
Posts: 1046
Location: Gentoo Forums

PostPosted: Sun Aug 22, 2004 10:06 pm    Post subject: Reply with quote

thanks a lot for your answer. i didn't think i'd get such a straight answer right away.
i'm already running mod_jk2, so this issue is solved! i'm trying your solution asap and will get back to you if i have further questions.
_________________
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Back to top
View user's profile Send private message
Bombe
n00b
n00b


Joined: 07 Jul 2004
Posts: 21
Location: Hamburg, Germany

PostPosted: Tue Aug 24, 2004 11:57 am    Post subject: Reply with quote

Wow, that works like a charm. Thanks a lot, sf_alpha.
Back to top
View user's profile Send private message
onkelfusspilz
Tux's lil' helper
Tux's lil' helper


Joined: 26 Aug 2002
Posts: 130
Location: Germany

PostPosted: Sat Feb 25, 2006 3:15 pm    Post subject: Reply with quote

Hi sf_alpha,

since your link for mod_jk2 doesn't work anymore, I searched the internet for mod_jk2 and gentoo and it seems to me, that mod_jk2 is not maintained anymore and mod_jk is the way to go.

I allready have mod_jk installed and running. I can call a index.jsp file and it is processed by apache/mod_jk/tomcat.

But what if I want a servlet, instead of a JSP-Page? The Servlet is running in the tomcat context, but the "JkUriSet" keyword doesn't seem to be known by my apache/modjk combination.

I wonder if I may use mod_proxy for this, but is this the official way to go?

Anyone with an hint?
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