Apache 是最流行的 Web 服务器之一,广泛用于托管各种网站和应用。它支持虚拟主机(VirtualHost)功能,可以让你在一台服务器上托管多个域名或站点。本文将分为两部分:
- 如何配置 Apache 虚拟主机。
- 如何排查和修复常见的配置错误。
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 |
When you are using Git, you may encounter some problems. Here are some useful commands to help you solve them.
1 | error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 |
You can set the postBuffer size to 500MB:
1 | git config http.postBuffer 524288000 |
Add dark mode to your website using DarkReader. This is a simple way to add dark mode to your website.
Add comments in blog posts on GitHub Pages websites