For a Web site to implement HTTPS secure access, you need to do the following steps:
1, the domain name resolver to apply for an SSL certificate, the certificate can be applied for free, after the application, including many Web configuration certificate type
Such as:
2, build Web services, the environment I built here is the lamp environment.
3. Upload the SSL certificate to the corresponding directory.
4. Configure authentication access for SSL certificates.
5. Configure host access for httpd.
The specific configuration is as follows:
The resolution of the domain name, here do not repeat it.
1, about lamp environment to build I use the Yum installation environment, the system for the centos6.9
The construction of the environment is not introduced here.
When the lamp environment is installed, verify that there is a default installation of Apache Mod_ssl
Module. Install using Yum install mod_ssl-y if it is not installed. After the module is installed, the ssl.conf file is generated in/ETC/HTTPD/CONF.D.
2, the certificate upload to:/etc/ssl/apache.
3, configure the SSL certificate authentication, backup the ssl.conf configuration file, and rename (command according to your own domain name).
and re-configure it.
You can copy the content into your own SSL configuration file.
LoadModule ssl_module modules/mod_ssl.soListen 443SSLPassPhraseDialog builtinSSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)SSLSessionCacheTimeout 300SSLMutex defaultSSLRandomSeed startup file:/dev/urandom 256SSLRandomSeed connect builtinSSLCryptoDevice builtin<VirtualHost _default_:443>ServerName www.自己域名.wangDocumentRoot /var/www/html/dedeErrorLog logs/ssl_error_logTransferLog logs/ssl_access_logLogLevel warnSSLEngine onSSLProtocol all -SSLv2SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DESSSLCertificateFile /etc/ssl/Apache/2_自己证书.crtSSLCertificateKeyFile /etc/ssl/Apache/3_自己证书.key<Files ~ "\.(cgi|shtml|phtml|php3?)$"> SSLOptions +StdEnvVars</Files><Directory "/var/www/cgi-bin"> SSLOptions +StdEnvVars</Directory>SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown CustomLog logs/ssl_request_log </VirtualHost>
4. Configure the HTTPD hosts host.
Configuration file:
<VirtualHost *:80> DocumentRoot /var/www/html/dede ServerName www.自己域名.wang ErrorLog logs/自己域名.wang-error_log CustomLog logs/自己域名.wang-access_log common# DirectoryIndex index.php index.html <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} ^自己域名.wang$ RewriteRule ^/(.*)$ https://www.自己域名.wang/$1 [L,R=301] RewriteCond %{HTTP_HOST} ^www.自己域名.wang$ RewriteRule ^/(.*)$ https://www.自己域名.wang/$1 [L,R=301] </IfModule></VirtualHost>
HTTP Jump HTTPS access is implemented.
Apache configures the HTTPS certificate and jumps