簡體   English   中英

如何使用WAMP在Apache 2.4中添加公共虛擬主機

[英]How to add public virtual host in Apache 2.4 with WAMP

我有一個Apache服務器,該服務器可以在端口8080上處理兩個虛擬主機,一個是私有(localhost),第二個是公共(internet)。 私有虛擬主機工作正常,但是公共不斷將所有公共請求重定向到本地主機,我不確定自己在做什么錯。 請幫忙! 以下是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中。 非常感謝!

請找到有關虛擬主機設置的注釋。

#
# 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.
#

推薦這個

我發現虛擬主機配置正確,重定向問題出在MySQL Magento Db中,它指向localhost:8080 我將web/unsecure/base_urlweb/secure/base_url下的core_config_data更改為我的公共域,並且工作正常。 我張貼了這個答案,以防其他人遇到類似問題。 謝謝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM