Apache server configuration SSL certificate stepped pit

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/A1344714150/article/details/89521019

According to Ali cloud when the help documentation to configure the Apache server SSL certificate, encountered some problems, specially recorded.

Configuration process:

After ① Ali cloud SSL certificate issued to the domain name, it needs to be downloaded to the local.

Extract the certificate folders can get three files, copy it to the root directory of the Apache conf folder in the ssl folder.

 ② Open the file httpd.conf apache installation directory conf directory, find the following and remove the "#"

#LoadModule ssl_module modules/mod_ssl.so (如果找不到请确认是否编译过 openssl 插件)
#Include conf/extra/httpd-ssl.conf(删除行首的配置语句注释符号“#”,保存后退出)

③ Open apache installation directory conf / extra / httpd-ssl.conf file, as follows:

Listen 443 
<VirtualHost *:443> 
 DocumentRoot "C:/phpstudy/PHPTutorial/WWW" 
 ServerName www.youdomain.cn 
 ServerAlias youdomain.cn 
 SSLEngine on 
 SSLProtocol TLSv1 TLSv1.1 TLSv1.2 
 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 
 SSLCertificateFile "C:/phpstudy/Apache/PHPTutorial/conf/2_www.youdomain.cn.crt" 
 SSLCertificateKeyFile "C:/phpstudy/PHPTutorial/Apache/conf/3_www.youdomain.cn.key" 
 SSLCertificateChainFile "C:/phpstudy/PHPTutorial/Apache/conf/1_root_bundle.crt" 
 
 <Directory "C:/phpstudy/PHPTutorial/WWW/> 
 Options FollowSymLinks ExecCGI 
 AllowOverride All 
 Order allow,deny 
 Allow from all 
 Require all granted 
 </Directory> 
</VirtualHost> 

 

Midway pit encountered:

Ali cloud help document No DNS configuration, and set the path is wrong, configure SSL certificate will not work according to the official method;

When canceled at the beginning of the include #, will find that the Apache server will not start properly, after review blog post, said there may be a big brother httpd-ssl.conf file does not lead to the right to open the bin directory under Apache root directory, find httpd.exe tool to verify the file httpd-ssl.conf

Run check and found that Apache httpd-ssl.conf own configuration file that is wrong, need to adjust their own path

Debug configuration path until there is no error, the system will replace the default certificate name his name certificate, start the Apache server, SSL certificates configuration is complete, the external network can access via https.

Guess you like

Origin blog.csdn.net/A1344714150/article/details/89521019