Mac 自带的有 Apache2,可以直接使用。
- 修改 Apache 配置文件,有三处:
第一处:/private/etc/apache2/httpd.conf,去掉这一行的注释,使它生效 - /private/etc/hosts 添加自定义域名:
- /private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80> DocumentRoot "/Users/wangyanan/sites/StudentTrac/public/spa" ServerName spa.studenttrac.local ErrorLog "/private/var/log/apache2/error_log" <Directory "/Users/wangyanan/sites/StudentTrac/public/spa"> Options FollowSymLinks IncludesNOEXEC Indexes DirectoryIndex index.html index.htm index.php AllowOverride all Order Deny,Allow Allow from all