Apache 默认会安装
Mac 自带 Apache,查看版本 httpd -v
-
配置文件位置:
/etc/apache2/httpd.conf
可以在配置文件末加一行Include /private/etc/apache2/other/*.conf
引入其他配置文件 -
默认网站根目录:
/Library/WebServer/Documents
-
启动等命令
apachectl start stop restart
-
优化 URL,开启 Apache 的
mod_rewrite
模块 -
启用多站点
-
开启 Apache 的
mod_vhost_alias
模块 -
开启
mod_log_config
模块 -
开启
Include /private/etc/apache2/extra/httpd-vhosts.conf
# 编辑主配置文件: httpd.conf
在 228行为:
<Directory />
AllowOverride none
Require all denied ## 这一行,拒绝所有链接了
</Directory>
改为如下形式:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
# 在一下配置文件中,添加你的虚拟站点
/private/etc/apache2/extra/httpd-vhosts.conf