CentOS 7は静的httpsコンテンツを提供しません。なぜできないのですか? [閉鎖]

CentOS 7は静的httpsコンテンツを提供しません。なぜできないのですか? [閉鎖]

再インストールhttpdして静的index.htmlファイルを作成しました。firewalldインターネット経由でサービスにアクセスできるように設定しましたhttps。しかし、https://my.server.ipWebブラウザに何かを入力すると、ブラウザがサーバーに接続できないというエラーメッセージが表示されます。 ブラウザがファイルを受信するには何を変更する必要がありますかindex.html

firewalld共通領域の定義は次のとおりです。

[[email protected]]# firewall-cmd --list-all
public (default, active)
  interfaces: enp3s0
  sources: 
  services: https ssh
  ports: 
  masquerade: no
  forward-ports: 
  icmp-blocks: 
  rich rules: 

index.htmlファイルとその場所は次のとおりです。

[[email protected]]# cd /var/www/html
[[email protected] html]# cat index.html
<html>
<body>
Understand that this is a test.  If this text appears in the browser, then https is working.
</body>
</html>

これはVirtualHost次のタグですhttpd.conf

<VirtualHost server.ip.address:443>
   DocumentRoot /var/www/html/
   SSLEngine on
   SSLProxyEngine on
   SSLCertificateFile /etc/pki/tls/certs/localhost.crt
   SSLCertificateChainFile /etc/pki/tls/certs/ca-bundle.crt
   SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
   # ProxyPass / http://localhost:8080/
   # ProxyPassReverse / http://localhost:8080/
</VirtualHost>  

これはリンクです完全なhttpd.confファイルに。

編集#1

私のシステムにインストールされているSSLを見ると、混合結果が表示されます。たとえば、443では何も聞きません。また、systemctlはopensslを見つけることができませんが、yumはopenslがすでにインストールされていると思うようです。しかし、.crtファイルが予想される場所にあることを確認しました。

[root@1my-server-ip-addr ~]# netstat -na | grep 443.*LISTEN
[root@1my-server-ip-addr ~]# systemctl status openssl
openssl.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

[root@1my-server-ip-addr ~]# yum install openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.chkhosting.com
 * epel: mirror.nexcess.net
 * extras: ftpmirror.your.org
 * updates: centos.mbni.med.umich.edu
Package 1:openssl-1.0.1e-34.el7_0.6.x86_64 already installed and latest version
Nothing to do

編集#2

また、次のようにmod_sslとhttpdのステータスを確認しました。

[root@1my-server-ip-addr certs]# systemctl status mod_ssl.service
mod_ssl.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

[root@1my-server-ip-addr certs]# systemctl status httpd
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
   Active: active (running) since Thu 2014-12-11 18:44:31 EST; 1h 54min ago
 Main PID: 4094 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─4094 /usr/sbin/httpd -DFOREGROUND
           ├─4095 /usr/sbin/httpd -DFOREGROUND
           ├─4096 /usr/sbin/httpd -DFOREGROUND
           ├─4097 /usr/sbin/httpd -DFOREGROUND
           ├─4098 /usr/sbin/httpd -DFOREGROUND
           └─4099 /usr/sbin/httpd -DFOREGROUND

Dec 11 18:44:31 1my-server-ip-addr.static.servdns.com systemd[1]: Started The Apac...
Hint: Some lines were ellipsized, use -l to show in full.  

編集#3

prateek61の提案に基づいて、以下も試しました。

[root@1my-server-ip-addr certs]# error_log
-bash: error_log: command not found
[root@1my-server-ip-addr certs]# access_log
-bash: access_log: command not found
[root@1my-server-ip-addr certs]# sestatus
SELinux status:                 disabled  

編集#4

access_logで以下を見つけました。今日、多くの構成が変更されており、これらのログの一部が他の構成で生成された可能性があるため、それらを解釈する方法がわかりません。

[Thu Dec 11 15:37:59.025223 2014] [mpm_prefork:notice] [pid 2627] AH00170:  caught SIGWINCH, shutting down gracefully
[Thu Dec 11 16:40:07.114619 2014] [mime:error] [pid 981] (2)No such file or directory: AH01597: could not open mime types config file /etc/httpd/conf/mime.types.
AH00016: Configuration Failed
[Thu Dec 11 16:43:30.051125 2014] [mime:error] [pid 1076] (2)No such file or directory: AH01597: could not open mime types config file /etc/httpd/conf/mime.types.
AH00016: Configuration Failed
[Thu Dec 11 18:44:31.845012 2014] [suexec:notice] [pid 4094] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Dec 11 18:44:31.891627 2014] [auth_digest:notice] [pid 4094] AH01757: generating secret for digest authentication ...
[Thu Dec 11 18:44:31.893061 2014] [lbmethod_heartbeat:notice] [pid 4094] AH02282: No slotmem from mod_heartmonitor
[Thu Dec 11 18:44:31.898347 2014] [mpm_prefork:notice] [pid 4094] AH00163: Apache/2.4.6 (CentOS) configured -- resuming normal operations
[Thu Dec 11 18:44:31.898394 2014] [core:notice] [pid 4094] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'  

編集#5

私は走っyum remove mod_ssl httpdyum install mod_ssl httpd。その後、Webブラウザを開き、https server.ip.addr同じ接続失敗メッセージを要求して受信しました。ただし、次のログが生成されます。

access_log

::1 - - [11/Dec/2014:21:47:42 -0500] "OPTIONS * HTTP/1.0" 200 - "-"  "Apache/2.4.6 (CentOS) (internal dummy connection)"
::1 - - [11/Dec/2014:21:47:42 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"
::1 - - [11/Dec/2014:21:47:42 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"
::1 - - [11/Dec/2014:21:47:42 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"
::1 - - [11/Dec/2014:21:47:42 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.6 (CentOS) (internal dummy connection)"  

エラー履歴

[Thu Dec 11 21:47:42.930487 2014] [mpm_prefork:notice] [pid 4094] AH00170: caught SIGWINCH, shutting down gracefully  

または変更はありません ssl_access_logssl_error_logssl_request_log

削除して再インストールする行為によって新しいログが生成されることがあるかどうか疑問に思います。


部分的な答え

次のようにリクエストしたときにページを提供するには、3つのステップが必要ですhttpdindex.htmlhttps my.server.ip

1.) yum remove mod_ssl httpd  
2.) yum install mod_ssl httpd  
3.) systemctl restart httpd.service  

ただし、詳しく見ると、削除VirtualHostディレクティブとListen 443fromがhttpd.conf静的コンテンツを提供する役割を果たしていることがわかります。VirtualHostディレクティブを再追加すると、新しいエラーが発生しました。

最終目標は、Webブラウザが特定のドメインの要求を受信したときにファイルを提供するVirtualHostことであるため、このディレクティブが必要ですwartomcathttps

に同様の指示が記載されているので、Listen 443再度入れようとしませんでした。httpd.confListenssl.conf

ベストアンサー1

上記の例では、ポート8080でリッスンするプロキシをコメントアウトしました。 (リバース)プロキシが設定されていて、まだフロントエンドでリッスンしていますか?この場合、フロントエンドサーバーでSSLを有効にし、上記の例のように8080でリッスンしているコメントを削除する必要があります。

まだ受信しているフロントエンドプロキシがない場合:説明したように削除して再インストールするときにssl.confを再設定したことを確認してください。これにより、以前に設定した値と証明書パスも削除されます(どのように生成しましたか?)。 )。

httpd -thttpdを再起動して 。構文OKに戻ったら、pingを実行して完全に問題ないことを確認することをお勧めします。だとしたらお願いします。 SSL.confを共有

おすすめ記事