Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

For some reason both domain1.org and domain2.org are both directing into /var/www is there something I missed? Apache2 error log is clean too? I just don't get it. It should be a simple vhosting

<VirtualHost *:80>

    ServerName domain1.org
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/

    <Directory /var/www/>
        DirectoryIndex index.php        
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel debug

    CustomLog /var/log/apache2/access.log combined

</VirtualHost>

<VirtualHost *:80>

    ServerName domain2.org
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/wordpress-1/

    <Directory /var/www/wordpress-1/ >
        DirectoryIndex index.php        
        Options -Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel debug

    CustomLog /var/log/apache2/access.log combined

</VirtualHost>
share|improve this question

migrated from stackoverflow.com Oct 1 '11 at 12:27

This question came from our site for professional and enthusiast programmers.

1  
Do you have NameVirtualHost before these? –  sep Oct 1 '11 at 0:13
    
Depending on what version of Linux you have. I put my virtual hosts in different files under the sites-available/ folder in the apache2 dir, and I have to enable them with a2ensite before they will work. Maybe this has to apply to you? –  thegaffney Oct 1 '11 at 1:51
    
I realize now that I get [Sun Oct 02 06:26:32 2011] [error] [client 69.41.186.114] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. as an error in my apache error log? This is followed by a internal server error –  ehime Oct 3 '11 at 16:02

1 Answer 1

up vote 2 down vote accepted

There doesn't appear to be anything wrong with your VirtualHost definitions. Did you remember to restart apache after updating the config file ? You don't say which OS you are using so it's difficult to progress. You should have a look at the output of

/usr/sbin/apache2ctl -S 

or

/usr/sbin/httpd -S

this will show the vhirtual hoststhat your apache knows about and will also indicate if you have name-based virtual hosting enabled e.g.

 /usr/sbin/apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server test1.lan (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost test1.lan (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost centos1.lan (/etc/apache2/sites-enabled/000-default:94)
         port 80 namevhost host1.test.lan (/etc/apache2/sites-enabled/subhosts:41)
         port 80 namevhost host2.test.lan (/etc/apache2/sites-enabled/subhosts:49)
Syntax OK

If you don't have a *:80 is a NameVirtualHost then you will need to enable it with a

NameVirtualHost *:80 

directive prior to your VirtualHost definitions.

share|improve this answer
    
I'm using Ubuntu 11.04, apache was restarted via $ service apache2 restart I'm not seeing an issue with the vhost either which is the problem? –  ehime Oct 3 '11 at 15:59
    
the above returns root@li85-37:/etc/apache2/sites-enabled# /usr/sbin/apache2ctl -S VirtualHost configuration: wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server micros.themonastery.org (/etc/apache2/sites-enabled/000-default:2) port 80 namevhost micros.themonastery.org (/etc/apache2/sites-enabled/000-default:2) port 80 namevhost www.ulc.org (/etc/apache2/sites-enabled/000-default:26) Syntax OK –  ehime Oct 3 '11 at 16:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.