ubuntu 是自带python2.7的,如果要使用python3.x,可以直接安装对应的版本,千万不要卸载以前的版本,因为其他库的运行需要借助python2.7

让linux 在tab时对大小写不敏感

bind "set completion-ignore-case on"

 

1. 安装python3.5

sudo apt-get install python3.5

2. 安装pip3.5

sudo apt-get install python3-pip

安装后到目录/usr/local/lib/

3. 安装nginx

sudo apt-get install nginx

nginx -h #帮助  

nginx -v #显示版本  

nginx -V #显示版本和配置信息  

nginx -t #测试配置  

nginx -q #测试配置时,只输出错误信息  

nginx -s stop #停止服务器  

nginx -s reload #重新加载配置  

4. 配置https

生成证书

可以通过以下步骤生成一个简单的证书:
首先,进入你想创建证书和私钥的目录,例如:

cd /etc/nginx/ssl.conf

 

创建服务器私钥,命令会让你输入一个口令:

openssl genrsa -des3 -out server.key 1024

 

创建签名请求的证书(CSR):

openssl req -new -key server.key -out server.csr

 

在加载SSL支持的Nginx并使用上述私钥时除去必须的口令:

cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

 

配置nginx

最后标记证书使用上述私钥和CSR:

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

 

修改Nginx配置文件,让其包含新标记的证书和私钥:

server {
    server_name YOUR_DOMAINNAME_HERE;
    listen 443;
    ssl on;
    ssl_certificate /usr/local/nginx/conf/server.crt;
    ssl_certificate_key /usr/local/nginx/conf/server.key;
}

 

 

版权声明:本文为Purk原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Purk/p/6907353.html