Apache Configuration file 000-default.conf not working
https://askubuntu.com/questions/861021/apache-configuration-file-000-default-conf-not-working
So I'm trying to change the DocumentRoot of my apache, but for some strange reason it just seems to ignore the file /etc/apache2/sites-available/00-default.conf
This is the content of the file:
Use
userdir
see askubuntu.com/questions/388611/… and joao.machado-family.com/2013/06/04/… – Panther Dec 15 '16 at 19:23
3 Answers
Apache ignores sites-available
until you enable the site (in which case it symlinks it in sites-enabled
).
Run the following commands:
$#sudo a2ensite 000-default Site 000-default already enabled seems like it is already enabled. Didn't work – David Dec 15 '16 at 19:08
@David If it says that then run the restart command. If it's still not working, then disable the site, enable the site, and restart Apache. – Thomas Ward♦ Dec 15 '16 at 19:10
Still did not work. All commands execute just fine, but it doesn't seem to have any effect – David Dec 15 '16 at 19:15
1Use joao.machado-family.com/2013/06/04/… – Panther Dec 15 '16 at 19:23
Try removing.
Example:
None of the above solutions worked for me. No matter what I tried I could not get the default site to load including copying the config from my 14.04 VPS where it is working 100% (I am upgrading to 18.04).
In the end adding a VirtualHost for the local server name to my apache2.conf forcing it to be the first VirtualHost defined worked. Not my preferred solution but worked:
<VirtualHost webserver.mydomain.za:80> ServerAdmin webmaster@mydomain.za ServerName webserver.mydomain.za DocumentRoot /var/www/nowebsite ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Strangely enough, the Default SSL site worked first time.
Last updated