上周末我升级到了 Ubuntu 13.10(从 Ubuntu 13.04 开始),现在 Apache 无法启动。升级之前它运行良好,我自己也没有做任何更改。
当我重新启动时,我得到的是
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
因此,我创建了目录,然后得到了这个:
* 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.
谢谢!
答案1
替换此行
LockFile ${APACHE_LOCK_DIR}/accept.lock
有这个
Mutex file:${APACHE_LOCK_DIR} default
解决/etc/apache2/apache2.conf
了这个问题。
附加信息: 发生这种情况是因为升级也会升级您的 PHP。如果您从 PHP5.3.X 升级到 PHP5.5.X - 并选择保留修改后的文件,您将发现此错误。
答案2
您需要按照以下步骤安装 mod_xml2enc:
确保您有 mod_proxy:
sudo apt-get install libapache2-mod-proxy-html
对于 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