What is use of these two directories in Apache?2 and how can we do it?
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-enabled
sites-available
sites-available: this directory has configuration files for Apache?2 Virtual Hosts. Virtual Hosts allow Apache?2 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.
sites-available: this directory has configuration files for Apache?2 Virtual Hosts. Virtual Hosts allow Apache?2 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 https://help.ubuntu.com/lts/serverguide/httpd.html.
2.1m questions
2.1m answers
60 comments
57.0k users