心有多大舞台便有多大

Embrace changes, pursue excellence, share niceness.

(转载)apachectl startssl启动apache自动运行输入密码

apachectl startssl启动apache自动运行输入密码

作者:不详 来源: http://www.chinaunix.net(无显示即不详)
  • 核心提示:安装了一台服务器,只开放了https,没有开放http 把启动命令/usr/local/bin/apachectl startssl写到/etc/rc.local里,重启服务器。 发现apache并没有自动运行。 手动运行 [root@localhost]# /usr/local/bin/apachectl restart httpd not running, trying to start Apach.....
安装了一台服务器,只开放了https,没有开放http
把启动命令/usr/local/bin/apachectl startssl写到/etc/rc.local里,重启服务器。
发现apache并没有自动运行。
手动运行
[root@localhost]# /usr/local/bin/apachectl restart
httpd not running, trying to start
Apache/2.2.0 mod_ssl/2.2.0 (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.

Server www.example.com:443 (RSA)
Enter pass phrase:

OK: Pass Phrase Dialog successful.
发现原来是要输入pass phrase的原因

解决方案有2种
1:去掉/usr/local/bin/apachectl startssl启动的pass phrase,用空pass phrase启动apache
(while preserving the original file):
$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key

确认server.key 文件为root可读
$ chmod 400 server.key
参考http://www.chinaunix.net/jh/13/599604.html

2:编辑
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

然后重启apache
[root@localhost conf]# /home/apache2/bin/apachectl start
[root@localhost conf]#

然后从起服务器,就可以运行了

参考http://httpd.apache.org/docs/2.0 ... sslpassphrasedialog

posted on 2008-04-28 09:24 pony 阅读(2732) 评论(3)  编辑  收藏 所属分类: linux

评论

# re: (转载)apachectl startssl启动apache自动运行输入密码 2009-02-19 16:28 pony

一定要记得把apache_pass.sh脚本的+x权限加上  回复  更多评论   

# re: (转载)apachectl startssl启动apache自动运行输入密码[未登录] 2014-02-21 16:43 0

萨顶顶顶顶顶顶顶顶顶顶顶顶  回复  更多评论   

# re: (转载)apachectl startssl启动apache自动运行输入密码[未登录] 2014-02-21 16:43 0

这是我见过最丑的网站了  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航: