What is /etc/apache2/sites-available used for and is it necessary?
- by Mariane
I have 3 sites, each with a specific IP, running on apache2 (up-to-date Ubuntu).
To put a site online, I just created a file in:
/etc/apache2/sites-enabled
and in this file I told apache which directory was the root directory for this site, and to which IP it should correspond.
So I have 000-default 001-www.lapf.eu 002-www.felkin.info 003-www.seidhr.fr in this directory.
My first site, lapf suddenly lost contact with its database after the domain name was transferred from another registrar unto the registrar who is also hosting the site's data.
Then I did an update, and I reinstalled mysql-server and mysql-common, and I did I-have-forgotten-what to reinstall the locales (uft8 and such) which had vanished for some reason.
This fixed my first site.
Now I noticed that the other 2 sites are offline. Pointing a browser to them just hangs until timeout. They used to function, and their domain names did not move, they are still registered at the same place.
The files are still in /etc/apache2/sites-enabled
I noticed another directory:
/etc/apache2/sites-available
with just defaut and default.ssl in it.
Why are there 2 directories, sites-enabled and sites-available? Should I copy the files from "sites-enabled" into "sites-available"? Or should I put a modified version of each in "sites-available"?
command: "apache2ctl -S"
VirtualHost configuration:
92.243.20.169:80 Charlotte (/etc/apache2/sites-enabled/001-www.lapf.eu:1)
92.243.21.141:80 xvm-21-141.ghst.net (/etc/apache2/sites-enabled/002-www.felkin.info:1)
92.243.4.114:80 xvm-4-114.ghst.net (/etc/apache2/sites-enabled/003-www.seidhr.fr:1)
wildcard NameVirtualHosts and default servers:
*:80 is a NameVirtualHost
default server Charlotte (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost Charlotte (/etc/apache2/sites-enabled/000-default:1)
Syntax OK