質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

Q&A

解決済

1回答

5408閲覧

httpdが起動しない。

youplus40

総合スコア19

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

0グッド

0クリップ

投稿2020/11/27 05:02

編集2020/11/27 05:43

前提・実現したいこと

TLSのバージョンサポートが終了し、サーバーの移行作業をしています。
前のサーバーにあったSSL証明書、httpd.confなどを新サーバーに移行し、
systemctl restart httpdを実行したところ、エラーになりました。
何が原因か分からず、困っております。

###エラーメッセージ

[root@ ~] systemctl restart httpd Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@ ~] systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/httpd.service.d └─php-fpm.conf Active: failed (Result: exit-code) since Fri 2020-11-27 11:44:53 JST; 56s ago Docs: man:httpd.service(8) Process: 543304 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUC> Process: 556613 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAI> Main PID: 556613 (code=exited, status=1/FAILURE) Status: "Reading configuration..." Nov 27 11:44:53 web06.xx.com systemd[1]: Starting The Apache HTTP Server... Nov 27 11:44:53 web06.xx.com systemd[1]: httpd.service: Main process exited, code=exi> Nov 27 11:44:53 web06.xx.com systemd[1]: httpd.service: Failed with result 'exit-code> Nov 27 11:44:53 web06.xx.com systemd[1]: Failed to start The Apache HTTP Server.
[root@ ~] journalctl -xe -- Unit sysstat-collect.service has finished starting up. -- -- The start-up result is done. Nov 27 11:44:34 web06.xx.com postfix/smtpd[556608]: connect from unknown[193.169.254.107]> Nov 27 11:44:35 web06.xx.com postfix/smtpd[556608]: lost connection after AUTH from unknown[193.169.254.107]> Nov 27 11:44:35 web06.xx.com postfix/smtpd[556608]: disconnect from unknown[193.169.2254.107] ehlo=1 auth=0/1 commands=1/2> Nov 27 11:44:53 web06.xx.com systemd[1]: Starting The Apache HTTP Server... -- Subject: Unit httpd.service has begun start-up -- Defined-By: systemd -- Support: https://access.redhat.com/support -- -- Unit httpd.service has begun starting up. Nov 27 11:44:53 web06.xx.com systemd[1]: httpd.service: Main process exited, code=exited ,status=1/FAILURE Nov 27 11:44:53 web06.xx.com systemd[1]: httpd.service: Failed with result 'exit-code'. Nov 27 11:44:53 web06.xx.com systemd[1]: Failed to start The Apache HTTP Server. -- Subject: Unit httpd.service has failed -- Defined-By: systemd -- Support: https://access.redhat.com/support -- -- Unit httpd.service has failed. -- -- The result is failed.

log

1//error.log (httpd.confで指定されているlog) 2AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

log

1//error.log (ssl.confで指定されているlog 2 [ssl:emerg] [pid 556664] SSL Library Error: error:140AD009:SSL routines:SSL_CTX_use_certificate_file:PEM lib

該当のソースコード

conf

1#httpd.conf 2ServerRoot "/etc/httpd" 3PidFile run/httpd.pid 4 5Timeout 30 6KeepAlive On 7#KeepAlive Off 8MaxKeepAliveRequests 90 9KeepAliveTimeout 2 10 11<IfModule prefork.c> 12StartServers 50 13MinSpareServers 50 14MaxSpareServers 50 15ServerLimit 250 16MaxClients 250 17MaxRequestsPerChild 2000 18</IfModule> 19 20Listen 80 21Include conf.modules.d/*.conf 22 23User apache 24Group apache 25 26ServerAdmin root@localhost.net 27ServerName localhost:80 28 29ExtendedStatus On 30ServerTokens Prod 31ServerSignature Off 32UseCanonicalName Off 33TraceEnable Off 34FileETag None 35 36DocumentRoot "/var/www/html" 37 38<Directory /> 39 Options FollowSymLinks 40 AllowOverride None 41 Order deny,allow 42 Deny from all 43</Directory> 44 45DirectoryIndex index.php index.cgi index.shtml index.html 46 47AccessFileName .htaccess 48<Files ~ "^.ht"> 49 Order allow,deny 50 Deny from all 51</Files> 52 53<Files ~ "^wp-*.php"> 54 Order allow,deny 55 Deny from all 56</Files> 57 58<Files ~ "^xmlrpc.php"> 59 Order allow,deny 60 Deny from all 61</Files> 62 63TypesConfig /etc/mime.types 64 65#DefaultType text/plain 66 67<IfModule mod_mime_magic.c> 68 MIMEMagicFile conf/magic 69</IfModule> 70 71HostnameLookups Off 72 73ErrorLog /home/www/log/error.log 74 75LogLevel warn 76 77LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v" combined 78LogFormat "%h %l %u %t \"%r\" %>s %b" common 79LogFormat "%{Referer}i -> %U" referer 80LogFormat "%{User-agent}i" agent 81 82SetEnvIfNoCase Request_URI ".(gif|jpg|jpeg|png|svg|swf|cur|ico|js|css|eot|ttf|woff|woff2)$" no_log 83SetEnvIf Remote_Addr "^127.0.0.1" no_log 84 85CustomLog /home/www/log/access.log combined 86 87RedirectMatch gone ^/apple-touch-icon* 88 89AddLanguage ca .ca 909192 93LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW 94ForceLanguagePriority Prefer Fallback 95 96AddDefaultCharset Off 97 98AddType application/x-tar .tgz 99AddEncoding x-compress .Z 100AddEncoding x-gzip .gz .tgz 101AddType application/x-compress .Z 102AddType application/x-gzip .gz .tgz 103 104AddHandler cgi-script .cgi 105 106AddHandler type-map var 107 108AddType text/html .shtml 109AddOutputFilter INCLUDES .shtml 110 111Alias /error/ "/var/www/error/" 112 113<IfModule mod_negotiation.c> 114<IfModule mod_include.c> 115 <Directory "/var/www/error"> 116 AllowOverride None 117 Options IncludesNoExec 118 AddOutputFilter Includes html 119 AddHandler type-map var 120 Order allow,deny 121 Allow from all 122 LanguagePriority en es de fr 123 ForceLanguagePriority Prefer Fallback 124 </Directory> 125</IfModule> 126</IfModule> 127 128BrowserMatch "Mozilla/2" nokeepalive 129130131 132<Location /server-status> 133 SetHandler server-status 134 Order deny,allow 135 Deny from all 136 Allow from 127.0.0.1 137 Allow from 211.XX.XX.XX 138</Location>

conf

1#XX.co.jp.conf 2# TEMP 3 <DirectoryMatch "/home/www/xx.co.jp/www/data"> 4 Header set Pragma no-cache 5</DirectoryMatch> 6<VirtualHost xx.co.jp:443> 7 ServerName xx.co.jp 8 9 RewriteEngine On 10 RewriteCond %{HTTP_HOST} ^www.xx.co.jp 11# RewriteRule ^/(.*)$ https://xx.co.jp/$1 [R,NE,L] 12 RewriteRule ^/(.*)$ http://xx.co.jp/$1 [R=302,NE,L] 13 14# TEMP 15 RewriteCond %{REMOTE_ADDR} !^127.0.0.1$ 16 RewriteCond %{HTTPS} on 17 RewriteCond %{SERVER_PORT} 443 18 RewriteRule ^/(.*)$ http://xx.co.jp/$1 [R=302,NE,L] 19 20 ServerAdmin info@xx.co.jp 21 DocumentRoot "/home/www/xx.co.jp/www/data" 22 CustomLog "|/usr/sbin/rotatelogs /home/www/xx.co.jp/www/log/access_log.%Y%m%d 86400 540" combined env=!no_log 23 ErrorLog "|/usr/sbin/rotatelogs /home/www/xx.co.jp/www/log/error_log.%Y%m%d 86400 540" 24 LogLevel rewrite:trace1 25 26 SSLEngine On 27 SSLCertificateKeyFile /etc/httpd/conf/certs/xx.co.jp.key 28 SSLCertificateFile /etc/httpd/conf/certs/xx.co.jp.crt 29 SSLCertificateChainFile /etc/httpd/conf/certs/xx.co.jp.ca 30</VirtualHost>

conf

1#ssl.conf 2LoadModule ssl_module modules/mod_ssl.so 3 4Listen 443 5 6AddType application/x-x509-ca-cert .crt 7AddType application/x-pkcs7-crl .crl 8 9SSLPassPhraseDialog builtin 10 11#SSLSessionCache dc:UNIX:/var/cache/mod_ssl/distcache 12SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000) 13SSLSessionCacheTimeout 300 14 15SSLMutex default 16 17SSLRandomSeed startup file:/dev/urandom 256 18SSLRandomSeed connect builtin 19 20SSLCryptoDevice builtin 21 22SSLProtocol all -SSLv2 -SSLv3 23SSLCipherSuite RSA+xxx 24 25SSLCertificateKeyFile /etc/httpd/conf/certs/wildcard.bb-f.net_2020.key.pem 26SSLCertificateFile /etc/httpd/conf/certs/wildcard.bb-f.net_2020.crt 27SSLCertificateChainFile /etc/httpd/conf/certs/FujiSSxxx.ca

補足情報(FW/ツールのバージョンなど)

apache 2.4.37
cent os 8.2

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

CHERRY

2020/11/27 05:25

apache なら、apachectl configtest を実行して設定ファイルのチェックをすると結果はどうなりますか?
youplus40

2020/11/27 05:44

Syntax OKと出ました。
take88

2020/11/27 08:06

証明書ファイルに間違いがないかが気になりますね。
guest

回答1

0

自己解決

/etc/httpd/conf/certs/xx.co.jp.crtの改行コード「^M」が文字列としてコピーされていました。
すでに入力されていた^Mを削除し、「Ctrl+V」と「Ctrl+M」を入力して改行コードにすることで、httpdが起動できました。

投稿2020/11/27 06:06

youplus40

総合スコア19

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問