MAC OSX10.9.2上搭建Apache,php,osx10.9.2apache_PHP教程
程序员文章站
2024-01-20 20:10:28
...
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 OSX10.9.2上搭建Apache,php,osx10.9.2apache_PHP教程
-
MAC OSX10.9.2上搭建Apache,php,osx10.9.2apache
-
在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程,_PHP教程
-
MAC OSX1011上搭建Apache,PHP,MySQL5615,phpMyAdmin开发环境
-
在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程,
-
在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程
-
MAC OSX10.10上搭建Apache,PHP,MySQL5.6.22,phpMyAdmin开发环境
-
在Mac OS上搭建Nginx+PHP+MySQL开发环境的教程,
-
MAC OSX10.9.2上搭建Apache,php,osx10.9.2apache_PHP教程
-
mac下Apache + MySql + PHP搭建网站开发环境_PHP教程