View Full Version : Error 403 on localhost

09-30-2011, 08:38 PM
I'm new to LINUX and Apache. I have an index.php file included in the htdocs folder in the www folder in the root.

I'm at a loss. I've googled the problem and keep seeing that I need to make these changes, but I'm not sure where to make them.

<Directory "/home/domain/www">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all


09-30-2011, 09:16 PM
Check your error_log and post the exact error you are getting. I suspect your path is wrong since you mention htdocs being in www, but that is not in your Directory directive path.

10-05-2011, 08:55 PM
It might not recognize PHP as an index file by default. Apache2 is set by default to serve from /var/www by default in Ubuntu. If that is what you are running, I bet it would recognize an html file. The It Works! default index file for instance. You could try adding lines like the ones below to your httpd.conf configuration. The dir_module should tell apache which files to recognize as indexes. Make sure the module is loaded though.

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source

<IfModule dir_module>
DirectoryIndex index.php index.html