如何使用 WAMP 在 Apache 2.4 中添加 public 虚拟主机
How to add public virtual host in Apache 2.4 with WAMP
I have an Apache server that handles two virtual host on port 8080, one is private (localhost) and a second one is public (internet). The private virtual host works fine but the public keeps redirecting all public requests to the localhost and I'm not sure what I'm doing wrong. Please help! Below is the httpd-vhost.conf
file:
# 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>
#
Also, this is running WAMP / Magento on Windows Server 2012 and hosted in Azure. Thanks a lot!
虚拟主机设置请看评论
#
# 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.
#
我发现虚拟主机配置正确,re-directing 问题出在 MySQL Magento Db 中,它指向 localhost:8080
。我将 web/unsecure/base_url
和 web/secure/base_url
下的 core_config_data
更改为我的 public 域,它工作正常。我发布了这个答案,以防其他人遇到类似问题。谢谢
I have an Apache server that handles two virtual host on port 8080, one is private (localhost) and a second one is public (internet). The private virtual host works fine but the public keeps redirecting all public requests to the localhost and I'm not sure what I'm doing wrong. Please help! Below is the
httpd-vhost.conf
file:
# 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>
#
Also, this is running WAMP / Magento on Windows Server 2012 and hosted in Azure. Thanks a lot!
虚拟主机设置请看评论
#
# 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.
#
我发现虚拟主机配置正确,re-directing 问题出在 MySQL Magento Db 中,它指向 localhost:8080
。我将 web/unsecure/base_url
和 web/secure/base_url
下的 core_config_data
更改为我的 public 域,它工作正常。我发布了这个答案,以防其他人遇到类似问题。谢谢