VPS侦探论坛

 找回密码
 注册
查看: 5140|回复: 10

请教lnmp1.3移植lnmp1.4 一键部署SSL问题

[复制链接]
发表于 2017-2-21 00:06:43 | 显示全部楼层 |阅读模式

lnmp 1.4可以直接 lnmp ssl add,并自动直接在对应的站点的nginx配置文件里加入配置文件,lnmp1.3则是要手动配置来添加,如果重新完全把1.3删除再部署1.4很麻烦,请问可以做什么操作,把1.4的lnmp ssl add这个自动功能搬来1.3里使用呢?如果可以的话,请把步骤详细点,谢谢!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-2-21 09:22:34 | 显示全部楼层


直接拷贝lnmp1.4/conf/ 下的lnmp文件覆盖/bin/lnmp 应该是可以的,用Letsencrypt的话需要是新添加
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-2-21 13:03:54 | 显示全部楼层

回复 2# 的帖子


我的环境配置的是lnmpa1.3,直接拷贝lnmp1.4/conf/ 下的lnmp文件,然后覆盖lnmp1.3系统/bin/lnmp文件后,重启出现错误:
lnmp restart
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Stoping LNMP...
Stoping nginx...  done
Shutting down MySQL. SUCCESS!
/bin/lnmp: line 35: /etc/init.d/php-fpm: No such file or directory
Starting LNMP...
Starting nginx...  done
Starting MySQL. SUCCESS!
/bin/lnmp: line 27: /etc/init.d/php-fpm: No such file or directory

[ 本帖最后由 cncbm 于 2017-2-21 13:46 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-2-21 14:04:33 | 显示全部楼层



你是lnmpa模式?
lnmpa模式是conf/lnmpa
lamp模式是conf/lamp
不同的模式文件是不一样的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-2-21 14:21:46 | 显示全部楼层

回复 4# 的帖子


我用的是lnmpa1.3
那是要把lnmpa1.4系统下的/root/lnmp1.4/conf/lnmpa这个文件覆盖到lnmpa1.3系统下的/bin下面吗?
我检查了下lnmpa1.3系统下的/bin里面没有lnmpa这个文件。

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2017-2-21 17:04:16 | 显示全部楼层

回复 4# 的帖子


我把1.4的lnmpa文件cp过去更名为lnmp,现在刚才的报错正常,我添加新站点,并申请证书,正常,但发现这个新添加的站点的nginx配置文件里,没有像1.4版本那样,自动在站点的配置文件里添加上SSL的配置信息。
发表于 2017-2-21 20:54:15 | 显示全部楼层

发一下添加过程和生成的配置文件看一下
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-2-21 21:44:35 | 显示全部楼层

回复 7# 的帖子


http://blog.csdn.net/jcjc918/article/details/11022345
我开了台新的服务服务器,centos6.8,重新安装lnmp1.4,python 2.6 升级到 2.7了,添加证书还是会这样。
Complete!
Creating virtual environment...
Installing Python packages...
Installation succeeded.
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Unable to register an account with ACME server
Let's Encrypt SSL Certificate create failed!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-2-21 22:18:26 | 显示全部楼层


lnmp vhost add
+-------------------------------------------+
|    Manager for LNMP, Written by Licess    |
+-------------------------------------------+
|              https://lnmp.org             |
+-------------------------------------------+
Please enter domain(example: www.lnmp.org): aaa.93efdj.com
Your domain: aaa.93efdj.com
Enter more domain name(example: lnmp.org *.lnmp.org):
Please enter the directory for the domain: aaa.93efdj.com
Default directory: /home/wwwroot/aaa.93efdj.com:
Virtual Host Directory: /home/wwwroot/aaa.93efdj.com
Allow access log? (y/n) n
Disable access log.
Please enter Administrator Email Address: a
Server Administrator Email:a
Create database and MySQL user with same name (y/n) n
Create ftp account (y/n) n
Add SSL Certificate (y/n) y
1: Use your own SSL Certificate and Key
2: Use Let's Encrypt to create SSL Certificate and Key
Enter 1 or 2: 2
It will be processed automatically.

Press any key to start create virtul host...

Create Virtul Host directory......
set permissions of Virtual Host directory......
Test Nginx configure file......
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

Reload Nginx......
Test Apache configure file...
test apache configure... Syntax OK
done
Restart Apache...
restart apache...  done
/bin/certbot [found]
Starting create SSL Certificate use Let's Encrypt...
Bootstrapping dependencies for RedHat-based OSes...
yum is /usr/bin/yum
Loaded plugins: security
Setting up Install Process
Package gcc-4.4.7-17.el6.x86_64 already installed and latest version
Package augeas-libs-1.0.0-10.el6.x86_64 already installed and latest version
Package openssl-1.0.1e-48.el6_8.3.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-48.el6_8.3.x86_64 already installed and latest version
Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest version
Package redhat-rpm-config-9.0.3-51.el6.centos.noarch already installed and latest version
Package ca-certificates-2015.2.6-65.0.1.el6_7.noarch already installed and latest version
Package python-2.6.6-66.el6_8.x86_64 already installed and latest version
Package python-devel-2.6.6-66.el6_8.x86_64 already installed and latest version
Package python-virtualenv-1.10.1-1.el6.noarch already installed and latest version
Package python-tools-2.6.6-66.el6_8.x86_64 already installed and latest version
Package python-pip-7.1.0-1.el6.noarch already installed and latest version
Nothing to do
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 2, in <module>
    import virtualenv
ImportError: No module named virtualenv
Let's Encrypt SSL Certificate create failed!
================================================
Virtualhost infomation:
Your domain: aaa.93efdj.com
Home Directory: /home/wwwroot/aaa.93efdj.com
Enable log: no
Create database: no
Create ftp account: no
Enable SSL: yes
  =>Let's Encrypt
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-2-21 22:24:01 | 显示全部楼层



server
    {
        listen 80;
        #listen [::]:80;
        server_name aaa.93efdj.com ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/aaa.93efdj.com;

        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include proxy-pass-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }
发表于 2017-2-22 13:33:49 | 显示全部楼层

回复 10# 的帖子


[quote]Nothing to do
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 2, in <module>
    import virtualenv
ImportError: No module named virtualenv
Let's Encrypt SSL Certificate create failed![/quote[
因为前面letsencrypt没正常生成证书所有就不会生成ssl虚拟主机的配置文件
按 提示是virutalenv没安装上,你用pip手动安装后再试试
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-27 19:16 , Processed in 0.028295 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表