1.测试安装nginx
#安装
yum install nginx
#启动
systemctl start nginx
#访问 ip:80查看是否成功
#查看nginx安装位置
whereis nginx
#可以发现安装在 usr/share/nginx
修改html下的index.html
echo "6666" > index.html 发现页面改变。
#配置文件在 /etc/nginx
修改nginx.conf
vi nginx.conf
监听88端口
systemctl restart nginx
curl 127.0.0.1:88
2.安全组设置
入方向 出方向 端口范围88 授权对象0.0.0.0/0
需要把88端口打开才能在外网访问。
3.按量付费的优点
可以随时停止实例 不收费。
如果应用没有设置开机自动启动,需要手动启动。
#开机自启动
systemctl enable nginx
systemctl start nginx
4.私有网络VPC实战
公网IP供外部访问
私有IP内部使用 集群使用私有IP
自己划分网段 和阿里云给的内网ip不能ping通。