当前位置:网站首页>利用将网页项目部署到阿里云上(ngnix)
利用将网页项目部署到阿里云上(ngnix)
2022-08-05 05:40:00 【falldeep】
说明
本项目是一个官网展示页面,只包含前端内容。因此部署较为容易,部署于阿里云主机上,采用的ngnix进行部署。总耗时不超1小时。
阿里云设置
1.设置安全组,设置允许http访问,否则后期网站部署上去无法通过http协议获取
在安全组中选择http并添加,我这里为了防止出错,选择了全部。
2.登录阿里云,采用管理员账号登录
输入指令 登录管理员账号
su root
ngnix部署
1.输入指令,下载相关的依赖包
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
2、在你的linux服务器上创建目录:install
cd /root
mkdir install
3、进入刚刚创建的目录:
cd install
4、下载并解压安装包
如果版本不对,上官网使用最新版本
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.1
6、分别执行下面命令
./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.网页部署成功
边栏推荐
猜你喜欢
DevOps-了解学习
In-depth analysis if according to data authority @datascope (annotation + AOP + dynamic sql splicing) [step by step, with analysis process]
scikit-image image processing notes
Q 2020, the latest senior interview Laya soul, do you know?
Nacos集群搭建
el-progress implements different colors of the progress bar
ev加密视频转换成MP4格式,亲测可用
GetEnumerator method and MoveNext and Reset methods in Unity
Teach you simple steps to achieve industrial raspberries pie properly installed RS232 USB drive
Transformer详细解读与预测实例记录
随机推荐
LaTeX笔记
滚动条问题,未解决
H5开发调试-Fiddler手机抓包
花花省V5淘宝客APP源码无加密社交电商自营商城系统带抖音接口
Media query, rem mobile terminal adaptation
淘宝客APP带自营商城本地生活CPS外卖优惠电影票话费更新渠道跟单生活特权V3
D41_buffer pool
JS控制只能输入数字并且最多允许小数点两位
Next-Generation Parsing Technology - Cloud Parsing
盒子模型小练习
八大排序之堆排序
txt文件英语单词词频统计
The use of three parameters of ref, out, and Params in Unity3D
摆脱极域软件的限制
单片机期末复习大题
超简单的白鹭egret项目添加图片详细教程
Shadowless Cloud Desktop
numpy.random usage documentation
LeetCode中常用语言的一些基本方法记录
wc, grep, tar, vi/vim