2018年12月23日日曜日

Apache(SSL設定方法)


1)mod_sslをインストールする。
yum install mod_ssl


2)ssl.confの編集を行う。

=======/etc/httpd/conf.d/ssl.conf============
#
# When we also provide SSL we have to listen to the
# the HTTPS port in addition.
#
#Listen 443 https  <--無効化にする。
          .
          .
          .   

#   SSL Protocol support:
# List the enable protocol levels with which clients will be able to
# connect.  Disable SSLv2 access by default:
#SSLProtocol all -SSLv2 -SSLv3
SSLProtocol -all +TLSv1.2   <--追加する
          .
          .
          .
## 行の末端に新規追加 ##

<VirtualHost *:443>
  ErrorLog logs/ssl_error_log
  LogLevel warn
  SSLEngine on
  SSLProtocol all -SSLv3
  SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
  SSLCertificateFile /etc/httpd/conf/server.crt    <--作成したserver.crtを指定すること
  SSLCertificateKeyFile /etc/httpd/conf/server.key <--作成したserver.keyを指定すること
  <Files ~ "\.(cgi|shtml|phtml|php3?)$">
        SSLOptions +StdEnvVars
    </Files>
    BrowserMatch "MSIE [2-5]" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
    CustomLog logs/ssl_access_log ltsv_ssl
</VirtualHost>

========================================



3)httpd.confの編集を行う。

=======/etc/httpd/conf/httpd.conf===========
#Listen 12.34.56.78:80
#Listen 80
Listen 192.168.1.111:443  <----サーバのIP:443を追記する。


##### 末端に以下を追記 ######
Include /etc/httpd/conf.d/ssl.conf

<IfModule ssl_module>
 SSLRandomSeed startup builtin
 SSLRandomSeed connect builtin
</IfModule>

===========================================



4)httpdのサービスを再起動を行う
systemctl restart httpd


0 件のコメント:

コメントを投稿

test

参照先: https://pecopla.net/seo-column/htaccess-redirect-errors-approach https://www.seohacks.net/blog/1042/ https://htaccess.madewithlove.com/...