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权限,测试不能放在用户目录。

  • 相关阅读:
    Maximum sum
    走出迷宫
    取石子游戏
    全排列
    BZOJ3456 城市规划
    【SHOI2016】黑暗前的幻想乡
    【AHOI2012】信号塔
    HDU5730 Shell Necklace
    线性常系数齐次递推关系学习笔记
    矩阵树定理学习笔记
  • 原文地址:https://www.cnblogs.com/cfrost/p/4956385.html
Copyright © 2011-2022 走看看