I tossed all night to padlock my website, and finally found a solution to the same situation as mine.
Handling self-knowledge FengYQ: https://zhuanlan.zhihu.com/p/43699640
1. Upload the apache certificate folder to the server
2. Enter the command sudo a2enmod ssl
to enable the module
3. Open the file /etc/apache2/sites-enabled/000-default
**4. Add ** at the end of the file
< VirtualHost 0.0.0.0:443>
DocumentRoot "/var/www/html"
ServerName www.domain.com #Domain Information
SSLEngine on
SSLCertificateFile /usr/local/apache/conf/2_www.domain.com.crt #Location of uploaded certificate file
SSLCertificateKeyFile /usr/local/apache/conf/3_www.domain.com.key
SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
< /VirtualHost>
5. sudo apachectl restart
Restart apache on it
apache2.conf: Apache's main configuration file, including global configuration.
envvars: Apache2 environment variable settings.
ports.conf: Configure the ports that Apache listens to.
mods-available: This directory contains modules and module configuration files. Not all modules have configuration files.
mods-enabled: Holds links to files in the /etc/apache2/mods-available directory. When there is a module file and its configuration file in this directory, the module will take effect after Apache restarts.
sites-available: This directory contains configuration files for Apache virtual hosts. Virtual hosts allow Apache to configure multiple sites and configure different parameters for each site. In the following configuration, http redirection of port 80 will be configured as https of 443.
sites-enabled: Holds links to files in the /etc/apache2/sites-available directory. When Apache restarts, the sites contained in this directory will be activated.
via https://blog.csdn.net/WsXOM853BD45Fm92B0L/article/details/80115863
Recommended Posts