Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Ubuntu, I'm trying to setup my PHP website locally in Apache2. I am able to get the "It works!" page to show when I navigate to localhost in the browser. I then copied the default site in the sites-available directory, edited it and updated the DocumentRoot and tag:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/mywebsite
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/mywebsite/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel debug

   CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

I then disable the default and enable my site:

sudo a2dissite default; sudo a2ensite mywebsite

After restarting the apache2 service, when I navigate to localhost I get the HTTP Error 500 message. When I view the log, there is nothing there:

[Thu Apr 25 10:39:29 2013] [notice] caught SIGTERM, shutting down
[Thu Apr 25 10:39:30 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.9-4ubuntu2 configured     
-- resuming normal operations
[Thu Apr 25 10:39:39 2013] [notice] caught SIGTERM, shutting down
[Thu Apr 25 10:39:40 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.9-4ubuntu2 configured    
-- resuming normal operations

I thought maybe it was PHP, so I created a test.php file at /var/www that had phpinfo(); and after disabling mywebsite and enabling default, it showed fine.

What am I missing here? Also, shouldn't the error.log contain information pertaining to the HTTP Error 500?

share|improve this question
    
What's the output of ls -l /etc/apache2/sites-available and ls -l /etc/apache2/sites-enabled after enabling mywebsite and disabling default? –  ernie Apr 25 '13 at 19:59
    
ls -l /etc/apache2/sites-available: -rw-r--r-- 1 root root 692 Jul 16 2012 default -rw-r--r-- 1 root root 7251 Jul 16 2012 default-ssl -rw-r--r-- 1 root root 713 Apr 25 10:37 mywebsite ls -l /etc/apache2/sites-enabled: lrwxrwxrwx 1 root root 24 Apr 25 10:39 mywebsite -> ../sites- available/mywebsite –  smoothgrips Apr 25 '13 at 21:33

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.