0
votes

I have the following as my default virtual host in /etc/apache2/sites-available/default

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/customers/webs/speed
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/customers/webs/speed>
            Options 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}/error.log

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

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The idea is that it would read the index.html from /var/customers/webs/speed, however, it's still reading the default index.html in /var/www

I have restarted apache and even the server itself, but it just don't seem to want to update.

2

2 Answers

1
votes

You must edit /etc/apache2/sites-enabled/default to change default page

0
votes

If you access http://localhost Apache will load the index.html from Document Root defined in httpd.conf. If you would like to load Document Root of Virtual Host, try below -

<VirtualHost *:80>
 ServerName virtualhost.com
 ServerAdmin webmaster@localhost
 DocumentRoot /var/customers/webs/speed

   <Directory /var/customers/webs/speed>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted 
   </Directory>

</VirtualHost>

Go to your Host file and add a new entry 127.0.0.1 virtualhost.com

Apache should now understand which document root to load when you access http://localhost and http://virtualhost.com.

The above code would get you started and then you can add your customization accordingly .

Hope that help!