13

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?

EDIT:

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

2 Answers2

16

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.

drc
  • 2,880
  • Thanks. BTW, I did't find <Directory /var/www/> in this file. Does that mean I don't need to change the Directory directive? – user159 Dec 05 '13 at 10:07
  • I think some of the defaults must've changed because now the file seems to not include as much stuff. My guess is that you can add in your customizations as usual in 000-default.conf, just make sure you nest it properly, see line "DocumentRoot /var/www" which should be somewhere near line 12 in the default (stock/unmodified) one. – osirisgothra Feb 08 '14 at 09:06
8

/etc/apache2/sites-available/000-default.conf is the configuration file for the default site, only. You can add as many sites as you want, with their config files located in this same directory.

The apache global configuration file you're looking for is located in:

/etc/apache2/apache2.conf

As @drc mentioned, a lot of things changed in recent versions of Ubuntu.

wassimans
  • 339