解決 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

以下のエラーでhttpdが起動できない問題の解決方法

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80

原因

cert.key がパスワードを持っているから。

解決手順

apache のプロセスをKILLする

例えば、以下みたいな感じ。プロセスID(1047の部分)は、ps の結果を見て下さい。

% ps aux | grep httpd
% sudo kill -9 1047

keyをバックアップ

% cd /etc/pki/tls/certs
% sudo cp server.key server.key.bak

decryptionする

% sudo openssl rsa -in server.key -out new.server.key

新しいkeyにする

% sudo mv new.server.key server.key

apache再起動


以上で終わり。

参考URL

[SOLVED] (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 - Ubuntu Forums
http://ubuntuforums.org/showthread.php?t=1636667