Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I cloned a rackspace server which had some extra /var/www/ directories in it that I didn't want. I just wanted to delete websites that I don't need on this server. I thought that was as simple as removing the directories and all files inside each directory.

So I removed them all via command-line. I had to reboot the server. During the reboot, apache failed to start because:

DocumentRoot [/var/www/PATH/TO/DIRECTORY/] does not exist

In addition, I've got a [warn] NameVirtualHost *:80 has no VirtualHosts notice.

My server is running Ubuntu 11.10.

I just wanted to delete directories I wasn't using anymore. How do I clear this up?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

The recommended way to enable and disable Apache websites is using the a2ensite and a2dissite (short for Apache 2 Enable/Disable Site).

What these two tools do is basically adding/removing links to/from /etc/apache2/sites-enabled. Such links point to /etc/apache2/sites-available.

Because you have removed the files, I'd recommend not just disabling the sites (i.e. removing the links from sites-enabled), but also remove the site configurations all toghether (i.e. removing both the links from sites-enabled and the files from sites-available).

In short, you should:

  1. Find the sites of which you have removed the files: ls /etc/apache2/sites-enabled
  2. Disable such sites: rm /etc/apache2/sites-enabled/site1 /etc/apache2/sites-enabled/site2
  3. (Optional) totally remove the configuration files for such sites: rm /etc/apache2/sites-available/site1 /etc/apache2/sites-available/site2
share|improve this answer
1  
Yes this is what I did, however manually because I learned this the hard way. Thank you for your thorough answer. I'm sure I'll refer to this again in the future for clarification. –  Jared Eitnier Feb 20 '13 at 20:02

Hard to tell with what little configuration information you posted.

You need to check your Apache configuration files and virtual hosts. If you are no longer using /var/www/PATH/TO/DIRECTORY/ , disable the virtual host that is using that directory and/or update your apache configuration.

See:

https://help.ubuntu.com/community/ApacheMySQLPHP

https://help.ubuntu.com/12.04/serverguide/httpd.html

If that does not solve the problem, please update your question and provide additional configuration information.

share|improve this answer
    
Forgive my ignorance, but I don't know anything about VirtualHosts. I just wanted to delete websites that I don't need on this server. I thought that was as simple as removing the directories and all files inside each directory. I updated my question a bit. –  Jared Eitnier Feb 20 '13 at 19:23

I figured it out. I had to remove VirtualHosts pertaining to the files I deleted inside /etc/apache2/sites-available/default.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.