古い 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 error Could not open configuration file /etc/apache2/conf.d/: No such file or directory - Ask Ubuntu」
https://askubuntu.com/questions/365454/apache2-error-could-not-open-configuration-file-etc-apache2-conf-d-no-such-fi
を参考に以下の処理を行う。
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 ]
$