在Ubuntu14.04上,Apache2无法正常运行
在旧版的Ubuntu14.04上运行apt-get upgrade时,Apache2出现了错误。
sudo service apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 21apache20 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
「apache2错误,无法打开配置文件/etc/apache2/conf.d/:找不到文件或目录 – Ask Ubuntu」
参考这个后,进行以下操作。
生成 httpd.conf 文件
$ cd /etc/apache2
$ sudo touch httpd.conf
生成conf.d文件夹
而且,
$ sudo service apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 234 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
由于这个问题出现了,所以采取了以下措施。
$ sudo mkdir conf.d
进行了行动
$ sudo service apache2 restart
* Restarting web server apache2 AH00112: Warning: DocumentRoot [/home/sensho-ds/public_html] does not exist
[ OK ]
$