2015-11-26 149 views
1

首先,我想说的是,我已经阅读了类似问题出现的其他主题,但应用解决方案,没有人操作过我想要的内容。从另一台计算机访问虚拟主机

我在我的电脑里有1个IP:192.168.1.217配置了一个虚拟主机。

C:\ WAMP \ BIN \ apache的\ Apache2.4.4 \的conf \额外\的httpd-vhosts.conf:

<VirtualHost *: 80> 
    ServerAdmin [email protected] 
    DocumentRoot "c:/wamp/www/sfi" 
    <Directory "c:/wamp/www/sfi"> 
        Options Indexes FollowSymLinks 
        AllowOverride All 
        Allow from all 
    </Directory> 
    ServerName sfi 
    ErrorLog "logs/sfi-error.log" 
    CustomLog "logs/sfi-access.log" common 
</VirtualHost> 

而且我已经添加了以下行:

NameVirtualHost *: 80 

在文件C:\wamp\bin\apache\Apache2.4.4\conf\httpd.conf我已经修改下列行:

Include `conf/extra/httpd-vhosts.conf` (remove `#`) 

<Directory /> (Grant permissions) 
    AllowOverride none 
    AllowOverride All 
    Order deny, allow 
    Allow from all 
</Directory> 

<Directory "c:/wamp/www"> (Grant permissions) 
     Order Deny, Allow 
     Deny from all 
     Allow from all 
</Directory> 

最后,我加入C:\Windows\System32\drivers\etc\hosts

127.0.0.1 sfi 

虚拟主机在安装了wamp服务器的机器上完美工作。

在我要访问我的项目的机器,我设置为C:\Windows\System32\ drivers\etc\主机下面一行:

192.168.1.217 sfi 

而不是负载我的项目目录。

有什么我做错了吗?

谢谢。

+0

当您尝试访问服务器时发生了什么具体情况? error_log说什么? – covener

+0

不,我的虚拟主机在本地机器上运行良好。尽管在机器B上设置了我的/ etc/hosts文件,但只有我无法从另一台机器访问。 – urreta17

+0

对不起,我不明白。您的浏览器或命令行客户端在机器B上说什么?你的日志在机器A上说什么? – covener

回答

0

你只是有一个防火墙问题,完全在你的httpd配置之外。

+0

正如我可以检查这个? – urreta17

+0

耸耸肩。 Windows防火墙? – covener

+0

尝试通过其IP地址访问您的网站。如果你可以使用ip地址访问它,那么你可能会遇到其他问题 –

相关问题