zoukankan      html  css  js  c++  java
  • OS X 配置 Apache

    1.去掉javascript:void(0);Include /private/etc/apache2/extra/httpd-vhosts.con的注释,以启用虚拟主机;

    2.在<Directory "/Library/WebServer/CGI-Executables">...</Directory>后做如下配置:

     1 < Directory "/Library/WebServer/CGI-Executables" >
     2   AllowOverride None
     3   Options None
     4   Require all granted
     5 </Directory>
     6 < Directory "/Users/Shared/cFrost.net" >
     7   Options FollowSymLinks Multiviews
     8   MultiviewsMatch Any
     9   AllowOverride None
    10   Require all granted
    11 </Directory>

    3.在/etc/apache2/extra/httpd-vhosts.conf注释掉如下部分:

    <VirtualHost *:80>
      ServerAdmin webmaster@dummy-host.example.com
      DocumentRoot "/usr/docs/dummy-host.example.com"
      ServerName dummy-host.example.com
      ServerAlias www.dummy-host.example.com
      ErrorLog "/private/var/log/apache2/dummy-host.example.com-    error_log"
      CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
    </VirtualHost>
    <VirtualHost *:80>
      ServerAdmin webmaster@dummy-host2.example.com
      DocumentRoot "/usr/docs/dummy-host2.example.com"
      ServerName dummy-host2.example.com
      ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
      CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
    </VirtualHost>

    4.然后增加如下配置:

    <VirtualHost *:80>
      DocumentRoot "/Library/WebServer/Documents"
      ServerName localhost
      ErrorLog "/private/var/log/apache2/localhost-error_log"
      CustomLog "/private/var/log/apache2/localhost-access_log" common
    </VirtualHost>
    <VirtualHost *:80>
      DocumentRoot "/Users/Shared/cFrost.net"
      ServerName cfrost.net.local
      ErrorLog "/private/var/log/apache2/sites-error_log"
      CustomLog "/private/var/log/apache2/sites-access_log" common
    </VirtualHost>

    5.sudo apachectl restart重启Apache即可,注意站点目录755权限,测试不能放在用户目录。

  • 相关阅读:
    预备作业02 : 体会做中学(Learning By Doing)
    7-1 货币转换
    秋季学校总结
    人生路上对我影响最大的三个老师
    自我介绍
    2019寒假作业3(抓老鼠啊~亏了还是赚了?)编程总结
    人生路上对我影响最大的三位老师
    自我介绍
    秋季学期学习总结
    7-1 抓老鼠啊~亏了还是赚了?
  • 原文地址:https://www.cnblogs.com/cfrost/p/4956385.html
Copyright © 2011-2022 走看看