First, this really belongs on Server Fault. That said, you ask this:
How can I white-list other directories and tell apache to serve files from the location specified?
There is no such thing as a “white list” for Apache. It can serve content from anywhere on your system. Even if you have a set DocumentRoot
you can always use an Alias
. Apache is flexible.
So what you seem to be facing is a configuration issue. Nothing more. Nothing less. Just find the config files & adjust as needed & all should be good.
Meaning, what do you see when you run this command listing sites-available
:
ls -la /etc/apache2/sites-available
Versus this command with sites-enabled
:
ls -la /etc/apache2/sites-enabled
The contents of sites-available
are the real configuration files. The items in sites-enabled
are just symbolic links to the files in sites-available
. So when you say this:
The default is now 000-default.conf.
You might be mixed up. Since 000-default.conf
in sites-enabled
is just a symbolic link to default
in sites-available
that Apache actually reads configurations from. For example, the contents of sites-available
on an Ubuntu 12.04 server I am on are:
ls -la /etc/apache2/sites-available
-rw-r--r-- 1 root root 913 Apr 15 16:15 default
-rw-r--r-- 1 root root 7469 Feb 14 2012 default-ssl
Then in sites-enabled
it is:
ls -la /etc/apache2/sites-enabled
lrwxrwxrwx 1 root root 26 Jan 11 2013 000-default -> ../sites-available/default
Note how 000-default
is just a symbolic link to ../sites-available/default
which is basically /etc/apache2/sites-available/default
.
Past that you need to provide more details or look into where your configs are. And you might even try running this command to see what virtual hosts your active Apache server is currently managing:
sudo apachectl -S
EDIT: Seems like the original poster does not have 000-default
in sites-enabled
. So that can be fixed with a new symbolic link like this:
sudo ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
Then restart Apache with a sudo service apache2 restart
and try again. Hopefully this was the issue. And note that the reason default
gets renamed 000-default
when it’s in sites-enabled
as a symbolic link is to make sure that is the very first config that is loaded.