当前位置:网站首页>利用将网页项目部署到阿里云上(ngnix)
利用将网页项目部署到阿里云上(ngnix)
2022-08-05 05:40:00 【falldeep】
说明
本项目是一个官网展示页面,只包含前端内容。因此部署较为容易,部署于阿里云主机上,采用的ngnix进行部署。总耗时不超1小时。
阿里云设置
1.设置安全组,设置允许http访问,否则后期网站部署上去无法通过http协议获取
在安全组中选择http并添加,我这里为了防止出错,选择了全部。

2.登录阿里云,采用管理员账号登录
输入指令 登录管理员账号
su rootngnix部署
1.输入指令,下载相关的依赖包
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel2、在你的linux服务器上创建目录:install
cd /root
mkdir install3、进入刚刚创建的目录:
cd install4、下载并解压安装包
如果版本不对,上官网使用最新版本
wget http://nginx.org/download/nginx-1.23.1.tar.gz
tar -zxvf nginx-1.23.1.tar.gz ---解压nginx安装包5、进入刚刚解压好的目录:
cd nginx-1.23.16、分别执行下面命令
./configure --- 用来检测安装平台的目标特征
make --- 用来编译( 从Makefile中读取指令,然后编译)
make install --- 用来安装( 从Makefile中读取指令,安装到指定的位置)7、编辑启动端口(图片的端口是经过修改的,默认是80端口无需修改)
此步骤仅适合喜欢自己捣鼓的,如果你的首页名为index.html,则无需修改
cd /usr/local/nginx/conf
vim nginx.conf编辑好之后,按esc退出编辑模式,然后 :wq 进行保存退出
8、启动nginx
cd /usr/local/nginx/sbin
./nginx查看是否启动成功命令:ps -ef | grep nginx
然后通过 ip:端口,就能看到是否启动成功。
9、简单的项目部署(最简单的)
将html文件直接上传到目录:
/usr/local/nginx/html
这是nginx默认的页面路径,直接替换里面的文件就行

10.网页部署成功

边栏推荐
- 超简单的白鹭egret项目添加图片详细教程
- 无法导入torchvision.io.read_image
- VSCode编写OpenCV
- Chengyun Technology was invited to attend the 2022 Alibaba Cloud Partner Conference and won the "Gathering Strength and Going Far" Award
- The size of the screen adaptation
- 盒子模型中过度约束问题及其解决办法
- 七夕!专属于程序员的浪漫表白
- D46_Force applied to rigid body
- LaTeX 图片加标题 文本分栏自动换行
- Seven Ways to Center a Box Horizontally and Vertically
猜你喜欢
随机推荐
盒子模型小练习
网络排错基础-学习笔记
【考研结束第一天,过于空虚,想对自己进行总结一下】
Successful indie developers deal with failure & imposters
NB-IOT智能云家具项目系列实站
Detailed explanation of the construction process of Nacos cluster
Alibaba Cloud Video on Demand
What is Alibaba Cloud Express Beauty Station?
The cocos interview answers you are looking for are all here!
One-arm routing experiment and three-layer switch experiment
文本样式这一篇文章就够了
Tencent Internal Technology: Evolution of Server Architecture of "The Legend of Xuanyuan"
网络协议基础-学习笔记
lingo入门——河北省第三届研究生建模竞赛B题
VLAN is introduced with the experiment
Media query, rem mobile terminal adaptation
LeetCode中常用语言的一些基本方法记录
如何将.asd恢复为Word文档
更改小程序原生radio的颜色及大小
Network Protocol Fundamentals - Study Notes









