mac 10.9.x已经自带了apache,可按如下步骤开启:
1、启动
sudo apachectl start
启动后,访问 http://localhost/ 应该能看到"It works!"的初始页面,如果对初始页面的内容感到好奇,可以打开"/etc/apache2/httpd.conf",197行可以看到如下代码片段:
1 <Directory "/Library/WebServer/Documents"> 2 # 3 # Possible values for the Options directive are "None", "All", 4 # or any combination of: 5 # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 6 # 7 # Note that "MultiViews" must be named *explicitly* --- "Options All" 8 # doesn't give it to you. 9 # 10 # The Options directive is both complicated and important. Please see 11 # http://httpd.apache.org/docs/2.2/mod/core.html#options 12 # for more information. 13 # 14 Options Indexes FollowSymLinks MultiViews 15 16 # 17 # AllowOverride controls what directives may be placed in .htaccess files. 18 # It can be "All", "None", or any combination of the keywords: 19 # Options FileInfo AuthConfig Limit 20 # 21 AllowOverride None 22 23 # 24 # Controls who can get stuff from this server. 25 # 26 Order allow,deny 27 Allow from all 28 29 </Directory>