Ubuntu – Cannot find /etc/apache2/sites-available/default when configuring Apache


I followed the instruction here to configure a PHP development environment. First:

sudo tasksel install lamp-server

It succeeded, and It works! is outputted in http://localhost/. Then:

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite

An error happened here:

cp: cannot stat ‘/etc/apache2/sites-available/default’: No such file or directory

I'm using Ubuntu 13.10. I searched the web but didn't get anything that looked promising. Can anyone point me in the right direction?


 $ ls /etc/apache2/sites-available
 000-default.conf  default-ssl.conf

Best Answer

  • The tutorial you are using is based on an older version of Ubuntu.

    13.10 ships a newer apache configuration, where the file you are looking for is named /etc/apache2/sites-available/000-default.conf.

    Note the .conf at the end, which is now required for apache to pick up on the files. So make sure the config you are creating for your site also has .conf as its extension.

  • Related Question