0

So im getting the error 'Forbidden You don't have permission to access / on this server.' when I go to ec2.guildwars2community.com using this config

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName ec2.guildwars2community.com
    DocumentRoot /opt/bitnami/apps/gw2c/htdocs
    Options Indexes MultiViews +FollowSymLinks
</VirtualHost>

However if I just use directory a based setup like below it works ok. If i go to http://107.20.230.123/gw2c/

Alias /gw2c/ "/opt/bitnami/apps/gw2c/htdocs/"
Alias /gw2c "/opt/bitnami/apps/gw2c/htdocs"

<Directory "/opt/bitnami/apps/gw2c/htdocs">
    Options Indexes MultiViews +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

2 Answers2

2

The error logs will tell you for sure, but my initial feeling would be that you're missing the necessary Allow directive to permit access to the document root. You don't make it clear if the <Directory> entry in your second configuration example is present when you're using the <VirtualHost>, and if so, where it is, but if it's missing or in the wrong place, then there won't be any permission to access the filesystem and hence you'll get the error you're seeing.

womble
  • 98,245
1

Add a <Directory> block same as the second configuration to the first and try again. E.g:

<VirtualHost *:80>
    ServerName ec2.guildwars2community.com
    DocumentRoot /opt/bitnami/apps/gw2c/htdocs
    ErrorLog ...

    <Directory "/opt/bitnami/apps/gw2c/htdocs">
        Options -Indexes MultiViews +FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

You should remove the AllowOverride All directive or specific only things that you want to allow.

quanta
  • 52,423