I want to host multiple domains in a single server. So, i follow every steps from this article. i change every files ownership to www-data:www-data and change every files permission to 0777

everytime i try to access http://mydomain.com/index.html, it turns out to be "ERROR 403 Forbidden", and when i look into error.log, it says "client denied by server configuration:"

  • Can you provide the server configuration that you've set up per that article? Also, can you show us the output of apache2ctl -S? – Shane Madden Aug 1 '12 at 5:27
  • here's the output from apache2ctl -S paste.debian.net/181415 – Dwi Ash Aug 1 '12 at 5:41
  • and here's my virtualhost configuration paste.debian.net/181417 – Dwi Ash Aug 1 '12 at 5:43
  • mode 777 is a horrible, horrible idea by the way. it's a basic tenet of security that www-data should not be able to write to anything in its doc root unless absolutely necessary – Keith Aug 1 '12 at 20:32
  • @Keith yes, i absolutely know that, i did that in order to make sure everyone can access it, but even though i chmod-ed it to 777 it still not working – Dwi Ash Aug 2 '12 at 2:26

From your configuration, you have:

DocumentRoot /var/www/XXXXXX.com

But, access to a directory can't be assumed. You should be granting access to it in order to serve resources from it.

Add a config like this within that same <VirtualHost> block:

<Directory /var/www/XXXXXX.com>
    Order Allow,Deny
    Allow from all
  • it's still not working :( – Dwi Ash Aug 1 '12 at 7:57
  • check to make sure that the permissions on /var/www itself are correct (e.g., 755 perhaps) – Keith Aug 1 '12 at 20:34
  • @DXX Did you restart the Apache service after making the configuration change? Is it still the same "denied by server config" message in the log? – Shane Madden Aug 1 '12 at 21:31
  • You may also want to change the ownership to www-data on the directory which <Directory> is pointing to. – aseq Aug 1 '12 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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