服务器相关指令
开通阿里ECS,请先设置安全组规则
https://blog.csdn.net/sinat_25957705/article/details/80641077
一、登录
ssh root@你的公网IP
//ssh user@host
//$ ssh -p 2222 user@host
SSH的默认端口是22。使用p参数,可以修改这个端口。
退出:Control+d
scp E:\金融数据\basic-trading-data.20230217.zip root@139.224.12.84:/root/stock/
二、nginx
安装nginx
yum -y install nginx
systemctl start nginx.service //启动服务
nginx查看配置文件是否正确 查看nginx.conf路径
首先执行命令找到nginx路径
ps aux | grep nginx
如nginx路径为
/usr/local/nginx/sbin/nginx
contos 下面查看 nginx配置是否OK
/usr/local/nginx/sbin/nginx -t
nginx是否运行正常
netstat -anput | grep nginx
Nginx 相关介绍(Nginx是什么?能干嘛?)
https://blog.csdn.net/zyhlearnjava/article/details/71908529
三 iptables 防火墙
关闭 firewalld
关闭 firewalld 服务:systemctl stop firewalld
禁用 firewalld 服务:systemctl disable firewalld
开启 iptables
安装 iptables:yum -y install iptables-services
启用 iptables:systemctl enable iptables
开启 iptables:systemctl start iptables
#vi /etc/sysconfig/iptables
Centos7默认的防火墙是firewalld防火墙,不是使用iptables,因此需要先关闭firewalld服务,或者干脆使用默认的firewalld防火墙
https://blog.csdn.net/chocolee911/article/details/80688200
http://www.zsythink.net/archives/1199
四 Hexo
对于 Hexo 来说,每次使用hexo g生成好的静态站点内容,都生成在hexo/public目录下。
为了部署网站,我们需要将hexo/public目录的内容拷贝到 Nginx 的html目录下。
ECS 上 Nginx 的html目录是/usr/share/nginx/html。
将hexo/public cp到 /usr/share/nginx/htm/public,并修改 Nginx 的location配置:
location / { root html/public; index index.html; }
修改好之后,重启nginx服务;
nginx -s reload
六 VPN
1.安装 ppp pptpd iptables
ppp 数据链路层协议
pptpd VPN服务类型之一
iptables 防火墙,用来消息转发 (CentOS 7不用装)
yum install ppp pptpd iptables
https://blog.csdn.net/rock_joker/article/details/72722137
https://blog.csdn.net/Dreamweav2004/article/details/82458398
https://yq.aliyun.com/ziliao/27444
七 netstat
端口是否正常打开
使用netstat命令查看端口状况:
netstat -an |grep 端口号
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!