Home  >  Article  >  Operation and Maintenance  >  How to configure https in apache2.4

How to configure https in apache2.4

(*-*)浩
(*-*)浩Original
2019-10-29 14:14:354447browse

How to configure https in apache2.4

Get the certificate

openssl generates SSL certificate (self-Baidu) (Recommended learning: apache use)

Tencent Cloud, Alibaba Cloud, Baidu Cloud, etc. all provide free SSL certificates

Certificate installation

Edit the Apache root directory Download the conf/httpd.conf file, find #LoadModule ssl_module/mod_ssl.so and #Include conf/extra/httpd-ssl.conf, remove the # comment in front;

Edit Apache and directory conf/extra/httpd-ssl.conf file, modify the following content:

<VirtualHost *:443>
    DocumentRoot "/var/www/html"
    ServerName www.domain.com:443
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_www.domain.com_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_www.domain.com.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>

After the configuration is completed, restart Apache and you can access it using https://www.domain.com.

Note:

How to configure https in apache2.4

The above is the detailed content of How to configure https in apache2.4. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn