apache2には利用可能なリスニングソケットはありませんが、ポートから何も聞きません。

apache2には利用可能なリスニングソケットはありませんが、ポートから何も聞きません。

UbuntuサーバーにSSLを設定しようとしています。次のコマンドを使用して鍵とopenssl genrsa -out mydomain.key 1024証明書を生成しましたopenssl req -new -key mydomain.key -x509 -out mydomain.crt。 httpd.confに追加しましたがLoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so、私のhttpd.confの関連抜粋部分は次のとおりです。

LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
NameVirtualHost *:80
NameVirtualHost *:443
Listen 80
Listen 443
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:443>
ProxyPass /software-suite http://localhost:8087/software-suite
ProxyPassReverse /software-suite http://localhost:8087/software-suite

SSLEngine on
SSLCertificateFile /etc/apache2/ssl.crt/hostname.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/hostname.key
</VirtualHost>


<VirtualHost *:80>
ProxyPass /software-suite http://localhost:8087/software-suite
ProxyPassReverse /software-suite http://localhost:8087/software-suite

</VirtualHost>

走ると手にsudo service apache2 start入る

* Starting web server apache2                                                                                                                                                                           Thu Feb 25 23:01:37 2016] [warn] module ssl_module is already loaded, skipping
[Thu Feb 25 23:01:37 2016] [warn] The Alias directive in /etc/apache2/httpd.conf at line 499 will probably never match because it overlaps an earlier Alias.
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

しかし、私が走るとき、sudo netstat -ltnp | grep ':443'誰も聞いていません。

修正する

<VirtualHost *:443>ノードとその内容をに移動しました。/etc/apache2/sites-available/default-sslapache2 を起動すると、次の結果が表示されます。

 * Starting web server apache2                                                                                                                                                                                                               [Fri Feb 26 16:36:43 2016] [warn] The Alias directive in /etc/apache2/httpd.conf at line 499 will probably never match because it overlaps an earlier Alias.
                                                                                                                                                                                                                                      [ OK ]

これで、ポート80で自分のWebサイトにアクセスできますが、ERR_SSL_PROTOCOL_ERRORhttpsを使用してアクセスしようとすると問題が発生します。また、実行するとポート80に着信要求を処理しているように見えますが、エラーがsudo service apache2 status発生します。私も、およびをApache2 is NOT running.コメントアウトしました。エラーがないか、ログインのみが表示されます。NameVirtualHost *:443LoadModule ssl_moduleListen 443httpd.conf/var/log/apache2/error.log/var/log/apache2/access.log/var/log/apache2

ベストアンサー1

ここで答えを見つけました。https://webmasters.stackexchange.com/questions/58650/what-steps-are-required-to-enable-ssl-on-apache2-with-ubuntu。 apache2を実行して再起動する必要がありますsudo a2ensite default-ssl

おすすめ記事