niko:~ xxx$ sudo apachectl -k start
Password:
AH00526: Syntax error on line 20 of /private/etc/apache2/extra/httpd-mpm.conf:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration
然后 按照网上搜的结果打开 http-mpm.conf文件#注释报错行,再次启动apache
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
好像是端口被占用,其实 好像也没多大问题换个端口就OK了;
重新启动下就OK了;
2、Apache 使用Alias 的时候要注意,因为更新了系统后Apache 会升级到2.4 的版本;相关的Alias也要对应调整;
Alias /test "/Users/xxx/test"
<Directory "/Users/xxx/test">
Options Indexes MultiViews
AllowOverride None
#OS X 10.9
order allow,deny
Allow from all
</Directory>
Alias /test "/Users/xxx/test"
<Directory "/Users/xxx/test">
Options Indexes MultiViews
AllowOverride None
#OS X 10.11
Require all granted
</Directory>