阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

在Ubuntu 13.10 下安装支持SSL的Apache

122次阅读
没有评论

共计 4541 个字符,预计需要花费 12 分钟才能阅读完成。

通过这个简短的教程,让我来指导你在 Ubuntu 13.10 下如何安装支持 SSL 的 Apache。以下是我的试验机的详细说明:

系统信息

root@ubuntu-linuxidc:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:b8:b4:87
inet addr:10.1.1.110 Bcast:10.1.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feb8:b487/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1738 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:168845 (168.8 KB) TX bytes:9767 (9.7 KB)

root@ubuntu-linuxidc:~# cat /etc/issue
Ubuntu 13.10 \n \l

安装 Apache

运行如下命令:

$ sudo apt-get install apache2 apache2-doc apache2-utils
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert

apache 测试页面

打开浏览器, 转到 http:// 你的测试机的 IP 地址 /。你应该会看到类似以下的信息。

在 Ubuntu 13.10 下安装支持 SSL 的 Apache

创建目录

创建一个名为 ssl 的目录

$ sudo mkdir /etc/apache2/ssl

更多详情见请继续阅读下一页的精彩内容:http://www.linuxidc.com/Linux/2013-11/92266p2.htm

相关阅读

在 Ubuntu 下为 Apache 增加 SSL 支持  http://www.linuxidc.com/Linux/2011-09/42051.htm

Nginx 配置 SSL 证书部署 HTTPS 网站  http://www.linuxidc.com/Linux/2013-08/88271.htm

Linux 下导入 SSL 证书(配置用于 Apache)  http://www.linuxidc.com/Linux/2013-07/88096.htm

生产环境实用之 LNMP 架构的编译安装 +SSL 加密实现  http://www.linuxidc.com/Linux/2013-05/85099.htm

Nginx 之 SSL 的简单配置与应用  http://www.linuxidc.com/Linux/2013-03/81388.htm

Aapache 2.2 中配置 SSL  http://www.linuxidc.com/Linux/2012-11/74277.htm

Ubuntu 13.10 已经发布了 – 国内镜像站点同步下载 http://www.linuxidc.com/Linux/2013-10/91540.htm

Windows 7 下硬盘安装 Ubuntu 13.10 图文教程 见 http://www.linuxidc.com/Linux/2013-10/91565.htm

Ubuntu 13.10 下载、安装、配置 整理汇总 页面 http://www.linuxidc.com/Linux/2013-10/91564.htm

创建一个自签名凭证

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

Generating a 2048 bit RSA private key……………………………………………………………………………+++………………………………+++writing new private key to ‘/etc/apache2/ssl/apache.key’—–You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.’, the field will be left blank.—–Country Name (2 letter code) [AU]:

开启 Apache SSL 模块

运行以下命令开启 ssl 模块

$ a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl

编辑 /etc/apache2/sites-enabled/default-ssl.conf 文件,

<VirtualHost 10.1.1.110:443>
ServerAdmin webmaster@localhost
ServerName www.linuxidc.com:443

SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

启用 Apache 缺省的 SSL 虚拟主机:

$ a2ensite default-ssl
Enabling site default-ssl.
To activate the new configuration, you need to run:
service apache2 reload

重启 Apache:

$ sudo service apache2 restart

测试 SSL 连接打开浏览器,转到 https:// 你的测试机 IP。

在 Ubuntu 13.10 下安装支持 SSL 的 Apache

安装完成,尽情享用!

更多 Ubuntu 相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

通过这个简短的教程,让我来指导你在 Ubuntu 13.10 下如何安装支持 SSL 的 Apache。以下是我的试验机的详细说明:

系统信息

root@ubuntu-linuxidc:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:b8:b4:87
inet addr:10.1.1.110 Bcast:10.1.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feb8:b487/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1738 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:168845 (168.8 KB) TX bytes:9767 (9.7 KB)

root@ubuntu-linuxidc:~# cat /etc/issue
Ubuntu 13.10 \n \l

安装 Apache

运行如下命令:

$ sudo apt-get install apache2 apache2-doc apache2-utils
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert

apache 测试页面

打开浏览器, 转到 http:// 你的测试机的 IP 地址 /。你应该会看到类似以下的信息。

在 Ubuntu 13.10 下安装支持 SSL 的 Apache

创建目录

创建一个名为 ssl 的目录

$ sudo mkdir /etc/apache2/ssl

更多详情见请继续阅读下一页的精彩内容:http://www.linuxidc.com/Linux/2013-11/92266p2.htm

相关阅读

在 Ubuntu 下为 Apache 增加 SSL 支持  http://www.linuxidc.com/Linux/2011-09/42051.htm

Nginx 配置 SSL 证书部署 HTTPS 网站  http://www.linuxidc.com/Linux/2013-08/88271.htm

Linux 下导入 SSL 证书(配置用于 Apache)  http://www.linuxidc.com/Linux/2013-07/88096.htm

生产环境实用之 LNMP 架构的编译安装 +SSL 加密实现  http://www.linuxidc.com/Linux/2013-05/85099.htm

Nginx 之 SSL 的简单配置与应用  http://www.linuxidc.com/Linux/2013-03/81388.htm

Aapache 2.2 中配置 SSL  http://www.linuxidc.com/Linux/2012-11/74277.htm

Ubuntu 13.10 已经发布了 – 国内镜像站点同步下载 http://www.linuxidc.com/Linux/2013-10/91540.htm

Windows 7 下硬盘安装 Ubuntu 13.10 图文教程 见 http://www.linuxidc.com/Linux/2013-10/91565.htm

Ubuntu 13.10 下载、安装、配置 整理汇总 页面 http://www.linuxidc.com/Linux/2013-10/91564.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计4541字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中