I have a brand-new installation of Ubuntu 16.04 LTS Server (32bit) with enabled LAMP packages. Which means out of the box, it serves the typical Apache2 Ubuntu Default Page on port 80, located under
One of the first things I did was to try and disable that page, using the venerable
sudo a2dissite 000-default.conf
command, which prompted me to do
service apache2 reload
which I also called with
To my surprise, after that, the site is still accessible: Re-loading and shift-reloading in Firefox still shows the page and I can see the requests in
a2dissite command again shows
Site 000-default already disabled and the directory
/etc/apache2/sites-enabled/ is empty.
What am I doing wrong?
As for the suggestions by Julius Š., I also tried
sudo service apache2 restart
with the same result and checked my
/etc/apache2/apache2.conf file, which shows
<VirtualHost> only in some comments.
<Directory> entries, these are just the defaults in the file:
<Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> #<Directory /srv/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #</Directory>
Could it be some plugins searching in
/var/www/ subfolders for suitable html files?
rebooted the machine, the site is still accessible.
Only stopping the service makes it become inaccessible. Since I plan to run other sites on it, I will eventually need to have it running, so I am really curious what's going on.
As I found in this answer on SO, the virtualhost settings from the config file can be displayed as follows:
. /etc/apache2/envvars apache2 -S
...which in my case, outputs the following:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message VirtualHost configuration: ServerRoot: "/etc/apache2" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/var/log/apache2/error.log" Mutex mpm-accept: using_defaults Mutex watchdog-callback: using_defaults Mutex default: dir="/var/lock/apache2" mechanism=fcntl PidFile: "/var/run/apache2/apache2.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="www-data" id=33 not_used Group: name="www-data" id=33 not_used
I got a bit suspicious about the
DocumentRoot entry pointing to
/var/www/html, so I did a
find |xargs grep DocumentRoot 2>/dev/null
/etc/apache2 folder, which led to the following:
./sites-available/default-ssl.conf: DocumentRoot /var/www/html ./sites-available/000-default.conf: DocumentRoot /var/www/html
...so nothing in any of the
*-enabled/ subfolders containing that string. I really wonder where Apache gets the
DocumentRoot from when nothing seems to be enabled.