Linux – Virtual host error with Apache internal server error

apache-http-serverdnslinuxvirtual-hostwebserver

I rented this server recently and I'm trying to set it up as a webserver. Apache is working and I tested phpmyadmin and a test.php file using the ip address directly on the web browser gives a message like "it works!".

Then I entered this configuration in my server's /etc/apache2/apache2.conf

<VirtualHost *:80>
    DocumentRoot /home/myusername/blogsite
    ServerName blog.mydomain.com
    <Directory "/home/myusername/blogsite">
        Require all granted
    </Directory>
</VirtualHost>

And restarted apache (which started with no warnings, meaning that directory is correct).

And I set the DNS of that domain to my server's IP address, and now I'm getting this error message when I load my subdomain website (error links are modified for anonymity)

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@url.to.serverFromProvider.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache Server at blog.mydomain.com Port 80

I'm pretty new at setting webservers, and I don't know what to do. Please advise.

If you require any more information please let me know.

Best Answer

In your apache2.conf:

  1. Make sure that you have uncommented NameVirtualHost *:80.
  2. Set LogLevel debug so that errors are logged.
  3. Check where your error log is stored in the ErrorLog attribute.

Then check your error log which should contain the reason for the server error.

Also, do you have a reason for the following line in the <Directory> tag or did you just copy it from somewhere? Otherwise you could just remove the whole <Directory> tag.

Require all granted
Related Question