21

Yesterday I upgraded my Mac from Mountain Lion to El Capitan. Trying to get apache2 working I get the following error message:

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.

What might be the remedy?

35

LockFile is one of the directives of Apache ≤ 2.2. This was replaced by Mutex in Apache 2.4, which is the version of Apache installed with OS X 10.11, El Capitan.

Edit the file /etc/apache2/extra/httpd-mpm.conf to remove this part:

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
  LockFile "/private/var/log/apache2/accept.lock"
</IfModule>
</IfModule>

Then check config apachectl -t and restart sudo apachectl restart.

  • This works. This happens when you update your MacOSX from your previous OSX version. – Placeholder Sep 27 '16 at 6:18
16

I looked up the information on the file http-mpm.conf at the Apache website:

It says LockFile is a correct directive. I don't know why I'm getting the same error you are. So in terminal, I went to:

/etc/apache2/extra

and restored the httpd-mpm.conf file from before I loaded El Capitan. I used these commands:

sudo mv httpd-mpm.conf httpd-mpm.conf.elcapitan
sudo mv httpd-mpm.conf~orig httpd-mpm.conf

and entered the commands:

sudo apachectl restart
apachectl configtest

and got "Syntax OK"

If I enter http://localhost in my browser, I get the page "it works".

  • whats the important change from your original config file? I am starting from fresh so I don't have known working config file. – daslicious Oct 25 '15 at 23:31
  • I have the same issue, but this doesn't actually offer any fix. – Jake N Nov 24 '15 at 9:45

You must log in to answer this question.

protected by Community Dec 18 '15 at 22:04

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .