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.

I have migrated from Raring to Saucy on my web server, and with it, upgraded Apache from 2.2.x to 2.4.x.

Apache now seems not to be aware of the sites-enabled directory or its content. Every host is served up with the 000-default.conf. An example of a VirtualHost is 006-cjshayward:

<VirtualHost *:80>
    ServerName cjshayward.com
    ServerAdmin CJSHayward@PObox.com

    DocumentRoot /home/jonathan/cjshayward/public_html
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options ExecCGI Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/author.cjshayward.error.log

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

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

<VirtualHost *:80>
    ServerName www.cjshayward.com
    ServerAlias author.cjshayward.com cjsh.name www.cjsh.name cjsh.info www.cjsh.info
    RewriteEngine on
    RewriteRule ^(.*)$ http://cjshayward.com$1 [R=301,L]
</VirtualHost>

What else do I need to do to register as having a VirtualHost with its own parent directory?

share|improve this question
    
Is the Include line for sites-enabled still present in apache2.conf? That's what's responsible for loading the contents of those files. –  Shane Madden Oct 24 '13 at 17:26
1  
Always post the result of httpd -S (or, for Debuntu systems, apache2ctl -S) when discussing vhost problems. –  adaptr Oct 24 '13 at 17:50

2 Answers 2

up vote 2 down vote accepted

Apache 2.2's apache2.conf had this directive: Include sites-enabled/*

Apache 2.4's apache2.conf has switched to using this directive: IncludeOptional sites-enabled/*.conf

Most likely the files in your sites-enabled directory do not end in .conf

share|improve this answer

As Shane mentions you need to make sure httpd.conf is including files from your sites-enabled folder.

Further, most Debian based distributions will include all files in the sites-enabled folder, while, last I checked the Redhat "equivalent" will only include files with a .conf extension.

Either way, this needs to be present in your httpd.conf:

Include /etc/apache2/sites-enabled/*
share|improve this answer

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.