403 Forbiden on Apache (CentOS) Server

Posted by pouya on Super User See other posts from Super User or by pouya
Published on 2012-09-15T22:51:47Z Indexed on 2012/09/16 3:42 UTC
Read the original article Hit count: 220

Filed under:
|
|
|

These are my VM setup:

HOST: windows 7 ultimate 32bit
GUEST: CentOs 6.3 i386
Virtualization soft: Oracle virtualBox 4.1.22
Networking: NAT -> (PORT FORWARD: HOST:8080 => GUEST:80)
Shared Folder: centos

all the project files goes into shared folder and for each project file a virtualhost conf file is created in /etc/httpd/conf.d/ like /etc/httpd/conf.d/$domain

I wasn't able to see anything in my browser before disabling both windows firewall and iptables in centos after that if i type for example: http://www.$domain:8080/ all i see is:

Forbidden

You don't have permission to access / on this server.
Apache/2.2.15 (CentOS) Server at www.$domain.com Port 8080

A sample Virtual Host conf file:

<VirtualHost *:80>
    #General
    DocumentRoot /media/sf_centos/path/to/public_html
    ServerAdmin webmaster@$domain
    ServerName www.$domain
    ServerAlias $domain *.$domain

    #Logging
    ErrorLog /var/log/httpd/$domain-error.log
    CustomLog /var/log/httpd/$domain-access.log combined

    #mod rewrite
    RewriteEngine On
    RewriteLog /var/log/httpd/$domain-rewrite.log
    RewriteLogLevel 0
</VirtualHost>

centos shared folder is availabe to guest at /media/sf_centos These are file permissons for sf_centos:

drwxrwx--- root vboxsf

vboxsf group includes: apache and root

So these are my questions:

1- How to solve Forbidden Problem?

2- How to setup both host and guest firewalls?

3- How can i improve this developement environment to simulate production environment as much as possible specially security improvements?

© Super User or respective owner

Related posts about windows-7

Related posts about virtualbox