1.修改apache用户配置文件
vi /etc/apache2/users/zze.conf
<Directory "/Users/zze/Sites/">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
2.修改apache httpd-userdir配置文件
vi /etc/apache2/extra/httpd-userdir.conf
Include /private/etc/apache2/users
3.修改apache httpd配置文件
vi /etc/apache2/httpd.conf
LoadModule authn_core_module libexec/apache2/mod_authn_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule php7_module libexec/apache2/libphp7.so
Include /private/etc/apache2/extra/httpd-mpm.conf
Include /private/etc/apache2/extra/httpd-userdir.conf
4.配置本地域名
首先修改本地 hosts文件 添加上域名 前面为IP地址 后面为域名
127.0.0.1 down.loan.com
然后修改 /etc/apache2/httpd.conf 文件
<VirtualHost *:80>
ServerName down.loan.com
DocumentRoot "/Users/zze/Sites/DownDot"
<Directory /Users/zze/Sites/DownDot>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
5.修改上传文件大小 和 post请求数据大小
cd /etc/php.in
post_max_size = 100M
upload_max_filesize = 200M
6.给用户文件附权限
sudo chmod 644 /etc/apache2/users/zze.conf
7.重启Apache
sudo apachectl restart;
|