System Environment:Linux:centos Release 6.5 (Final)
LAMP
Steps
1.lamp turn on SSL
# yum Install OpenSSL mod_ssl-y # installs OpenSSL and Apache SSL modules
2. Method of certificate Generation
# OpenSSL Genrsa-des3-out server.key 1024 # Generate server private key
# OpenSSL Req-new-key server.key-out SERVER.CSR # Generate a server certificate request and fill in the relevant certificate information as required
# OpenSSL x509-req-days 700-in server.csr-signkey server.key-out Server.cert # Visa
#/etc/init.d/mysqld Restart # restart Apache
3. Configure the virtual host file
# vim/etc/httpd/conf/httpd.conf
Add the following content:
Listen 5123<virtualhost *:5123> ServerName localhost.localdomain documentroot/etc/httpd/conf/ Sslengine on Sslcertificatefile "/etc/httpd/conf/server.cert" sslcertificatekeyfile "/etc/httpd/conf/server.key" </ Virtualhost>
# semanage Port-a-T http_port_t-p TCP 5123 # Add new end for HTTP service 5123
# semanage Port-a-T http_port_t-p TCP 443 # Add new end for HTTP service 443
#/sbin/iptables-i input-p TCP--dport 5123-j ACCEPT # Adds a new end to the HTTP service 5123
#/sbin/iptables-i input-p TCP--dport 443-j ACCEPT # Adds a new end to the HTTP service 443
#/etc/init.d/mysqld Restart # restart Apache
installation steps for 4.semanage
# yum Provides/usr/sbin/semanage
# yum-y Install Policycoreutils-python
# Semanage Port-l | grep http # validation
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. http://blog.csdn.net/lemon_tree12138
Configure HTTPS access host and bind access port number under CentOS