Nginx安装

Nginx安装

安装必须依赖

powershell 复制代码
yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

PCRE安装

下载依赖文件

http 复制代码
下载 PCRE 安装包,下载地址: http://downloads.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.gz

解压文件

powershell 复制代码
[root@ebs-135816 opt]# tar -zxvf pcre-8.45.tar.gz 

编译

powershell 复制代码
[root@ebs-135816 pcre-8.45]# ./configure 
[root@ebs-135816 pcre-8.45]# make 
[root@ebs-135816 pcre-8.45]# sudo make install

查看版本

powershell 复制代码
[root@ebs-135816 nginx-1.22.1]# pcre-config --version
8.45
[root@ebs-135816 nginx-1.22.1]# 

Nginx安装

第二步:

下载nginx http://nginx.org/download/nginx-1.6.2.tar.gz

解压

powershell 复制代码
[root@ebs-135816 home]# tar -zxvf nginx-1.22.1.tar.gz 

编译

powershell 复制代码
[root@ebs-135816 home]# cd nginx-1.22.1/
[root@ebs-135816 nginx-1.22.1]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src
[root@ebs-135816 nginx-1.22.1]# ./configure --prefix=/home/nginx-1.22.1 --with-http_stub_status_module --with-http_ssl_module --with-pcre=/opt/pcre-8.45
powershell 复制代码
[root@ebs-135816 nginx-1.22.1]# make 

验证配置

powershell 复制代码
[root@ebs-135816 nginx-1.22.1]# mkdir logs
[root@ebs-135816 nginx-1.22.1]# ./sbin/nginx -t
nginx: the configuration file /home/nginx-1.22.1/conf/nginx.conf syntax is ok
nginx: configuration file /home/nginx-1.22.1/conf/nginx.conf test is successful
[root@ebs-135816 nginx-1.22.1]# 

启动服务

powershell 复制代码
[julong@localhost nginx]$ ./sbin/nginx 
在网页试着访问下http://192.168.1.222:9090/
./sbin/nginx -s reload            # 重新载入配置文件
./sbin/nginx -s reopen            # 重启 Nginx
./sbin/nginx -s stop              # 停止 Nginx
相关推荐
渲染101专业云渲染几秒前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean18 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=20 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
若云止水29 分钟前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_init_cycle 函数 - 详解(4)
数据库·nginx·ubuntu
橘子味的茶二29 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
浪九天4 小时前
Nginx系列05(负载均衡、动静分离)
nginx·运维开发·持续部署
Tisfy4 小时前
LeetCode 1472.设计浏览器历史记录:一个数组完成模拟,单次操作均O(1)
服务器·leetcode·浏览器·memcached·题解·模拟·数组
wanhengidc8 小时前
单线服务器和双线服务器分别是指什么?
运维·服务器