apache 2 problems

    Date: 11/26/05 (Apache)    Keywords: apache

    This has annoyed me for a while and need your help.

    apache2 install on debian.

    In /etc/apache2/sites-available I have two files which has this:

    < = [ and > = ]

    file1

    NameVirtualHost 12.34.56.789
    Options +ExecCGI

    [VirtualHost www.adomain1.com]
    DocumentRoot /home/domains/adomain1.com/www
    ServerName www.adomain1.com
    ErrorLog /home/domains/adomain1.com/logs/www-error.log
    CustomLog /home/domains/adomain1.com/logs/www-access.log combined
    [/VirtualHost]

    [VirtualHost adomain1.com]
    DocumentRoot /home/domains/adomain1.com/www
    ServerName adomain1.com
    ErrorLog /home/domains/adomain1.com/logs/www-error.log
    CustomLog /home/domains/adomain1.com/logs/www-access.log combined
    [/VirtualHost]

    file2

    [VirtualHost www.adomain2.com]
    DocumentRoot /home/domains/adomain2.com/www
    ServerName www.adomain2.com
    ErrorLog /home/domains/adomain2.com/logs/www-error.log
    CustomLog /home/domains/adomain2.com/logs/www-access.log combined
    [/VirtualHost]

    [VirtualHost adomain2.com]
    DocumentRoot /home/domains/adomain2.com/www
    ServerName adomain2.com
    ErrorLog /home/domains/adomain2.com/logs/www-error.log
    CustomLog /home/domains/adomain2.com/logs/www-access.log combined
    [/VirtualHost]

    When I start apache, I get this error message:

    [Sat Nov 26 15:44:46 2005] [warn] VirtualHost www.domain1.com:0 overlaps with VirtualHost www.domain2.com:0, the first has precedence, perhaps you need a NameVirtualHost directive

    I use one IP address to hold more than one domain.

    When I remove the bits that doesn't have the 'www' entry, it works fine. But I don't want that as people who go to a site without the 'www' bit will be redirected to a different page.

    Is there any easier way to do this - getting people to visit the same, via http://www.adomain1.com and http://adomain1.com to one page and http://www.adomain2.com and http://adomain2.com to another page?

    Thanks.

    Source: http://community.livejournal.com/apache/27109.html

« Apache's connections || Content Negotiation in... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home