Problems Setting up Apache Virtual Server with multiple websites

Discussion in 'Site & Server Administration' started by novatec1@aol.com, Jan 8, 2013.

  1. #1
    I have an apache server that has been used to host one virtual site. I tried a add a second site (site2) but after creating the second virtual host I get a redirect loop error when I try to get to either site. Each site works independently as long as the other sites virtual host code is commented out. Any help is greatly appreciated. The code is as follows:

    NameVirtualHost *:80

    <VirtualHost site1.com:80>
    ServerName site1.com
    DocumentRoot /home/design/vhosts/site1.com/htdocs
    ServerAlias www.site1.com
    ErrorLog /home/design/vhosts/site1.com/logs/error.log
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
    TransferLog /home/design/vhosts/site1.com/logs/access.log
    LogLevel notice
    </VirtualHost>

    <Directory "/home/design/vhosts/site1.com">
    AllowOverride All
    </Directory>

    <VirtualHost www.site1.com:80>
    ServerName www.site1.com
    DocumentRoot /home/design/vhosts/www.site1com/htdocs
    ErrorLog /home/design/vhosts/www.site1.com/logs/error.log
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
    TransferLog /home/design/vhosts/www.site1.com/logs/access.log
    LogLevel notice

    # Alias for phpmyadmin
    #
    Alias /4lmyadmin /home/design/vhosts/www.site1.com/phpMyAdmin
    #
    </VirtualHost>

    <Directory /home/design/vhosts/www.site1.com>
    AllowOverride All
    </Directory>
    #

    <VirtualHost site2.com:80>
    ServerName site2.com
    DocumentRoot /home/design/vhosts/site2.com/htdocs
    ServerAlias www.site2.com
    </VirtualHost>
     
    novatec1@aol.com, Jan 8, 2013 IP
  2. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    230
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #2
    Check your Apache log files and probably you'll have more details on your problem.
     
    RoseHosting, Jan 9, 2013 IP