【发布时间】:2021-02-26 20:25:13
【问题描述】:
我在 MacOS Big Sur 下有一台装有 MAMP 的 Mac(当我有 Catalina 时,问题也存在)
我想创建一个虚拟主机
这是我所做的:
- 在 Application/MAMP/conf/apache/httpd.conf 中,我取消了该行的注释
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf - 在我添加的 /private/etc/hosts 中
127.0.0.1 test.deva
127.0.0.1 test.localhost
- 这是我的 Application/MAMP/conf/apache/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 *
#
# 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 *:8888>
DocumentRoot /Aplications/MAMP/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:8888>
DocumentRoot "/Applications/MAMP/htdocs/testhost"
ServerName test.deva
ServerAlias www.test.deva
</VirtualHost>
在我检查的MAMP的参数中,我有8888端口
在 htdocs/testhost 我只有一个 index.html 文件
我尝试了很多我在这里看到的问题相同的帖子 但是我仍然有一个 ERR_CONNECTION_REFUSED 错误
请问怎么做?
【问题讨论】:
标签: apache mamp virtualhost