安装lnmp,搭建wordpress后 ,安装ssl证书出现问题
直接安装lnmp安装包,安装ssl证书出现问题 。之前看教程 不知道有没有把nginx的 nginx.conf搞乱了。不像教程那样打开nginx.conf可以看到:# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem; //这里的pem不知道是什么好像是openssl自己签的。感觉这里的已经配置好了
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
#
}
#}
而我的好像是这样的:
server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name localhost; //这里的localhost本来好像是www.lnmp.org 然后我不知道看了什么然后开成了localhost。
index index.html index.htm index.php;
root/home/wwwroot/default;
#error_page 404 /404.html;
include enable-php.conf;
location /nginx_status
把我给搞蒙了。不知道我有没有看错文件,为什么别人的有
# HTTPS server
#
#server {
而我的却是直接
server
{
另外
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
default_server;不知道有什么用, #listen [::]:80 default_server ipv6only=on;我打开认为是开启ipv6的支持
另外这几行
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
为什么我的nginx.conf没有。
这里更是不能理解
# location / {
# root html;
# index index.html index.htm;
#
}
#}
为什么我的是
index index.html index.htm index.php;
root/home/wwwroot/default;
#error_page 404 /404.html;//这里我大概知道
include enable-php.conf;
location /nginx_status
这里的root/home/wwwroot/default;是设置网站根目录的位置吗 ,如果不是那应该是哪个
地方设置网站根目录位置的 ,之前我知道默认好像是var的www文件夹是。不知道是哪里改的。
因为在沃通申请了个证书。根据他网站的证书安装方法 pdf在线浏览
chrome-extension://ikhdkkncnoglghljlkmcimlnlhkeamad/pdf-viewer/web/viewer.html?file=http%3A%2F%2Fwww.wosign.com%2FDocdownload%2FNginx%2520SSL%25E8%25AF%2581%25E4%25B9%25A6%25E9%2583%25A8%25E7%25BD%25B2%25E6%258C%2587%25E5%258D%2597.pdf
依照教程,我把我的nginx设置成了
nginx文件夹建立了个sslkey文件夹把2个ssl证书文件放在了sslkey文件夹 1_*****.***_bundle.crt 2_******.***.key; //****域名地址
server
{
listen 80 default_server;
listen 443 ssl;
#listen [::]:80 default_server ipv6only=on;
ssl on;
ssl_certificatesslkey/1_*****.***_bundle.crt;
ssl_certificate_key sslkey/2_******.***.key;
ssl_session_timeout5m;
ssl_protocolsSSLv2 SSLv3 TLSv1;
ssl_ciphersALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
server_name localhost;
index index.html index.htm index.php;
root/home/wwwroot/default;
#error_page 404 /404.html;
include enable-php.conf;
location /nginx_status
然后 我接着重启 nginx
出现了这种提示
nginx: BIO_new_file("/usr/local/nginx/conf/sslkey/1_*****.***_bundle.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/sslkey/2_******.us_***.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
failed. Use force-quit
实在无能为力,才来求助贵站。 /usr/local/nginx/conf/enable-ssl-example.conf 是我们提供的ssl的完整虚拟主机的例子,我们不清楚你从哪找的ssl的配置,你发的配置既不是我们网站上的也不是lnmp里带的
SSLv2 SSLv3有安全问题,很早就已经不远了
后面提示
nginx: BIO_new_file("/usr/local/nginx/conf/sslkey/1_*****.***_bundle.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/sslkey/2_******.us_***.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
failed. Use force-quit
上面的都提示no such file了也就是文件不存在
回复 2# 的帖子
请问文件不存在指的是什么文件?key和crt都没放错呀回复 3# 的帖子
错误提示信息里已经给出不存在文件的具体路径信息回复 4# 的帖子
root@SusLinux:/usr/local/nginx/conf# /usr/local/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
root@SusLinux:/usr/local/nginx/conf# /etc/init.d/nginx reload
Reload service nginx... nginx is not running, can't reload.
root@SusLinux:/usr/local/nginx/conf#
root@SusLinux:/usr/local/nginx/conf# kill -HUP 'cat /usr/local/nginx/logs/nginx.pid'
bash: kill: cat /usr/local/nginx/logs/nginx.pid: arguments must be process or job IDs
怎么办 ,在vhost的conf 配置ssl证书
主要增加
listen 443;
ssl on;
ssl_certificate 1.crt;
ssl_certificate_key 2.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
重启nginx提示
Stoping nginx... nginx is not running.
Starting nginx... nginx: listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: listen() to 0.0.0.0:443, backlog 511 failed (98: Address already in use)
nginx: still could not bind()
failed
[ 本帖最后由 susaccount 于 2016-9-11 01:46 编辑 ]
回复 5# 的帖子
有其他应用占用了443端口或者其他虚拟主机配置文件里有 listen的配置是直接以 ip:443形式的
回复 6# 的帖子
已解决 谢谢[ 本帖最后由 susaccount 于 2016-9-11 11:18 编辑 ]
页:
[1]