簡體   English   中英

Wampserver無法使命名虛擬主機正常工作

[英]Wampserver can't get Named Virtual hosts to work

使用wampserver,我無法使命名的虛擬主機正常工作。 我已經編輯了httpd.conf以使用

Include conf/extra/httpd-vhosts.conf

我已經將該域添加到了system32 / driver / etc / hosts文件中。 我已經編輯了httpd-vhosts.conf文件,並且一切似乎都可以正常工作,除了現在本地主機不可用。 我設置的域(test123.com)正常,按127.0.0.1正常,但按localhost掛起。 錯誤日志中沒有任何相關內容,訪問日志中也沒有提及。 這是我編輯httpd-vhosts.conf的方法:

#
# Virtual Hosts
#

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost *:80>
    ServerName localhost 
    DocumentRoot "C:/wamp/www"
    <Directory "C:/wamp/www">
        Options FollowSymLinks 
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    DirectoryIndex index.php 
</VirtualHost>

<VirtualHost *:80>
    ServerName test123.com
    ServerAlias *.test123
    # Folder where the files live
    DocumentRoot "D:/Projects/html/test123"
    # A few helpful settings...
    <Directory "D:/Projects/html/test123">
        Options FollowSymLinks 
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    DirectoryIndex index.php
</VirtualHost>

我究竟做錯了什么?

終於想通了。 在httpd.conf中,我必須進行更改

Listen 80

Listen *:80

暫無
暫無

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

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