首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >尝试在Ubuntu14.04上安装带有Apache的SSL

尝试在Ubuntu14.04上安装带有Apache的SSL
EN

Server Fault用户
提问于 2014-12-28 10:20:28
回答 1查看 6.5K关注 0票数 5

我已经从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。

Apache Config

代码语言:javascript
运行
复制
<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>

Apache详细信息

代码语言:javascript
运行
复制
$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Jul 22 2014 14:36:38
EN

回答 1

Server Fault用户

回答已采纳

发布于 2014-12-28 10:22:43

你的问题是:

代码语言:javascript
运行
复制
<VirtualHost *:433>

把它改成443。

票数 6
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/655082

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档