Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 & Tomcat5 - Virutal Hosting
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
AphexFinn
n00b
n00b


Joined: 04 Mar 2006
Posts: 3

PostPosted: Sat Aug 12, 2006 12:33 pm    Post subject: Apache2 & Tomcat5 - Virutal Hosting Reply with quote

I have recently setup Apache2 with Tomcat5 as per http://gentoo-wiki.com/HOWTO_Apache2_and_Tomcat5 and have various virtual hosts defined in /etc/apache2/vhosts.d/00_default_vhost.conf


I have setup only one of my Virtual hosts to deliver jsp

<VirtualHost *:80>
ServerName www.myserver.com
ServerAlias myserver.com
DocumentRoot "/var/www/myserver.com/htdocs"
<Directory "/var/www/myserver.com/htdocs">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.html
jkMount /*.jsp ajp13
ErrorLog /var/log/apache2/error-myserver.com.log
CustomLog /var/log/apache2/access-myserver.com.log combined
</VirtualHost>

So, I can goto http://www.myserver.com/index.jsp and I get the Tomcat default page minus the graphics - I understand that the graphics arent displayed as my Apache root isn't the same as Tomcat ROOT, so Apache can't deliver the files - fine.


I have written a Spring app that is deployed under Tomcat

.../webapps/myapp/


This is accesible via

1) http://localhost:8080/myapp (everything works a treat, as expected)

and

2) http://www.myserver.com/myapp/index.jsp (the app works, but images/javascript/css etc arent delivered as Apache can't see them)


Basically, what I want to know is this

How can I configure Apache and Tomcat so that I can goto to the URL http://www.myserver.com/ and have the webapp under .../webapps/myapp/ delivered?
And how can I get Apache to deliver the images/javascript when I goto the same url?
Back to top
View user's profile Send private message
uweklosa
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2005
Posts: 105

PostPosted: Sat Aug 12, 2006 3:28 pm    Post subject: Reply with quote

Did you try
Code:
jkMount * ajp13
instead.

If the folder images/javascript/css is part of your application it should work.
Back to top
View user's profile Send private message
AphexFinn
n00b
n00b


Joined: 04 Mar 2006
Posts: 3

PostPosted: Sat Aug 12, 2006 4:37 pm    Post subject: Reply with quote

uweklosa wrote:
Did you try
Code:
jkMount * ajp13
instead.

If the folder images/javascript/css is part of your application it should work.


Would that not mean that Tomcat was doing all the serving? rather than Apache serving the static content and Tomcat serving the java.
Back to top
View user's profile Send private message
uweklosa
Tux's lil' helper
Tux's lil' helper


Joined: 18 Feb 2005
Posts: 105

PostPosted: Sun Aug 13, 2006 4:13 pm    Post subject: Reply with quote

AphexFinn wrote:
uweklosa wrote:
Did you try
Code:
jkMount * ajp13
instead.

If the folder images/javascript/css is part of your application it should work.


Would that not mean that Tomcat was doing all the serving? rather than Apache serving the static content and Tomcat serving the java.


Yes, it would mean that. If you want Apache serving the static content you have to pu the static content somewhere, where Apache can read it, e.g. /var/www/localhost/images.
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