apache
配置apache虚拟机
http://blog.163.com/sylar_lin/blog/static/192332093201171211330364/
在finder下按cmd+shift+g 输入private/etc
-
在httpd.conf中找到
#Include /private/etc/apache2/extra/httpd-vhosts.conf
,去掉前面的“#”,保存并退出。 -
在httpd.conf中配置权限(注意前文自带需要去掉或者注释) private/etc/apache2/httpd.conf这里
-
<Directory "/Users/maiyan/sync"> Options All AllowOverride All Order allow,deny Allow from all </Directory>
-
在extra/httpd-vhosts.conf里面添加路由
<VirtualHost *:80> DocumentRoot "/Users/maiyan/sync" ServerName 127.0.0.1 ErrorLog "/private/var/log/apache2/sites-error_log" CustomLog "/private/var/log/apache2/sites-access_log" common </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/maiyan/sync/images001" ServerName images001.5173cdn.com ErrorLog "/private/var/log/apache2/sites-error_log" CustomLog "/private/var/log/apache2/sites-access_log" common </VirtualHost>
-
重启Apache sudo /usr/sbin/apachectl restart
-
host 就在etc下面
127.0.0.1 dev.5173cdn.com 127.0.0.1 img01.5173cdn.com 127.0.0.1 images001.5173cdn.com 127.0.0.1 images.5173cdn.com
192.168.140.74 dev.5173cdn.com 192.168.140.74 img01.5173cdn.com 192.168.140.74 images001.5173cdn.com 192.168.140.74 images.5173cdn.com
如果还是有问题可以试试
chmod -R 777 ./wbb
chmod -R 777 wbb
sudo chmod -R 777 ./
改文件读写
新增 httpd.conf注释掉
private/etc/apache2/httpd.conf这里
#<Directory />
# AllowOverride none
# Require all denied
#</Directory>