apache viurtual hosts

From: upro (upro_at_gmx.net)
Date: 11/25/04


Date: Thu, 25 Nov 2004 13:09:19 +0100

Hi!

I run a (new) webserver, and have recently tried to add subdomains via
the Virtual Hosts directive in the httpd.conf file.

I want to have a subdomain mail.server.com. To di so I have made the
following modifications in httpd.conf:

<VirtualHost 192.168.1.2:80>
ServerAdmin mailmaster@server.com
DocumentRoot /www/mail
ServerName mail.server.com
ErrorLog /var/log/apache/mail_error_log
CustomLog /var/log/apache/mail_error_log common
</VirtualHost>

192.168.1.2 is the fix IP of my server within the network.

IT worked, when trying mail.server.com the page from /ww/mail was
displayed. But www.server.com also pointed to mail.server.com.

Then I tried to add www explicitly:

NameVirtualHost www.server.com
<VirtualHost 192.168.1.33:80>
ServerAdmin root@server.com
DocumentRoot /www/
ServerName server.com
ServerAlias www.server.com
ErrorLog /var/log/apache/mail_error_log
CustomLog /var/log/apache/mail_error_log common
</VirtualHost>

NameVirtualHost mail.server.com
<VirtualHost 192.168.1.2:80>
ServerAdmin mailmaster@server.com
DocumentRoot /www/mail
ServerName mail.server.com
ErrorLog /var/log/apache/mail_error_log
CustomLog /var/log/apache/mail_error_log common
</VirtualHost>

But now mail.server.com displays the page from www.server.com

What am I missing? How can I sucessfully add the mail.server.com
subdomain to resolve to /www/mail?

Thanks in advance, guys!

-- 
Michael
r-znvy: zvpunry.wryqra  jro.qr (chg gur "@" jurer vg svgf...)
ab fcnz cyrnfr


Relevant Pages

  • RE: ASP/ASP.NET page that reacts a special way to items coming from a particular subdomain (programm
    ... servername in url and parse it(to see whether it contains subdomain info). ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Vhost_alias & more
    ... I can do that with several <VirtualHost> with different ServerName, but I don't want annoyed me by adding a new directive for each subdomain. ... Matthieu ...
    (comp.infosystems.www.servers.unix)
  • Re: Apache Virtual Server [SOLVED]
    ... Zend documentation it looks like Zend wants a certain directory structure ... The last directory 'public' wants to be the DocumentRoot ... ServerName confianza ...
    (Fedora)
  • Re: Why wont this script run??
    ... I forgot to say that if i start httpd by hand, ... I reinstalled apache, and it works. ... DocumentRoot /home/www/html ... ServerName mo.moso.dk ...
    (Fedora)
  • Re: Apache Virtual Server
    ... I am playing with the Zend Framework on my laptop. ... The last directory 'public' wants to be the DocumentRoot ... I set up /etc/hosts so both confianza and confianzazend resolve to ... ServerName confianza ...
    (Fedora)