这似乎是矛盾的,因为同一个名称“ prominenthair.hr”出现在多个虚拟主机配置文件中:
由于两个文件的内容不同,因此如何将数据构造为一个.conf文件?
000-default-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName prominenthair.hr
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/prominenthair.hr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/prominenthair.hr/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
prominenthair.hr.conf
<VirtualHost *:80>
ServerName prominenthair.hr
Redirect permanent / https://prominenthair.hr/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin mario.orlovac@gmail.com
ServerName prominenthair.hr
ServerAlias www.prominenthair.hr
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www.prominenthair.hr/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.prominenthair.hr/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.prominenthair.hr/chain.pem
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =prominenthair.hr
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
当前:
root @ www:/ etc / apache2 / sites-available#ls
其他信息:
我的原始帖子开始于here。