配置HOSTS

 

 #vim /private/etc/hosts

 

  添加↓:

 

   127.0.0.1       tp.zhy.cn

 

 配置虚拟主机

 #vim /private/etc/apache2/extra/httpd-vhosts.conf

 

 添加↓:

 <VirtualHost *:80>

    ServerAdmin xxx@qq.com

    DocumentRoot "/Users/zhy/Sites/xxxx_5/public/"

    ServerName tp.zhy.cn

    ErrorLog "/private/var/log/apache2/xx.cn-error_log"

    CustomLog "/private/var/log/apache2/xx.cn-access_log" common

 </VirtualHost>

 

 

最后重启 apache ↓

 

 

重启Mac上的Apache服务

 

停止服务:sudo /usr/sbin/apachectl stop

开启服务:sudo /usr/sbin/apachectl start

重启服务:sudo /usr/sbin/apachectl restart

 

停止服务:sudo /usr/sbin/apachectl stop

开启服务:sudo /usr/sbin/apachectl start

重启服务:sudo /usr/sbin/apachectl restart

相关文章:

  • 2022-01-01
  • 2021-06-06
  • 2022-01-09
  • 2021-05-17
  • 2022-12-23
  • 2021-10-06
  • 2021-12-15
猜你喜欢
  • 2021-10-15
  • 2022-01-11
  • 2021-11-08
  • 2021-10-07
  • 2021-10-22
  • 2022-12-23
相关资源
相似解决方案