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