网站首页 > 技术教程 正文
阿里云ecs centos7.4 64位;nginx-1.14.0
1、安装gcc,用来编译下载下来的nginx源码
[root@localhost /]# yum install gcc-c++
2、安装pcre和pcre-devel
PCRE(Perl Compatible Regular Expressions) 是一个Perl库,包括 perl 兼容的正则表达式库。nginx 的 http 模块使用 pcre 来解析正则表达式,pcre-devel 是使用 pcre 开发的一个二次开发库。
[root@localhost /]# yum install -y pcre pcre-devel
3、安装zlib,提供了很多压缩和解方式,nginx需要zlib对http进行gzip
[root@localhost /]# yum install -y zlib zlib-devel
4、安装openssl,一个安全套接字层密码库,nginx要支持https,需要使用openssl
[root@localhost /]# yum install -y openssl openssl-devel
5、下载nginx
[root@localhost /]# cd /usr/local
[root@localhost local]# wget http://nginx.org/download/nginx-1.14.0.tar.gz
6、解压nginx
[root@localhost local]# tar -zxvf nginx-1.14.0.tar.gz
7、编绎,设置安装路径为:/usr/local/nginx
[root@localhost local]# cd nginx-1.14.0/
[root@localhost nginx-1.14.0]# ./configure --prefix=/usr/local/nginx
8、安装
[root@localhost nginx-1.14.0]# make && make install
9、启动
[root@localhost nginx-1.14.0]# /usr/local/nginx/sbin/nginx
10、重启
[root@localhost nginx-1.14.0]#/usr/local/nginx/sbin/nginx –s reload
11、停止
[root@localhost nginx-1.14.0]#/usr/local/nginx/sbin/nginx –s stop
12、测试配置文件是否正常:
[root@localhost nginx-1.14.0]#/usr/local/nginx/sbin/nginx –t
13、强制关闭
[root@localhost nginx-1.14.0]#pkill nginx
注:若访问ip出现无法访问,则需要到阿里云控制台中设置安全组规则:登陆阿里云账号,进入控制台-》云服务器ECS-》安全组-》配置规则 点击添加安全组规则按照已有示例添加一组规则,开放80端口即可。如下:
猜你喜欢
- 2024-10-13 unix或centos离线安装jdk和nginx操作说明
- 2024-09-30 CentOS 7 用户怎样安装 LNMP(Nginx+PHP+MySQL)
- 2024-09-30 Nginx安装(Linux nginx安装)
- 2024-09-30 Centos7 安装nginx(Centos7 安装软件)
- 2024-09-30 nginx安装(nginx安装指定路径)
- 2024-09-30 Nginx进阶-如何安装Nginx服务?(nginx怎么安装)
- 2024-09-30 CentOS7如何安装最新版PHP7?Nginx或Apache该如何配置?
- 2024-09-30 如何在 CentOS 8 上安装 Nginx(centos8.2安装)
你 发表评论:
欢迎- 08-06linux 和 windows文件格式互相转换
- 08-06谷歌 ChromeOS 已支持 7z、iso、tar 文件格式
- 08-06Linux下比较文件内容的6种方法
- 08-06文件格式及功能汇总
- 08-0610个Linux文件内容查看命令的实用示例
- 08-06Linux-如何区分不同文件类型
- 08-06Zabbix技术分享——监控windows进程资源使用情况
- 08-06Linux系统卡顿?学会ps命令这三招,轻松定位问题进程
- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)