【问题标题】:Wamp Virtual Host Set UpWamp 虚拟主机设置
【发布时间】:2013-03-15 13:17:13
【问题描述】:

很抱歉有一个与已发布的内容类似的问题,但其他人并没有帮助我。 我正在尝试在我的 Windows 8 计算机上设置一个虚拟主机,但无论我遵循什么教程或帮助部分,我似乎都无法让它工作,这是我到目前为止的设置。

httpd-vhosts.conf

# Virtual Hosts
#
# Required modules: mod_log_config

Listen 80

<VirtualHost *:80>
    ServerAdmin admin@localhost.com
    DocumentRoot "C:\Program Files (x86)\2. Apps\Wamp\www"
    ServerName localhost
    <Directory "C:/wamp/www">
                Options Indexes FollowSymLinks
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin admin@localhost.com
    DocumentRoot "C:\Users\Chris\Documents\Projects\testsite\Site"
    ServerName testingsite
    ServerAlias testingsite
    <directory "C:\Users\Chris\Documents\Projects\testsite\Site">
        Options Indexes FollowSymLinks
        Order Allow,Deny
        Allow from all
    </directory>
</VirtualHost>

主机

# Wamp Server Settings
127.0.0.1       localhost
127.0.0.1       testingsite

httpd.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

如果我尝试启动 wamp,图标变为橙色。 如果我从命令提示符运行 httpd.exe,我会收到以下错误:

C:\Program Files (x86)\2. Apps\Wamp\bin\apache\apache2.4.2\bin>httpd.exe
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted.  : AH00072: make_sock: could not bind to address [::]:80
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted.  : AH00072: make_sock: could not bind to address 0.0.0.0:
80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs

我读到另一个程序可能会阻止它或我的防火墙,但我不知道如何修复它,有什么想法吗?

谢谢

【问题讨论】:

  • 尝试将Listen 80 从您的 vhosts.conf 中删除。我的是NameVirtualHost *:80
  • 我以为我已经尝试过了,但它没有用,但它现在已经修复它......谢谢。我从 apache 帮助文档中获得了 listen 80 到
  • @SarahKemp 最后一个 - 你知道为什么我会得到一个 403 禁止页面吗?
  • 在您展示的配置中没有什么突出的。这个主题有一些你可以尝试的事情:stackoverflow.com/questions/8204902/wamp-403-forbidden-message 确保你记得在更改 conf 文件时重新启动 Apache。

标签: wamp virtual-hosts


【解决方案1】:

感谢大家的意见,主要有两个问题

我将 wamp 安装到一个文件夹中,该文件夹嵌套在一个文件夹中,该文件夹的名称在 c:/folder/folder with a space/wamp/ 中有一个空格,后来我被告知这是不好的做法,如果有人知道为什么请告诉。

互联网协议存在问题,即ipv6,因此解决此问题需要确保 wamp 仅使用 ipv4,在 httpd.conf 中找到 Listen 80 并更改为 Listen 0.0.0.0:80。同样,我不确定这是做什么的,如果有人知道,请在下面发布。

我希望这可以帮助其他陷入困境的人。

【讨论】:

    猜你喜欢
    • 2014-07-15
    • 2014-09-20
    • 2015-01-25
    • 1970-01-01
    • 2016-01-23
    • 1970-01-01
    • 2011-09-30
    • 2013-04-13
    • 1970-01-01
    相关资源
    最近更新 更多