The Hottest Porn Videos Online mecum.porn Quality porns videos Free indian porn tube videos indiansexmovies.mobi hot indian women watch online

Tag: Ubuntu

3 Posts

【转】Ubuntu 16.04安装配置Nginx使用Let’s Encrypt
【原文】Ubuntu 16.04安装配置Nginx使用Let's Encrypt Let’s Encrypt是新的认证授权(CA)方式,使用它可以获得免费的TLS/SSL证书-使用HTTPS加密web server。Let’s Encrypt依然在测试阶段,目前,它只支持在Apache web服务器上实现自动安装。但是,Let’s Encrypt允许我们非常容易的获得一个免费的SSL证书,之后我们可以在web服务器上手动配置安装。 本文涉及: 在Ubuntu 16.04上安装Nginx 使用Let’s Encrypt获得免费的SSL证书 配置Nginx使用SSL证书 怎么自动更新SSL证书 安装前提 你必须有一个域名 域名的A记录指向要配置的web服务器 你还要有Ubuntu 16.04的root权限 我使用test.com和www.test.com域名做示例,本文中所有涉及test.com的地方,需要替换为你的域名。 下载Let’s Encrypt客户端 首先使用Let’s Encrypt获得SSL证书,下载letsencrypt。 letsencrypt托管在github,使用git clone下载。 如果没有安装git,安装它: $ sudo apt-get update $ sudo apt-get install git 我把Let’s Encrypt clone到/opt目录: $ sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt 获得SSL证书 如果你没有安装Nginx,安装它: $ sudo apt-get install nginx 配置Nginx: $ sudo vim /etc/nginx/sites-available/default 在server块内添加: location ~ /.well-known { allow all; } /.well-known的用处:Let’s Encrypt服务器要对你的web服务器进行验证,确保是你的域名,你的服务器。 你也可以更改网站根目录,默认是/var/www/html 重新加载Nginx使更改生效: $ sudo systemctl reload nginx 获得SSL证书: $ cd /opt/letsencrypt $ ./letsencrypt-auto certonly -a webroot --webroot-path=/var/www/html -d test.com -d www.test.com 在安装过程中提示输入邮箱,用来恢复密钥 接受协议 如果成功,会输出如下信息: IMPORTANT NOTES: ... - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/test.com/fullchain.pem. Your cert will expire on 2016-06-15. To obtain a new version of the certificate in the future, simply run Let's Encrypt again. ... 注意证书保存路径和过期时间。 如果有错误,注意打开防火墙的80和443端口。 其实证书文件保存在/etc/letsencrypt/archive目录中,/etc/letsencrypt/live/test.com里的证书只是指向/etc/letsencrypt/archive最新证书的链接。获得的证书文件: sudo ls -l /etc/letsencrypt/live/test.com cert.pem: 你域名的证书 chain.pem: Let’s Encrypt chain证书 fullchain.pem: cert.pem 和 chain.pem 合并 privkey.pem: 你的证书密钥 为了增加安全,你应该生成Diffie-Hellman: $ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048 下面你需要配置Nginx使用fullchain.pem做为证书文件,privkey.pem做为密钥。 配置Nginx使用TLS/SSL 现在已经有了SSL证书,下面来配置Nginx使用证书。 编辑Nginx配置文件/etc/nginx/sites-available/default: $ sudo vim /etc/nginx/sites-available/default 找到server块,注释或删除掉以下行: listen 80 default_server; listen [::]:80 default_server; 在server块内添加如下配置代码使用HTTPS: listen…
【转】配置Nginx做Node.js应用的反向代理 (HTTPS)
【原文】配置Nginx做Node.js应用的反向代理 (HTTPS) 安装Node.js 用PPA你可以的到最新版本的node.js 执行如下命令安装PPA curl -sL https://deb.nodesource.com/setup | sudo bash - 安装 node.js: sudo apt-get install nodejs npm 为了使一些npm包正常工作(例如需要从源码构建的包),你需要安装 build-essentials 包: $ sudo apt-get install build-essential 创建一个简单的Node.js应用 更优雅的启动node.js应用:PM2: 管理Node.js应用进程 配置Nginx做为反向代理 安装Nginx 编辑配置文件 sudo vim /etc/nginx/sites-available/default 把文件中的内容替换为: server { listen 80; server_name your_domain.com; location / { proxy_pass http://localhost:8081; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } 重启nginx 添加HTTPS支持(使用免费的Let’s Encrypt) 从github clone源码: sudo apt-get -y install git bc sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt 获得SSL证书: 由于Let’s Encrypt要使用80端口做认证,所以需要暂停Nginx的运行: sudo systemctl stop nginx 获得证书: cd /opt/letsencrypt ./letsencrypt-auto certonly --standalone 根据提示提供你的信息,包括域名、邮箱啥的。 执行成功之后,证书保存到了/etc/letsencrypt/your_domain/ 配置Nginx: sudo vim /etc/nginx/sites-enabled/default 把内容替换为: # HTTP - 把HTTP请求转向到HTTPS: server { listen 80; listen [::]:80 default_server ipv6only=on; return 301 https://$host$request_uri; } # HTTPS - 反向代理 server { listen 443; server_name your_domain.com; ssl on; # Let's Encrypt生成的SSL证书: ssl_certificate /etc/letsencrypt/live/your_domain/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/your_domain/privkey.pem; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; # 把请求转到localhost:8081: location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; proxy_pass http://localhost:8081/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_cache_bypass $http_upgrade; proxy_redirect off; } } 注意替换上面的域名、证书路径等信息。 再次启动nginx 关于Let’s Encrypt证书的更新,看如下帖:…
Install Nginx On Ubuntu 16.04
【原文】How To Install Nginx on Ubuntu 16.04 install nginx Nginx is available in Ubuntu's default repositories, so the installation is rather straight forward. sudo apt-get update sudo apt-get install nginx Adjust the Firewall (use ufw) get a listing of the application profiles sudo ufw app list //Output Available applications: Nginx Full Nginx HTTP Nginx HTTPS OpenSSH enable sudo ufw allow 'Nginx HTTP' verify sudo ufw status Check your Web Server systemctl status nginx Manage the Nginx Process sudo systemctl stop nginx sudo systemctl start nginx sudo systemctl restart nginx //If you are simply making configuration changes, Nginx can often reload without dropping connections. To do this, this command can be used: sudo systemctl reload nginx By default, Nginx is configured to start automatically when the server boots. If this is not what you want, you can disable this behavior by typing: sudo systemctl disable nginx To re-enable the service to start up at boot, you can type: sudo systemctl enable nginx Get Familiar with Important Nginx Files and Directories Content /var/www/html: The actual web content,…