网站首页 > 技术教程 正文
1、下载nginx下载地址(http://nginx.org/en/download.html)
或者直接使用命令下载 wget http://nginx.org/download/nginx-1.20.1.tar.gz
2、解压
tar -zvxf nginx-1.20.1.tar.gz
3、预编译
进入解压后的目录 nginx-1.20.1进行预编译 ./configure --prefix=/opt/nginx 注意:--prefix是指定安装目录(建议指定)
出现错误 ./configure: error: C compiler cc is not found
解决方法:yum -y install gcc gcc-c++
出现错误 ./configure: error: the HTTP gzip module requires the zlib library.
解决方法: yum -y install zlib-devel
这里表示已成功预编译
4、编译
make
出现错误:-bash: make: 未找到命令 (-bash: make: command not found)
解决方法: yum -y install make autoconf
5、安装
make install
安装结束后进入 /opt/nginx/sbin (前面指定安装目录地址/sbin)
[root@ops01 sbin]# pwd
/opt/nginx/sbin
[root@ops01 sbin]# ./nginx
[root@ops01 sbin]# ps -aux|grep nginx
root 7120 0.0 0.0 20572 620 ? Ss 20:17 0:00 nginx: master process ./nginx
nobody 7121 0.0 0.0 21016 1312 ? S 20:17 0:00 nginx: worker process
root 7123 0.0 0.0 112816 980 pts/0 R+ 20:18 0:00 grep --color=auto nginx
然后启动 ./nginx 这条命令成功没有输出
查看启动状态 ps -ef |grep nginx
然后打开浏览器访问
如果出现访问不了,尝试关闭防火墙 systemctl stop firewalld.service 再访问。
永久关闭防火墙 systemctl disable firewalld.service
猜你喜欢
- 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 nginx安装(nginx安装指定路径)
- 2024-09-30 Nginx进阶-如何安装Nginx服务?(nginx怎么安装)
- 2024-09-30 CentOS7如何安装最新版PHP7?Nginx或Apache该如何配置?
- 2024-09-30 如何在 CentOS 8 上安装 Nginx(centos8.2安装)
- 2024-09-30 CentOS安装nginx(Centos安装telnet服务)
你 发表评论:
欢迎- 最近发表
-
- Win10 TH2正式版官方ESD映像转换ISO镜像方法详解
- 使用iso镜像升级到Windows 10的步骤
- macOS Ventura 13.2 (22D49) Boot ISO 原版可引导镜像
- 安利一个用ISO镜像文件制作引导U盘的的小工具RUFUS
- CentOS 7使用ISO镜像配置本地yum源
- 用于x86平台的安卓9.0 ISO镜像发布下载:通吃I/A/N、完全免费
- AlmaLinux 9.6发布:升级工具、初步支持IBM Power虚拟化技术
- Rufus写入工具简洁介绍与教程(写入模式)
- 新硬件也能安装使用了,Edge版Linux Mint 21.3镜像发布
- 开源工程师:Ubuntu应该抛弃32位ISO镜像
- 标签列表
-
- 下划线是什么 (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)
本文暂时没有评论,来添加一个吧(●'◡'●)