Page 1 of 1

Configuring httpd.conf

Posted: Tue Oct 05, 2004 4:02 pm
by visionmaster
Hello,

I have several domains on one webserver that have to be configured by httpd.conf

httpd.conf:
------------

Code: Select all

ї...] 
NameVirtualHost xxx.xxx.xx.xx 

<VirtualHost xxx.xxx.xx.xx> 
ServerName www.domain1.de 
DocumentRoot /www/www.domain1.de/site 
</VirtualHost> 

<VirtualHost xxx.xxx.xx.xx> 
ServerName domain1.de
DocumentRoot /www/www.domain1.de/site 
</VirtualHost> 

<VirtualHost xxx.xxx.xx.xx> 
ServerName domain2.de
DocumentRoot /www/www.domain2.de/site 
</VirtualHost> 
&#1111;...] 

OR

<VirtualHost xxx.xxx.xx.xx> 
ServerName domain1.de 
ServerAlias www.domain1.de 
DocumentRoot /www/www.domain1.de/site 
</VirtualHost> 

<VirtualHost xxx.xxx.xx.xx> 
ServerName domain2.de
DocumentRoot /www/www.domain2.de/site 
</VirtualHost>
==> Entering domain1.de in my browser opens up the content of http://www.domain2.de (I restarted httpd). Entering http://www.domain1.de, then the content of http://www.domain1.de is indeed shown. That is correct.

What am I doing wrong? How can I configure httpd.conf that also urls without the www are redirected correctly?

Thanks!

Posted: Tue Oct 05, 2004 4:05 pm
by feyd
come on now.. you've been here long enough to know better when posting stuff like this.. :P put some

Code: Select all

tags in there

Posted: Wed Oct 06, 2004 2:51 am
by twigletmac
Perhaps a bit of a hunt through the documentation will show up what you're looking for:
http://httpd.apache.org/docs/vhosts/name-based.html
http://httpd.apache.org/docs/mod/core.html#serveralias

Mac

Posted: Wed Oct 06, 2004 3:59 am
by visionmaster
Hello,

feyd, sorry for forgetting the

Code: Select all

tags...

[quote="twigletmac"]
http://httpd.apache.org/docs/mod/core.html#serveralias
[/quote]

Hmm, look at my last two containers, I added ServerAlias. Am I understanding something completely wrong?

Thanks!

Posted: Wed Oct 06, 2004 2:49 pm
by twigletmac
Have a look at how the various directives are being used and what they should be used for - I think that you may need to rejig your virtual host declarations.

Mac