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
相关推荐
QQ2740287562 小时前
Soundness Gitpod 部署教程
linux·运维·服务器·前端·chrome·web3
冼紫菜3 小时前
[特殊字符]CentOS 7.6 安装 JDK 11(适配国内服务器环境)
java·linux·服务器·后端·centos
爱莉希雅&&&5 小时前
shell脚本之条件判断,循环控制,exit详解
linux·运维·服务器·ssh
wei_work@5 小时前
【linux】Web服务—搭建nginx+ssl的加密认证web服务器
linux·服务器·ssl
Sylvan Ding6 小时前
远程主机状态监控-GPU服务器状态监控-深度学习服务器状态监控
运维·服务器·深度学习·监控·远程·gpu状态
慢一点会很快6 小时前
【vscode】解决vscode无法安装远程服务器插件问题,显示正在安装
服务器·ide·vscode
像风一样的男人@7 小时前
Linux --systemctl损坏
linux·运维·服务器
南棱笑笑生7 小时前
20250515测试飞凌的OK3588-C的核心板在Linux R4下适配以太网RTL8211F-CG时跑iperf3的极速
linux·服务器·网络
南方以南_7 小时前
【云实验】搭建个人网盘实验
linux·运维·服务器
Mapleay9 小时前
ubuntu 更新华为源
运维·服务器·ubuntu