让我们在Ubuntu上为多个Apache虚拟主机加密证书

问题描述

我有多个域,并且已从一台服务器移到另一台服务器。新服务器已安装带有Apache PHP7.2 sql的Ubuntu 18。

我已经设法为所有站点安装和创建证书,但是由于某些原因,当我打开第二个域时,它会从第一个域中提取证书数据并给我一个错误

这是我正在运行的网页中的网页配置文件

{
  "ElementType": "UxElement","ElementId": null,"StringId": "createaccount_one_link","Override": true,"Value": "Create an account"
}

一个原因是SSL无法正常工作,并且正在从上面的网页中提取证书。

<VirtualHost *:80>
  ServerName cujecen.si
  ServerAlias www.cujecen.si

  Redirect permanent / https://cujecen.si/
</VirtualHost>

<VirtualHost *:443>
  ServerName cujecen.si
  ServerAlias www.cujecen.si
  DocumentRoot /var/www/cujecen.si

  Protocols h2 http:/1.1

  <If "%{HTTP_HOST} == 'www.cujecen.si'">
    Redirect permanent / https://cujecen.si/
  </If>
  
  ErrorLog ${APACHE_LOG_DIR}/cujecen.si-error.log
  CustomLog ${APACHE_LOG_DIR}/cujecen.si-access.log combined

  SSLEngine On
  SSLCertificateFile /etc/letsencrypt/live/cujecen.si/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/cujecen.si/privkey.pem
  SSLOpenSSLConfCmd DHParameters "/etc/ssl/certs/dhparam.pem"
  
  SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
  SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
  SSLCompression off
  SSLUseStapling on

  <Directory /var/www/cujecen.si/>
       Options FollowSymlinks
       AllowOverride All
       Require all granted
  </Directory>
 
  <Directory /var/www/cujecen.si/>
       RewriteEngine on
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*) index.PHP [PT,L]
  </Directory>
</VirtualHost>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)