让apache支持ssl

简介:
apache支持ssl
 
环境:
redhat9
apache2.0.54
 
apache的编译参数
./configure --prefix=/usr/local/apache2 --with-layout=apache --enable-module=so --enable-module=setenvif --enable-module=rewrite --with-mpm=prefork --enable-ssl
 
查看apache编译进的模块
[root@server1 apache2]# bin/httpd -l
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_include.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_ssl.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c
 
查看那系统是否安装了openssl
[root@server1 conf]# rpm -qa|grep openssl
openssl-0.9.7a-2
openssl-devel-0.9.7a-2
 
生成证书文件
创建一个rsa私钥,文件名为server.key
[root@server1 php-5.0.4]# openssl genrsa -out server.key 1024
Generating RSA private key, 1024 bit long modulus
............++++++
............++++++
e is 65537 (0x10001)
 
 server.key 生成证书签署请求 CSR
#openssl req -new -key server.key -out server.csr
Country Name:
两个字母的国家代号

State or Province Name:
省份名称
Locality Name:
城市名称
Organization Name:
公司名称
Organizational Unit Name:
部门名称
Common Name:
你的姓名
Email Address:
地址
至于 'extra' attributes 不用输入
生成 server.csr 文件,并放在安全的地方。
 
生成证书CRT文件server.crt
openssl x509 -days 365 -req -in server.csr -signkey server.key -out server.crt
 
将它们copyapacheconf目录下
为了安全起见,将它们的权限进行修改
chmod 400 server.*
 
查看虚拟主机设置
[root@server1 conf]# ../bin/apachectl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80          dummy-host.example.com (/usr/local/apache22/conf/extra/httpd-vhosts.conf:27)
*:81          dummy-host2.example.com (/usr/local/apache22/conf/extra/httpd-vhosts.conf:36)
_default_:443          [url]www.example.com[/url] (/usr/local/apache22/conf/extra/httpd-ssl.conf:74)
Syntax OK
重启apache
查看443端口是否被监听netstat -an|grep 443
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN
客户端就能使用https来访问了


本文转自yahoon 51CTO博客,原文链接:http://blog.51cto.com/yahoon/37090,如需转载请自行联系原作者
相关文章
|
网络安全 Apache
Apache服务器安装SSL证书
Apache服务器安装SSL证书
483 0
|
安全 应用服务中间件 Linux
Linux上面配置Apache2支持Https(ssl)具体方案实现
虽然Nginx比较流行,但是由于一些老项目用到了Apache2来支持Web服务,最近想给服务上一个Https支持,虽然看似教程简单,但是也遇到一些特殊情况,经历了一番折腾也算是解决了所有问题,将过程记录如下。演示是基于Ubantu系统。
1219 0
|
安全 Linux 网络安全
如何在 CentOS 7 上为 Apache 创建 SSL 证书
如何在 CentOS 7 上为 Apache 创建 SSL 证书
345 0
|
Ubuntu 安全 网络安全
如何在 Ubuntu 14.04 上为 Apache 创建 SSL 证书
如何在 Ubuntu 14.04 上为 Apache 创建 SSL 证书
148 0
|
安全 Unix Linux
如何在 Debian 8 上为 Apache 创建 SSL 证书
如何在 Debian 8 上为 Apache 创建 SSL 证书
176 1
|
应用服务中间件 Linux API
Linux 利用 Cloudflare API 配置 acme.sh 自动续签 SSL (Apache、Nginx适用)
安装acme.sh工具,命令为`curl https://get.acme.sh | sh -s email=你的邮箱`。接着配置Cloudflare API,创建并记录API令牌及Zone ID。最后通过`acme.sh --issue -d 你的域名 --dns dns_cf`签发SSL证书,对于Nginx可使用`acme.sh --install-cert`命令安装证书,并设置自动重载Nginx服务。
|
安全 网络安全 Apache
百度搜索:蓝易云【Apache服务器上安装SSL证书?】
通过按照上述步骤正确安装SSL证书并配置Apache服务器,您的网站将获得HTTPS连接,提供更安全的访问体验。这有助于提高您的网站在百度搜索结果中的排名,并确保用户数据的保护。请记住,在SEO优化方面,确保网站内容的优质和关键词的优化也是至关重要的。
356 0
|
网络安全 Apache Windows
WAMPSERVER 3.0.17集成环境配置SSL进行HTTPS访问apache无法启动遇见的坑
WAMPSERVER 3.0.17集成环境配置SSL进行HTTPS访问apache无法启动遇见的坑
389 0
|
Linux 网络安全 Apache
CentOS7 Apache安装配置SSL证书/https(腾讯云为例)
CentOS7 Apache安装配置SSL证书/https(腾讯云为例)
1255 0
CentOS7 Apache安装配置SSL证书/https(腾讯云为例)
|
网络安全 Apache 数据安全/隐私保护
phpstudy集成下Apache配置SSL证书实现https加密访问
phpstudy集成下Apache配置SSL证书实现https加密访问

热门文章

最新文章

推荐镜像

更多