Search code examples
apacheapache2lamp

Why is /etc/apache2/sites-enabled/default returning blank?


I just installed a LAMP stack and when I ran sudo nano /etc/apache2/sites-enabled/default, it was empty, like whatever file it opened doesn't exist. Never had this problem on my last LAMP install. What's going on?


Solution

  • The files in Apache's sites-enabled directory are ordered, which means that the filenames start with a number. The default site is usually named 000-default or similar, not just default. Take a look in the directory to see what's there with ls, then edit that file with nano.

    > ls -l /etc/apache2/sites-enabled
    
        lrwxrwxrwx 1 root root 26 Nov 14  2013 000-default -> ../sites-available/default
    
    > sudo nano /etc/apache2/sites-enabled/000-default