View previous topic :: View next topic |
Author |
Message |
AphexFinn n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 04 Mar 2006 Posts: 3
|
Posted: Sat Aug 12, 2006 12:33 pm Post subject: Apache2 & Tomcat5 - Virutal Hosting |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
uweklosa Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 18 Feb 2005 Posts: 105
|
Posted: Sat Aug 12, 2006 3:28 pm Post subject: |
|
|
Did you try instead.
If the folder images/javascript/css is part of your application it should work. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
AphexFinn n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 04 Mar 2006 Posts: 3
|
Posted: Sat Aug 12, 2006 4:37 pm Post subject: |
|
|
uweklosa wrote: | Did you try 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 |
|
![](templates/gentoo/images/spacer.gif) |
uweklosa Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 18 Feb 2005 Posts: 105
|
Posted: Sun Aug 13, 2006 4:13 pm Post subject: |
|
|
AphexFinn wrote: | uweklosa wrote: | Did you try 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 |
|
![](templates/gentoo/images/spacer.gif) |
|