Mac配置Apache
查看Apache版本
httpd -v
Apache管理
sudo apachectl start sudo apachectl stop sudo apachectl restart
配置用户访问目录
默认访问:/Library/WebServer/Documents/
cd /etc/apache2/users sudo vim username.conf
username是用户名。
<Directory "/Users/Aaron/Sites/"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
修改Apache下的httpd.conf,去掉以下前边的“#”
LoadModule php5_module libexec/apache2/libphp5.so 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 Include /private/etc/apache2/extra/httpd-userdir.conf
修改/etc/apache2/extra/httpd-userdir.conf,去掉以下代码前边的“#”
Include /private/etc/apache2/users/*.conf
访问http://localhost/~Aaron/,提示“You don‘t have permission to access /~Aaron/ on this server”,修改
/etc/apache2/httpd.conf
<Directory /> AllowOverride none Require all denied </Directory>
为
<Directory /> AllowOverride none Require all granted </Directory>
软链接如果不展示,那是因为访问权限的问题,可以修改文件夹权限:
chmod 777 yourfolder
相关推荐
乌冬面 2020-06-21
changecan 2020-11-19
sunnnyduan 2020-10-16
lonesomer 2020-09-17
houdaiye 2020-09-23
XPZ0 2020-09-22
changecan 2020-09-22
jackadmi 2020-09-11
yuan00yu 2020-08-24
yserver 2020-08-15
liyansring 2020-08-15
liai 2020-08-09
山有木兮卿有意 2020-08-03
85206633 2020-07-28
suosuo 2020-07-28
83911930 2020-07-28
85590296 2020-07-22