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
相关推荐
lolo大魔王6 小时前
Linux 文件系统超全面详解(原理、结构、挂载、分区、inode、日志、管理命令)
linux·运维·服务器
古月方枘Fry9 小时前
MGRE实验
运维·服务器
博客-小覃9 小时前
Zabbix之华为交换机的日志记录信息操作详细教程
服务器·网络·华为·zabbix
stolentime10 小时前
FreeDomain 本地开发环境快速搭建指南
运维·服务器·网络
向量引擎10 小时前
从零起步,如何打造专属向量引擎 API 中转工作流?
java·服务器·前端
z2005093011 小时前
【Linux学习】Linux中的进程程序替换
linux·服务器·学习
lihao lihao12 小时前
软硬链接
linux·运维·服务器
TOWE technology12 小时前
智能安防监控系统如何做好防雷?——视频信号SPD综合应用方案解析
运维·服务器·防雷产品·信号保护·信号防雷·spd
雪度娃娃12 小时前
存储器层次结构——磁盘硬盘存储
服务器·网络·数据库·计算机组成原理
大明者省13 小时前
IIS 端口绑定正常访问的原理说明与常见误区澄清
运维·服务器·笔记