阿里云服务器

lishihuan小于 1 分钟

阿里云服务器

部署服务

部署服务需要开通端口

  • 防火墙放开端口
  • 配置网络安全组

下面以Nginx监听19091端口为例:

检查Nginx服务

ps aux|grep nginx

本地访问检查服务是否正常

curl http://127.0.0.1:19091/

防火墙

firewall-cmd --zone=public --add-port=19091/tcp --permanent
systemctl restart firewalld.service # 重启防火墙(开发端口需要重启防火墙)

检查

netstat -lnt | grep 19091 ##检查端口是否被监听
sudo tail -f /var/log/nginx/error.log ## 检查错误日志

配置安全组

网络安全–>安全组–>配置规则

1. 配置规则

image-20231019123210844
image-20231019123210844

2. 手动添加

类似win的出站入站

image-20231019121558882
image-20231019121558882

下面的待验证

xshell远程连接阿里云服务器

参考:https://blog.csdn.net/m0_69097184/article/details/131735832open in new window

1. 进入阿里云服务器的密钥对open in new window中,生成密钥

12

3
3

创建成功,这里会自动生成一个pem秘钥文件,请保存好!

2.绑定秘钥

45

3. xshell远程连接

6
6