【问题标题】:How to add public virtual host in Apache 2.4 with WAMP如何使用 WAMP 在 Apache 2.4 中添加公共虚拟主机
【发布时间】:2016-12-06 17:48:56
【问题描述】:

我有一个 Apache 服务器,它处理端口 8080 上的两个虚拟主机,一个是私有的(本地主机),另一个是公共的(互联网)。私有虚拟主机工作正常,但公众不断将所有公共请求重定向到本地主机,我不确定我做错了什么。请帮忙!以下是httpd-vhost.conf 文件:

# Virtual Hosts

<VirtualHost *:8080>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory  "c:/wamp64/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
</Directory>
</VirtualHost>

<VirtualHost *:8080>
ServerName mydomain.com
DocumentRoot c:/wamp64/www/App
<Directory  "c:/wamp64/www/App/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
#

此外,这是在 Windows Server 2012 上运行 WAMP / Magento 并托管在 Azure 中。非常感谢!

【问题讨论】:

    标签: php apache virtualhost wampserver


    【解决方案1】:

    请在虚拟主机设置中找到 cmets。

    #
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    # The first VirtualHost section is used for all requests that do not
    # match a ServerName or ServerAlias in any <VirtualHost> block.
    #
    

    Refer this

    【讨论】:

      【解决方案2】:

      我发现虚拟主机配置正确,重定向问题出在 MySQL Magento Db 中,它指向了localhost:8080。我将web/unsecure/base_urlweb/secure/base_url 下的core_config_data 更改为我的公共域,它运行良好。我发布了这个答案,以防其他人在这里遇到类似的问题。谢谢

      【讨论】:

        猜你喜欢
        • 2019-11-03
        • 2017-07-05
        • 2015-10-13
        • 2014-11-10
        • 1970-01-01
        • 2014-01-27
        • 1970-01-01
        • 2012-07-08
        • 2016-10-29
        相关资源
        最近更新 更多