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

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, [email protected] 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.

1 Answer 1


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
  • I removed the directory tag, and the website works, thank you. But it apparently downloads php files rather than executing them. I found somewhere that it has something to do with NameVirtualHost *:80 that you wrote. But I didn't find that in my apache2.conf. Could you please explain further where to find that to uncomment it? Jan 19, 2014 at 11:39
  • NameVirtualHost is giving me a warning: ... waiting [Sun Jan 19 13:18:21 2014] [warn] NameVirtualHost *:80 has no VirtualHosts Jan 19, 2014 at 12:19
  • If Apache downloads php files instead of running them it is because it doesn't understand the php file type. Usually because php is not installed or improperly configured: stackoverflow.com/questions/18422140/…. Jan 19, 2014 at 14:24
  • Regarding the NameVirtualHost warning, do you have the NameVirtualHost *:80 setting before your <VirtualHost *:80> configuration? Jan 19, 2014 at 14:37
  • Also, please mark my answer as correct if you think that it answered your question. Jan 19, 2014 at 14:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .