mac apache 多项目 配置

Apache的安装目录在:/etc/apache2/



sudo vi /etc/apache2/httpd.conf”,打开Apche的配置文件


在httpd.conf中找到“#Include /private/etc/apache2/extra/httpd-vhosts.conf”,去掉前面的“#”,保存并退出。


sudo vi /etc/apache2/extra/httpd-vhosts.conf


<VirtualHost *:80>

    ServerAdmin gk@qq.com

    DocumentRoot "/Library/WebServer/Documents"

    ServerName gaokaos

    RewriteEngine on

    RewriteRule ^/l-(.+?)\-(.+?)\-(.+?)\-(.+?)\.html$ /e/extend/daxue/index\.php\?sf=$1&ty=$2&ts=$3&page=$4&

    RewriteRule ^/d-(.+?)\.html$ /e/extend/daxue/details\.php\?sid=$1

    ErrorLog "/private/var/log/apache2/gk-error_log"

    CustomLog "/private/var/log/apache2/gk-access_log" common

</VirtualHost>



sudo vi /etc/apache2/extra/httpd-vhosts.conf


127.0.0.1  gaokaos


运行“sudo apachectl restart”,重启Apache后就开启了虚拟主机配置功能。

转载于:https://my.oschina.net/u/1029481/blog/548385

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值