站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
CentOS/让服务器支持安全HTTP协议
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
==为HTTP服务器配置mod_ssl== [1] 建立服务器密钥 <pre>[root@sample conf]# cd /etc/httpd/conf ← 进入HTTP服务器配置文件所在目录 [root@sample conf]# rm -f ssl.*/server.* ← 删除默认或残留的服务器证书相关文件 [root@sample conf]# make genkey ← 建立服务器密钥 umask 77 ; \ /usr/bin/openssl genrsa -des3 1024 > /etc/httpd/conf/ssl.key/server.key Generating RSA private key, 1024 bit long modulus ................++++++ ....................................................................++++++ e is 65537 (0x10001) Enter pass phrase: ← 在这里输入口令 Verifying - Enter pass phrase: ← 确认口令,再次输入 [root@sample conf]# openssl rsa -in ssl.key/server.key -out ssl.key/server.key ← 从密钥中删除密码(以避免系统启动后被询问口令) Enter pass phrase for ssl.key/server.key: ← 输入口令 writing RSA key </pre> [2] 建立服务器公钥 <pre>[root@sample conf]# make certreq ← 建立服务器密钥 umask 77 ; \ /usr/bin/openssl req -new -key /etc/httpd/conf/ssl.key/server.key -out /etc/httpd/conf/ssl.csr/server.csr You are about to be asked to enter information that will be incorporated into 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 blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [GB]:CN ← 输入国名 State or Province Name (full name) [Berkshire]:Heilongjiang ← 输入省名 Locality Name (eg, city) [Newbury]:Harbin ← 输入城市名 Organization Name (eg, company) [My Company Ltd]:www.centospub.com ← 输入组织名(任意) Organizational Unit Name (eg, section) []: ← 不输入,直接回车 Common Name (eg, your name or your server's hostname) []:www.centospub.com ← 输入通称(任意) Email Address []:yourname@yourserver.com ← 输入电子邮箱地址 Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: ← 不输入,直接回车 An optional company name []: ← 不输入,直接回车</pre> [3] 建立服务器证书 <pre>[root@sample conf]# openssl x509 -in ssl.csr/server.csr -out ssl.crt/server.crt -req -signkey ssl.key/server.key -days 365 ← 建立服务器证书 Signature ok subject=/C=CN/ST=Heilongjiang/L=Harbin/O= www.centospub.com/CN=www.centospub.com/emailAddress=yourname@yourserver.com Getting Private key</pre> [4] 设置[[SSL]] <pre>[root@sample conf]# vi /etc/httpd/conf.d/ssl.conf ← 修改SSL的设置文件 #DocumentRoot "/var/www/html" ← 找到这一行,将行首的“#”去掉 ↓ DocumentRoot "/var/www/html" ← 变为此状态</pre> [5] 重新启动HTTP服务器,让SSL生效 <pre>[root@sample conf]# /etc/rc.d/init.d/httpd restart ← 重新启动HTTP服务器 Stopping httpd: [ OK ] Starting httpd: [ OK ]</pre> [6] 设置[[防火墙]]允许SSL <pre>[root@sample conf]# vi /etc/sysconfig/iptables ← 编辑防火墙配置文件 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT ← 找到这一行,接着添加如下行: -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT ← 开放443号端口,允许SSL [root@sample conf]# /etc/rc.d/init.d/iptables restart ← 重新启动防火墙,使设置生效 Flushing firewall rules: [ OK ] Setting chains to policy ACCEPT: filter [ OK ] Unloading iptables modules: [ OK ] Applying iptables firewall rules: [ OK ]</pre>
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)