0
votes

I created a project in zendframework:

zf create project dev.gamenomad.com

Then, I put this:

    <VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot "C:/apache/docs/dev.gamenomad.com/public"
  ServerName dev.gamenomad.com
  ServerAlias dev.gamenomad.com
ErrorLog "logs/dev.gamenomad.com-error.log"
  CustomLog "logs/dev.gamenomad.com-access.log" common
</VirtualHost>

and I put this: 127.0.0.1 dev.gamenomad.com in C:\WINDOWS\system32\drivers\etc

Then, restarted apached..

I get this message when putting this url:

http://dev.gamenomad.com/

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster. Error 403 dev.gamenomad.com 12/11/2011 8:12:29 PM Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1

Why do I get that error?

2

2 Answers

1
votes

You get this error because directory listing isn't enabled and there's no default document found.

Add the following code to the VirtualHost to show a list of files in the directory

Options +Indexes

Or alternatively create a file called index.html (or any other supported extension which you've installed) and put some content into the file

You may also wish to consider adding the following to the VirtualHost in order to allow access to that directory

<Directory "c:\{path_to_directory}">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Edit in response to the OP's comment

You already have the following VirtualHost configuration.

ServerAdmin [email protected] DocumentRoot "C:/apache/docs/dev.gamenomad.com/public" ServerName dev.gamenomad.com ServerAlias dev.gamenomad.com ErrorLog "logs/dev.gamenomad.com-error.log" CustomLog "logs/dev.gamenomad.com-access.log" common

Changing your configuration to add the Options and Allow settings you'll be able to run your website on localhost but it'll fix your error.

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/apache/docs/dev.gamenomad.com/public"
    ServerName dev.gamenomad.com
    ServerAlias dev.gamenomad.com
    ErrorLog "logs/dev.gamenomad.com-error.log"
    CustomLog "logs/dev.gamenomad.com-access.log" common
    Options +Indexes

    <Directory "c:\{path_to_directory}">
        Options None
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
0
votes

Refer to Apache's Allow and Options directives.