39

I updated to Ubuntu 13.10 (from Ubuntu 13.04) last weekend, and now Apache is not being able to start. It was working perfectly well until the upgraded, and I haven't changed anything myself.

When I ran a restart this is what I get

apache2: Syntax error on line 260 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/: No such file or directory

So, I created the directory, and then I get this:

 * Starting web server apache2                                                                                                                                      * 
 * The apache2 configtest failed.
Output of config test was:
[Wed Oct 30 11:17:42.921934 2013] [proxy_html:notice] [pid 2496] AH01425: I18n support in mod_proxy_html requires mod_xml2enc. Without it, non-ASCII characters in proxied pages are likely to display incorrectly.
AH00526: Syntax error on line 84 of /etc/apache2/apache2.conf:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

Thanks!

2
  • Have you made modification to the /etc/apache2/apache2.conf file?
    – Dan
    Oct 30, 2013 at 14:33
  • Nop, I haven't.
    – 0R10N
    Oct 30, 2013 at 15:08

2 Answers 2

74

Replacing this line

LockFile ${APACHE_LOCK_DIR}/accept.lock

with this one

Mutex file:${APACHE_LOCK_DIR} default

in /etc/apache2/apache2.conf solved the problem.

Additional Info: It occurs because the upgrade also upgrades your PHP. If you upgrade from PHP5.3.X to PHP5.5.X - and choose to keep your modified files you will find this error.

2
  • 1
    Great! That makes two upvotes :D Nov 6, 2013 at 18:15
  • I've very similar situation with 0R10N. Except that I used 14.04. Exactly the same error and exactly what I did (creating the conf.d) before searching google and landed to this page. I've applied this one, BUT Apache threw another error. AH00526: Syntax error on line 201 of /etc/apache2/apache2.conf: - Line 201 in my file is the opening tag for Directory directives
    – GaryP
    Jun 27, 2014 at 22:16
9

You will need to install mod_xml2enc with these steps:

Make sure you have mod_proxy:

sudo apt-get install libapache2-mod-proxy-html

For mod_xml2enc

sudo apt-get install apache2-prefork-dev
mkdir ~/modbuild/ && cd ~/modbuild/
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.c
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.h
apxs2 -aic -I/usr/include/libxml2 ./mod_xml2enc.c
cd ~
rm -rfd ~/modbuild/
sudo service apache2 restart
1
  • 1
    In my case I had to install other packages too sudo apt-get install libxml2 libxml2-dev apache2-dev and execute the apxs2 and the rm commands with sudo too
    – oskarnrk
    Dec 3, 2014 at 10:12

You must log in to answer this question.

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