-1

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 and 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

2 Answers 2

6

Google is your friend;

/etc/apache2/sites-available This contains configuration files for sites which are available but not necessarily enabled.

/etc/apache2/sites-enabled This directory contains site files which are enabled.

From here -> http://www.debian-administration.org/articles/412

Basically, you want to setup your vhost files (.conf files) in sites-available and then create a symbolic link in sites-enabled for each one. This way, you only update the configs in sites-available.

**See the first comment below, this is preferable to manually creating the symlink.

3
  • 5
    You don't typically create the symlink by hand. On Debian, the a2ensite command will manage the enabled sites for you.
    – jscott
    Nov 8, 2013 at 11:18
  • Really didn't know that, thanks :) (up vote for you)
    – sgtbeano
    Nov 8, 2013 at 11:19
  • 1
    @sgtbeano you can use a2dissite command to remove symbolic link too :-)
    – ZVIK
    Nov 8, 2013 at 12:07
-1

/etc/apache2/sites-available contains configuration files for your sites. /etc/apache2/sites-enabled contains simlinks to enabled sites. Move your site config files to /etc/apache2/sites-available Then, do : ln -s /etc/apache2/sites-available/sitename /etc/apache2/sites-enabled/sitename do this for all sites you wish to enable. Then, run : service apache2 restart

1
  • Welcome on serverfault, you can increase the quality of your post by editing it. You can for example type "man a2ensite" and modify your answer accordingly. You can also improve formatting by adding line feeds.
    – user130370
    Dec 9, 2013 at 16:40

Not the answer you're looking for? Browse other questions tagged .