I made the VPS server (conoha's centos7) SSL with Let's Encrypt, but I can't change the DocumentRoot from var / www / html. I tried various articles, but I wrote it down because I couldn't read the essence because I didn't understand how Apache works.
centos7 Apache/2.4.6
The SSL port number will be 443, so let's set that in VirtualHost.
etc/httpd/conf/httpd.conf
Listen 80
-------Added below------
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName example.com
DocumentRoot /Document Root of your choice/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem
<Directory /Document Root of your choice/
AllowOverride all
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>
----------------------
#
# Dynamic Shared Object (DSO) Support
Let's add the above code to httpd.conf.
Recommended Posts