This document describes how to install an SSL certificate in a Lighthouse instance and enable HTTPS access, with a Windows Server 2012 R2 system image-based instance as an example.
NoteThe SSL certificate used in the document is provided by Tencent Cloud. For more information on this service, see Overview and Purchase Guide.
Name | Description |
---|---|
Lighthouse instance's public IP address | Instance IP address used to connect a local computer to the instance. |
Username | The username used to log in to the Lighthouse instance, such as `Administrator`. |
Password | The password matching the username used to log in to the Lighthouse instance. |
NoteYou can log into the Lighthouse console, find the target instance, and enter its details page to view its public IP address. After the instance is created, first reset the password and remember it. For more information, see Resetting Password.
cloud.tencent.com
certificate file package to a local directory.cloud.tencent.com_apache
folder.cloud.tencent.com_apache
root_bundle.crt
: Certificate filecloud.tencent.com.crt
: Certificate filecloud.tencent.com.key
: Private key filecloud.tencent.com.csr
: CSR fileNoteYou can upload the CSR file when applying for a certificate or have it generated online by the system. It is provided to the CA and irrelevant to the installation.
root_bundle.crt
, cloud.tencent.com.crt
, and cloud.tencent.com.key
files from the local directory to the Apache server. For more information on how to upload a certificate file, see How to Upload Local File to Lighthouse Instance.ssl.crt
and ssl.key
folders under the \conf
directory. You can specify the file location. The sample directory in this document is as shown below:SSL Certificate File | Folder |
---|---|
root_bundle.crt | ssl.crt |
cloud.tencent.com.crt | |
cloud.tencent.com.key | ssl.key |
Open the httpd.conf
file in the conf
directory of the Apache server with a text editor and delete the #
before the following fields.
#LoadModule ssl_module modules/mod_ssl.so
#Include conf/extra/httpd-ssl.conf
Open the httpd-ssl.conf
file in the conf\extra
directory of the Apache server with a text editor as shown below:
Modify the httpd-ssl.conf
file and set the following field parameters to the paths of the uploaded certificate files as shown below:
SSLCertificateFile "C:/apache/conf/ssl.crt/cloud.tencent.com.crt"
SSLCertificateKeyFile "C:/apache/conf/ssl.key/cloud.tencent.com.key"
SSLCertificateChainFile "C:/apache/conf/ssl.crt/root_bundle.crt"
4. Restart the Apache server and then you access it through `https://cloud.tencent.com`. If the "AH00526: Syntax error on line 18 of C:/apache/conf/extra/httpd-ahssl.conf:Cannot define multiple Listeners on the same IP:port" error is reported during the restart, there is a listening port conflict. Replace the listening port `443` in `conf\extra\httpd-ahssl.conf` with another port.NoteIf there is no
SSLCertificateChainFile
entry in thehttpd-ssl.conf
configuration file, add it to the corresponding location as shown below:
Open the httpd.conf
file in the conf
directory of the Apache server with a text editor and delete the #
before the following fields.
#LoadModule rewrite_module modules/mod_rewrite.so
Configure the fields in the website running directory. For example, add the following content to the <directory "c:="" xampp="" htdocs"="">
field:
<Directory "C:/xampp/htdocs">
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</Directory>
Restart the Apache server and then you can access it through both http://cloud.tencent.com
(which will be automatically redirected to https://cloud.tencent.com
) and https://cloud.tencent.com
.
Was this page helpful?