我已经从namecheap.com购买了一个SSL证书。我试图在运行Ubuntu14.04和Apache的服务器上安装它。我使用了下面的教程来设置Apache https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts。服务器有一个仅在HTTP上运行的预先存在的站点。
该站点使用两个子域admin.example.com和api.example.com,因此我购买了通配符证书。
我已经根据证书颁发机构安装了证书,并修改了Apache example.com.conf以添加SSL虚拟主机,我仍然希望非HTTPS页面能够工作,因此我保留了现有的端口80配置,并在下面添加了新的虚拟主机配置。
我重新启动Apache并尝试通过https查看页面,但是从火狐(Error code: ssl_error_rx_record_too_long)获得了以下错误代码
我尝试过这篇文章中提到的修补程序,但没有成功,https://www.digicert.com/ssl-support/apache-fix-common-ssl-errors.htm#SSLRecordLength
我还检查了防火墙是否打开了端口443。
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com api.example.com admin.example.com
DocumentRoot /var/www/example.com/public/
<Directory "/var/www/example.com/public/">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Satisfy all
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
#ErrorLog "/var/www/example.com/protected/runtime/apache-error.log"
#CustomLog "/var/www/example.com/protected/runtime/access.log" common
</VirtualHost>
<VirtualHost *:433>
#SSL certificate
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/STAR.example.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/*.example.com.key
SSLCACertificateFile /etc/apache2/ssl/STAR.example.com.ca-bundle.crt
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com api.example.com admin.example.com
DocumentRoot /var/www/example.com/public/
<Directory "/var/www/example.com/public/">
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Satisfy all
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog "/var/www/example.com/protected/runtime/apache-error.log"
CustomLog "/var/www/example.com/protected/runtime/access.log" combined
</VirtualHost>$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 22 2014 14:36:38发布于 2014-12-28 10:22:43
你的问题是:
<VirtualHost *:433>把它改成443。
https://serverfault.com/questions/655082
复制相似问题