Forum Moderators: phranque

Message Too Old, No Replies

[Apache 2]Two aliases pointing on different directories?

         

tmqt

8:46 am on Oct 18, 2005 (gmt 0)



Hi everyone,

First please excuse my english,

I'm running an Apache 2 server on a Ubuntu 5.04 (soon 5.10) Linux. I actually have one alias pointing on this web server : igat.example.com

My server also hosts a website for another unit of the departement, available at igat.example.com/geom.

I can create another alias, something like geom.example.com without any problem, but I can only redirect it on the IP adress of the server. What I would like si to tell Apache to redirect people using geom.example.com to the correct subdirectory, e.g. igat.example.com/geom instead of igat.example.com/.

I thought it would be simple to use the "VirtualHost" directive, thinking that it was designed for this. Thus I added the following section to the httpd.conf file :

<VirtualHost *>
ServerAdmin *@example.com
DocumentRoot /opt/lampp/htdocs/geom
ServerName geom.example.com
ErrorLog /apache/logs/geom_error.log
CustomLog /apache/logs/geom/custom.log common
</VirtualHost>

I created the /apache/logs directory, the two log files, and gave them the necessary rights.

But restarting Apache, I had the bad surprise that all the requests led me to igat.example.com/geom, even if I tried igat.example.com (I didn't try the IP adress though, but since it only is an alias it would surely behave the same way).

Is there anyone who could tell me what I have done wrong? Thanks for your answers!

Stephen

[edited by: jdMorgan at 10:03 pm (utc) on Oct. 18, 2005]
[edit reason] Obscured URL per TOS. [/edit]