What is the difference between sites-enabled and sites-available directory?

Amit Mehta picture Amit Mehta · Feb 16, 2014 · Viewed 84.5k times · Source

What is use of these two directories in apache2 and how can we do it?

Answer

ABC picture ABC · Feb 16, 2014

The difference is that virtual sites listed in the sites-enabled directory are served by apache. In the sites-available directory there are the virtual sites that exist on your server but people can't access them because they are not enabled yet.

sites-available: this directory has configuration files for Apache2 Virtual Hosts. Virtual Hosts allow Apache2 to be configured for multiple sites that have separate configurations.

sites-enabled: like mods-enabled, sites-enabled contains symlinks to the /etc/apache2/sites-available directory. Similarly when a configuration file in sites-available is symlinked, the site configured by it will be active once Apache2 is restarted.

See here https://help.ubuntu.com/lts/serverguide/httpd.html