MAC OSX10.9.2上搭建Apache,php,osx10.9.2apache
程序员文章站
2022-04-09 11:12:38
...
MAC OSX10.9.2上搭建Apache,php,osx10.9.2apache
mac osx10.9.* 自带了apache, php
Apache配置
1- 启动
sudo apachectl start
启动后,访问 http://localhost/ 应该能看到"It works!"的初始页面,
vi /etc/apache2/httpd.conf
197行可以看到如下代码片段:
# # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks MultiViews # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride None # # Controls who can get stuff from this server. # Order allow,deny Allow from all
cd /Library/WebServer/Documents
It Works 内容在 index.html.en 这是apache的默认页
2- 停止/重启
sudo apachectl stop
sudo apachectl restart
3- 创建个人站点目录
cd ~
mkdir Sites
echo "helloWorld" >> index.html
sudo apachectl restart
然后再访问 http://localhost/~shelley/ 应该就能看到"helloWorld"的个人目录初始页面(注:~shelley需换成~你的用户名)
如果失败
sudo vi /etc/apache2/users/Guest.conf
/Users/shelley/Sites
推荐阅读
-
mac下Apache + MySql + PHP搭建网站开发环境
-
Mac 下搭建 apache / nginx+php+mysql nginxapachemysqlphp
-
FreeBSD6.2上搭建apache2.2+mysql5.11+php5+phpmyadmin
-
FreeBSD6.2上搭建apache2.2.4+mysql5.1.7+php5.2.1+phpmyadmin
-
在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程
-
MAC OSX10.10上搭建Apache,PHP,MySQL5.6.22,phpMyAdmin开发环境
-
mac下Apache + MySql + PHP搭建网站开发环境
-
在 Mac OSX 上搭建 PHP 开发环境时遇到了异常(用 brew 安装 php 5.5 时) ?
-
在Mac OS上搭建PHP的Yii框架及相关测试环境_PHP
-
Mac10.10上配置Apache和PHP+MySQL环境