apache2 - Default Page still accessible after a2dissite 000-default.conf - Ask Ubuntu
i have brand-new installation of ubuntu 16.04 lts server (32bit) enabled lamp packages. means out of box, serves typical apache2 ubuntu default page on port 80, located under /var/www/html/index.html.
one of first things did try , disable page, using venerable
sudo a2dissite 000-default.conf command, prompted me do
service apache2 reload which called sudo.
to surprise, after that, site still accessible: re-loading , shift-reloading in firefox still shows page , can see requests in /var/log/apache2/other_vhosts_access.log.
running a2dissite command again shows site 000-default disabled , directory /etc/apache2/sites-enabled/ empty.
what doing wrong?
edit:
as suggestions julius Š., tried
sudo service apache2 restart with same result , checked /etc/apache2/apache2.conf file, shows <virtualhost> in comments.
regarding <directory> entries, these defaults in file:
<directory /> options followsymlinks allowoverride none require denied </directory> <directory /usr/share> allowoverride none require granted </directory> <directory /var/www/> options indexes followsymlinks allowoverride none require granted </directory> #<directory /srv/> # options indexes followsymlinks # allowoverride none # require granted #</directory> could plugins searching in /var/www/ subfolders suitable html files?
edit 2:
i rebooted machine, site still accessible.
only stopping service makes become inaccessible. since plan run other sites on it, need have running, curious what's going on.
edit 3:
as found in this answer on so, virtualhost settings config file can displayed follows:
. /etc/apache2/envvars apache2 -s ...which in case, outputs following:
ah00558: apache2: not reliably determine server's qualified domain name, using 127.0.1.1. set 'servername' directive globally suppress 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 bit suspicious documentroot entry pointing /var/www/html, did
find |xargs grep documentroot 2>/dev/null within /etc/apache2 folder, led following:
./sites-available/default-ssl.conf: documentroot /var/www/html ./sites-available/000-default.conf: documentroot /var/www/html ...so nothing in of *-enabled/ subfolders containing string. wonder apache gets documentroot when nothing seems enabled.
documentroot has a default value that's used if not set. mean apache serve out of directory if documentroot not set anywhere in configuration.
for upstream apache source, /usr/local/apache/htdocs, the ubuntu packaging overrides that --enable-layout=debian. presumably why continues serve /var/www/html documentroot. if want stop loading page, make inaccessible www-data user changing permissions, or set documentroot other directory.
Comments
Post a Comment