Lev*_*tna 5 ssl-certificate apache-2.4 ubuntu-14.04
我从 namecheap.com 购买了 SSL 证书。我正在尝试将它安装在运行 Ubuntu 14.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 查看页面,但从 firefox 获取以下错误代码 (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>
Run Code Online (Sandbox Code Playgroud)
$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 22 2014 14:36:38
Run Code Online (Sandbox Code Playgroud)
那么这是你的问题:
<VirtualHost *:433>
Run Code Online (Sandbox Code Playgroud)
将其更改为 443。
归档时间: |
|
查看次数: |
6464 次 |
最近记录: |