反向代理是一种服务器配置方式,用来代理和转发客户端的请求到后端服务器上。它可以在负载均衡、缓存、加速、安全性等方面提供帮助。常见的反向代理服务器有 Nginx 和 Apache2。本文将详细讲解如何使用 Nginx 和 Apache2 来配置反向代理,将请求代理到不同的端口或服务器上。
反向代理是一种服务器配置方式,用来代理和转发客户端的请求到后端服务器上。它可以在负载均衡、缓存、加速、安全性等方面提供帮助。常见的反向代理服务器有 Nginx 和 Apache2。本文将详细讲解如何使用 Nginx 和 Apache2 来配置反向代理,将请求代理到不同的端口或服务器上。
Apache 是最流行的 Web 服务器之一,广泛用于托管各种网站和应用。它支持虚拟主机(VirtualHost)功能,可以让你在一台服务器上托管多个域名或站点。本文将分为两部分:
Key_points:
1 | server = smtplib.SMTP(smtp_server, smtp_port) |
1 | server = smtplib.SMTP_SSL(smtp_server, smtp_port) |
代码如下:
1 | import smtplib |
在VSCode中,打开设置,搜索”latex-workshop.latex.recipes”,将 “args” 部分的内容修改为如下:
1 | "name": "latexmk", |
在VSCode中,打开设置,搜索”latex-workshop.latex.autoBuild.run”,将其设置为”onSave”,这样每次保存tex文件时就会自动编译。
在VSCode中,打开设置,搜索”latex-workshop.latex.recipe.default”,将其设置为”lastUsed”,这样第一次编译tex文件手动选择选择编译器,后面就会默认使用该选择了。
Understand folder and path configuration in Jekyll
在使用 Jekyll 构建静态网站时,了解如何配置文件夹和路径对于网站的组织和内容管理至关重要。Jekyll 是一个功能强大的静态网站生成器,具有独特的文件夹结构和处理规则。本文将介绍 Jekyll 如何处理不同的文件夹,以及如何通过配置使网站更灵活。
Use ssh to connect to AWS EC2 instance
cd command to navigate to the directory where your private key file is located.1 | chmod 400 /path/my-key-pair.pem |
ec2-user with the appropriate user name for your AMI.ec2-user. centos. admin. ec2-user or fedora. ec2-user or root. ec2-user or root. ubuntu. Here my OS is Ubuntu.ec2-user and root don’t work, check with your AMI provider.1 | ssh -i /path/my-key-pair.pem user_name@ip_address |
1 | ssh user_name@my-instance-ip |
Permission denied (publickey) error.To fix it.
1 | ssh -i /path/my-key-pair.pem user_name@ip_address |
1 | sudo passwd ubuntu |
1 | sudo vim /etc/ssh/sshd_config |
Find the Line containing PasswordAuthentication parameter and change its value from no to yes.
1 | PasswordAuthentication yes |
If you want to set up root login, find PermitRootLogin parameter and change its value from prohibit-password to yes
1 | PermitRootLogin yes |
After this changes save file and exit.
1 | service ssh restart ## for ubuntu |
1 | chmod 400 /path/my-key-pair.pem |
1 | ssh user_name@my-instance-ip |
Add comments in blog posts on GitHub Pages websites