免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4245 | 回复: 10
打印 上一主题 下一主题

[Web] apache2.2.X配置CA证书后,怎么样随系统启动而启动? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-16 09:56 |只看该作者 |倒序浏览
如题目。

配置SSL后 #./apachectl start
需要输入密码,怎么样把密码写入/etc/rc2.d/S50apache中呢?  如果大家有更好的方法请“签名”

本人现S50apache内容:
#!/sbin/sh

case    "$1"    in
'start')
                /usr/local/apache2/bin/apachectl start &
                ;;
'stop')
                /usr/local/apache2/bin/apachectl stop &
                ;;
*)
                echo    "your message"
                ;;
esac
exit 0

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
2 [报告]
发表于 2006-10-16 14:38 |只看该作者
openssl genrsa -des3 -out "%CA_NAME%.key" 1024

openssl rsa -noout -text -in "%CA_NAME%.key"

openssl rsa -in "%CA_NAME%.key" -out "%CA_NAME%.key.unsecure"

openssl req -new -x509 -days 365 -key "%CA_NAME%.key" -out "%CA_NAME%.crt"

openssl x509 -noout -text -in "%CA_NAME%.crt"

copy "%CA_NAME%.key" "%CA_NAME%.key.org"

openssl rsa -in "%CA_NAME%.key.org" -out "%CA_NAME%.key"

论坛徽章:
0
3 [报告]
发表于 2006-10-17 08:48 |只看该作者
原帖由 HonestQiao 于 2006-10-16 14:38 发表
openssl genrsa -des3 -out "%CA_NAME%.key" 1024

openssl rsa -noout -text -in "%CA_NAME%.key"

openssl rsa -in "%CA_NAME%.key" -out "%CA_NAME%.key.unsecure&quo ...



以上语句都写入 /etc/rc2.d/S50apache 里面吗?

论坛徽章:
0
4 [报告]
发表于 2006-10-18 16:20 |只看该作者
同上

论坛徽章:
0
5 [报告]
发表于 2006-10-19 08:49 |只看该作者
这个问题因该很多人都会遇见的拉? 教教我!

论坛徽章:
0
6 [报告]
发表于 2006-10-23 09:58 |只看该作者
这个东西老重要的。而且老常用的,没人想知道吗?帮忙顶一下啦

论坛徽章:
0
7 [报告]
发表于 2006-10-25 15:00 |只看该作者
天天问,不信没高人!

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
8 [报告]
发表于 2006-10-26 11:55 |只看该作者

论坛徽章:
0
9 [报告]
发表于 2006-10-27 00:32 |只看该作者
Here is what I did in apache-2.0.59 on Solaris.
Please let me know if it also works on Apache 2.2.x. Thank you.

1. Create a small script that contains the ssl.crt password:

# pwd
/usr/local/apache-2.0.59/bin
# cat ./sslpasswd
#!/bin/sh
echo testpass

#
# chmod 700 ./sslpasswd
# chown root:root ./sslpasswd
#

2. Change a line of ssl.conf file of Apache:

# cp -p ssl.conf ssl.conf.orig
# vi ssl.conf
"ssl.conf" 291 lines, 11590 characters
    68  SSLPassPhraseDialog  exec:/usr/local/apache-2.0.59/bin/sslpasswd
    69  #SSLPassPhraseDialog  builtin

3. Make changes in script /etc/init.d/apache:

# vi apache
...
start|restart)
...
#  $HTTPD -k $ARGV
    $HTTPD -k start -DSSL
...
#

4. Test it from command line.

# /etc/init.d/apache stop
#
# /etc/init.d/apache start
#

[ 本帖最后由 susbin 于 2006-10-27 00:35 编辑 ]

论坛徽章:
0
10 [报告]
发表于 2006-10-27 00:50 |只看该作者
我是这样做的

vi /usr/local/apache2/conf/extra/httpd-ssl.conf
注释SSLPassPhraseDialog  builtin
在后添加
SSLPassPhraseDialog exec:/usr/local/apache2/conf/apache_pass.sh

vi /usr/local/apache2/conf/apache_pass.sh
#!/bin/sh
echo "密码"

chmod +x /usr/local/apache2/conf/apache_pass.sh
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP