|
||||||||
|
|
#1
|
|
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 (E-Mail Removed) 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 (E-Mail Removed) 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 (E-Mail Removed) 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 upro |
|
#2
|
|||
|
|||
|
On 2004-11-25, upro <(E-Mail Removed)> wrote:
><VirtualHost 192.168.1.2:80> If you are using name-based virtualhosts don't use an IP address, use * > displayed. But www.server.com also pointed to mail.server.com. If there is only one vhost, that is used to serve all the requests, if you have multiple vhost, the first one defined (or the one defined with _default_) is used to serve all the requests for unknown Vhosts. > NameVirtualHost www.server.com <<< what's this? > NameVirtualHost mail.server.com <<< what's this? You need ONE "NameVirtualHost" directives, not more. Than any number of <VirtualHost> blocks. Again, use * not a hostname or an IP. NOTE: the example configuration in httpd.conf DOES WORK. > What am I missing? The documentation, on httpd.apache.org Davide -- "I'm not lean and mean, I'm surly and anorexic". -- Chris "Saundo" Saunderson on alt.sysadmin.recovery |
|
#3
|
|||
|
|||
|
Davide Bianchi <(E-Mail Removed)> writes:
> On 2004-11-25, upro <(E-Mail Removed)> wrote: >><VirtualHost 192.168.1.2:80> > > If you are using name-based virtualhosts don't use an IP address, use * > >> displayed. But www.server.com also pointed to mail.server.com. > > If there is only one vhost, that is used to serve all the requests, if > you have multiple vhost, the first one defined (or the one defined with > _default_) is used to serve all the requests for unknown Vhosts. > >> NameVirtualHost www.server.com <<< what's this? >> NameVirtualHost mail.server.com <<< what's this? > > You need ONE "NameVirtualHost" directives, not more. Than any number > of <VirtualHost> blocks. Again, use * not a hostname or an IP. > > NOTE: the example configuration in httpd.conf DOES WORK. > >> What am I missing? > > The documentation, on httpd.apache.org > > Davide Thanks, now I got it! I tried lots of hints form the doc, but I believed the * was to be replaced by my actual IP or server name. Somehow misleading in the documentation... Thanks a lot, you relieved me! -- Michael r-znvy: zvpunry.wryqra jro.qr (chg gur "@" jurer vg svgf...) ab fcnz cyrnfr |
![]() |
| Tags |
| apache, hosts, viurtual |
| Thread Tools | |
| Display Modes | |
|
|