MAMP虚拟主机返回'它工作!'页面

时间:2017-07-06 01:36:16

标签: localhost mamp virtualhost virtual-hosts

我有点想到这一点。今晚早些时候,一旦我试图重新启动它,我的MAMP就停止了工作。所以我决定卸载并重新安装MAMP,看看是否有帮助。然而,它引起了以前从未发生的其他事情。

如果我在地址栏中输入localhost,它会返回'它有效!'。我像以前一样创建了一个虚拟主机,就像我以前一样一步一步地创建了一个虚拟主机,然而,它也让它变得可怕!它的工作原理!'页。我已经按照教程,没有其他人似乎有这个问题。我不知道我在这里做错了什么。任何建议都会受到大力赞赏。

以下是我改变的文件

的主机

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1       portfolio

的httpd.conf

取消注释以下行

# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

的httpd-vhosts.conf

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

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

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

<VirtualHost *:80>
    DocumentRoot "/Applications/MAMP/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/Applications/MAMP/Library/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/Applications/MAMP/Library/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/Applications/MAMP/htdocs/portfolio"
    ServerName portfolio
</VirtualHost>

我在这里做错了什么?

转到http://localhost:8888/&amp; http://localhost:8888/portfolio按预期工作,但localhost&amp; portfolio/没有。

0 个答案:

没有答案