Re: VirtualHost problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your help both of you.
In the end, my ISP was to blame, not my config :-)


Yvo van Doorn wrote:

Thomas is right, the resources he provides are excellent. You have to make sure that DNS for domain1 and domain2 are pointing to your listener IP. Sometimes I have seen ISPs or people forget to add in a record to have WWW point to their IP as well.

If DNS is all correct and done and listening to the right IP then your basic vhost configuration should look like this:

<VirtualHost 1.2.3.4:80 <http://1.2.3.4/>>
DocumentRoot /home/os/html/domain1
ServerName www.domain1.com <http://www.domain1.com/>
ServerAlias domain1.com <http://domain1.com>
</VirtualHost>

<VirtualHost 1.2.3.4:80 <http://1.2.3.4/>>
DocumentRoot /home/os/html/domain2
ServerName www.domain2.co.uk <http://www.domain2.co.uk/>
ServerAlias domain2.co.uk <http://domain2.co.uk>
</VirtualHost>



On 12/8/06, *Luke Robinson* <luke@xxxxxxxxxxxxxxxxxxx <mailto:luke@xxxxxxxxxxxxxxxxxxx>> wrote:

    Could somebody please take a look at this config - I have stripped it
    down to something close to minimal.
    No hits on domain1.com <http://domain1.com> seem to reach the
    intended (first) VirtualHost
    directive.
    Hits on domain2.com <http://domain2.com> reach the second
    VirtualHost only when not preceded
    by www.
    LogLevel debug doesn't help much.

    Any help would be much appreciated.
    Luke Robinson
    ---

    ServerTokens Prod
    ServerRoot /home/os/httpd
    PidFile run/httpd.pid
    Timeout 120
    KeepAlive Off
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15

    LogLevel debug
    ErrorLog logs/error_log

    User os
    Group os
    UseCanonicalName Off
    HostnameLookups Off
    ServerSignature Off

    Listen 80
    NameVirtualHost 1.2.3.4:80 <http://1.2.3.4:80>

    <VirtualHost 1.2.3.4:80 <http://1.2.3.4:80>>
    DocumentRoot /home/os/html/domain1
    ServerName www.domain1.com <http://www.domain1.com>
    </VirtualHost>

    <VirtualHost 1.2.3.4:80 <http://1.2.3.4:80>>
    DocumentRoot /home/os/html/domain2
    ServerName www.domain2.co.uk <http://www.domain2.co.uk>
    </VirtualHost>



    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server
    Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
    <mailto:users-unsubscribe@xxxxxxxxxxxxxxxx>
       "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
    <mailto:users-digest-unsubscribe@xxxxxxxxxxxxxxxx>
    For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
    <mailto:users-help@xxxxxxxxxxxxxxxx>





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux