Apache Name-based Virtual Hosts - configuring httpd.conf file

Posted by Dave on Server Fault See other posts from Server Fault or by Dave
Published on 2010-01-06T18:59:01Z Indexed on 2010/03/23 20:03 UTC
Read the original article Hit count: 266

Filed under:
|
|
|
|

Hi there. I am running a web app on Tomcat at the following location on my server.

/var/tomcat/webapps/SoccerApp

I am looking to update the Tomcat httpd.conf file with the following virtual host...

<VirtualHost *:80>
DocumentRoot /var/tomcat/webapps/SoccerApp/MyTeam
ServerName www.mysoccerapp.com
</VirtualHost> 

This gives me a 404 error as the directory MyTeam does not exist. However my application behaves in a way that it uses this URL directory as the name of the soccer team for which to display data, so it will never be a physical folder on the server. None the less, I would like www.mysoccerapp.com to resolve to webapps/SoccerApp/MyTeam, even though the directory isnt there.

does this make any sense? Any ideas on how to get this working. At the end of the day, i want to do the following...

www.teamone.com -> runs /webapps/SoccerApp/TeamOne
www.teamone.com -> runs /webapps/SoccerApp/TeamTwo

...where TeamOne and TeamTwo are not physical directories, but merely processed by my SoccerApp application as the current soccer team to display data for.

Many many thanks!

Dave.

© Server Fault or respective owner

Related posts about java

Related posts about tomcat