Configuring httpd.conf

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
visionmaster
Forum Contributor
Posts: 139
Joined: Wed Jul 14, 2004 4:06 am

Configuring httpd.conf

Post 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!
Last edited by visionmaster on Wed Oct 06, 2004 3:55 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
visionmaster
Forum Contributor
Posts: 139
Joined: Wed Jul 14, 2004 4:06 am

Post 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!
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply