MacOS Apache配置
http.conf改成
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Satisfy all
</Directory>
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/Users/lumixraku/Sites">
....
Order allow,deny
Allow from all
</Directory>
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this direc
# symbolic links and aliases may be used to point to other loca
#
DocumentRoot "/Library/WebServer/Documents"
==============================
下面是10.11的配置
El Capitan Apache配置
sudo vim /etc/apache2/httpd.conf
找到DocumentRoot
DocumentRoot "/Users/yourname/Sites"
<Directory "/Users/yourname/Sites">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>
并且下面这些取消注释
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
如果有一些用户配置
到/etc/apache2/users中
创建一个 yourname.conf的文件
<Directory "/Users/yourname/Sites/">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>
sudo apachectl restart
之后使用这个访问
http://localhost/~username/