cloud.tencent.com is used as an example.Apache/2.4.6 version is used as an example. The default port is 80. You can download it from the Apache official website. If you need to use another version, contact us.443 on the Apache server so that HTTPS can be enabled after the certificate is installed. For more information, see How Do I Enable Port 443 for a VM?.Name | Description |
Server IP address | IP address of the server, which is used to connect the PC to the server. |
Username | The username used to log in to the server. |
Password | The password used to log in to the server. |
cloud.tencent.com certificate file package to the local directory.
After decompression, you can get the certificate file of the corresponding type, which includes the cloud.tencent.com_apache folder.cloud.tencent.com_apacheroot_bundle.crt: certificate filecloud.tencent.com.crt: certificate filecloud.tencent.com.key: Private key filecloud.tencent.com.csr fileroot_bundle.crt and cloud.tencent.com.crt and the private key file cloud.tencent.com.key from the local directory to the /etc/httpd/ssl directory of the Apache server./etc/httpd/ssl directory does not exist, run the mkdir /etc/httpd/ssl command to create it.conf.d, conf, and conf.modules.d directories are under the /etc/httpd directory by default.httpd.conf configuration file under /etc/httpd/conf, find the Include conf.modules.d/*.conf configuration statement (for loading the SSL configuration directory) and check whether it is commented out. If so, remove the comment symbol (#) from the first line and save the configuration file.00-ssl.conf configuration file under /etc/httpd/conf.modules.d, find the LoadModule ssl_module modules/mod_ssl.so configuration statement (for loading the SSL module) and check whether it is commented out. If so, remove the comment symbol (#) from the first line and save the configuration file.LoadModule ssl_module modules/mod_ssl.so and Include conf.modules.d/*.conf configuration statements cannot be found in the configuration files above, check whether the mod_ssl.so module has been installed, and if not, run the yum install mod_ssl command to install it.ssl.conf configuration file in the /etc/httpd/conf.d directory by modifying the following:<VirtualHost 0.0.0.0:443>DocumentRoot "/var/www/html"# Enter the certificate nameServerName cloud.tencent.com# Enable SSLSSLEngine on# Path of the certificate fileSSLCertificateFile /etc/httpd/ssl/cloud.tencent.com.crt# Path of the private key fileSSLCertificateKeyFile /etc/httpd/ssl/cloud.tencent.com.key# Path of the certificate chain fileSSLCertificateChainFile /etc/httpd/ssl/root_bundle.crt</VirtualHost>
https://cloud.tencent.com./etc/httpd/conf directory.httpd.conf configuration file is located in more than one directory. You can filter them by /etc/httpd/*.LoadModule rewrite_module modules/mod_rewrite.so is in it.#) in front of LoadModule rewrite_module modules/mod_rewrite.so and proceed to step 4.*.conf file such as 00-rewrite.conf in /etc/httpd/conf.modules.d and add the following content to it:LoadModule rewrite_module modules/mod_rewrite.so
httpd.conf configuration file:<Directory "/var/www/html"># Add the following:RewriteEngine onRewriteCond %{SERVER_PORT} !^443$RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]</Directory>
http://cloud.tencent.com.Feedback