命令行:
开启apache服务:sudo apachectl start
停止apache服务:sudo apachectl stop
重启服务:sudo apachectl restart
查看版本:httpd -v
开启之后打开浏览器输入:localhost,看到
It works!
说明服务正常开启!
####################
命令行打开系统隐藏目录:
open /etc/apache2
1.httpd.conf配置:
找到httpd.conf,取消以下注释:
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 php5_module libexec/apache2/libphp5.so
Include /private/etc/apache2/extra/httpd-userdir.conf
前两个默认取消,只需取消后三个;
2.extra/httpd-userdir.conf配置:
找到extra/httpd-userdir.conf,取消以下注释:
Include /private/etc/apache2/users/*.conf;
3.users/Guest.conf配置:
找到users/Guest.conf,改为以下尖括号中的三行:
<Directory "/.../.../.../">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>
4.下载安装mysql:http://dev.mysql.com/downloads/mysql/;
5.Mac mysql修改密码:http://blog.csdn.net/u012382791/article/details/51107617;
6.查看配置:
项目路径下创建phpinfo.php:
<?php
phpinfo();
?>
另:修改默认路径(界面报错403)的记得修改文件夹的只读权限
####################