mac xampp安装完成之后配置虚拟主机


1、应用(application)/xampp/etc/httpd.conf
去除  # Virtual hosts下面的
Include etc/extra/httpd-vhosts.conf前面的#号

# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
     AllowOverride none
     Require all denied
</Directory>
模块中的
AllowOverride none
Require all denied


替换为
Order allow,deny
  Allow from all

User daemon
group daemon
替换为
user your computer name  group your user’s group


2、应用(application)/xampp/etc/extra/httpd-vhosts.conf
最下方加入
#TODO $file=your file; $url=your url
<VirtualHost *:80>
    DocumentRoot "$file"
    ServerName $url
    <Directory "$file">
        Options Indexes FollowSymLinks#展示目录层级
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>
</VirtualHost>


3、更改hosts文件
打开终端
sudo vim /etc/hosts
在文件后面写入
127.0.0.1  $url
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值