403禁止在Apache(CentOS)服务器上作为GUEST在Windows 7上运行

时间:2012-09-15 23:21:59

标签: windows-7 centos virtualbox

这些是我的虚拟机设置:

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

所有项目文件都进入共享文件夹,对于每个项目文件,在/etc/httpd/conf.d/中创建虚拟主机配置文件,如/etc/httpd/conf.d/$domain

我在浏览器中看不到任何内容,然后再禁用它中的windows防火墙和iptables,如果我输入例如:http://www.$domain:8080/我看到的只有:

Forbidden

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

示例虚拟主机配置文件:

<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的访客可以使用

/media/sf_centos共享文件夹 这些是sf_centos的文件许可:

drwxrwx--- root vboxsf

vboxsf群组包括:apacheroot

所以这些是我的问题:

1-如何解决禁忌问题?

2-如何设置主机和访客防火墙?

3-如何改善这种开发环境,尽可能地模拟生产环境,特别是安全性改进?

1 个答案:

答案 0 :(得分:0)

对于#1/2:由于VirtualBox使用的自动安装方法,这是一个权限问题。而不是自动安装,你必须手动安装它。

suomynona的帖子(第3回复)有一些解决此问题的分步说明: https://forums.virtualbox.org/viewtopic.php?f=3&t=38891#p179152

对于#3,标准做法是使登台服务器尽可能地模仿生产(相同的操作系统,相同的更新,版本等)。这将允许您在部署到生产之前从本地开发环境进行部署以进行集成测试。有时我们甚至会设置我们的开发虚拟机,以便在更复杂的项目中使用相同的操作系统,因为版本/兼容性问题可能会导致令人头疼的问题。

相关问题