设为首页 加入收藏

TOP

OS X 配置 Apache
2017-10-11 15:04:28 】 浏览:996
Tags:配置 Apache

1.去掉java script: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权限,测试不能放在用户目录。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇博客园 Mac客户端 2.0-Beta 下一篇实用网址集合

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目