Linux安装Nginx详细步骤

文章目录

本期教程分享在Linux上安装 Nginx。

本教程中Linux版本为RedHat6.5,Nginx版本为1.13.12,教程中使用到的安装包和依赖都放到网盘了,在公众号【IT学长】回复关键词nginx安装包自行下载。

1、服务器上传安装包以及依赖文件:

linux_dependencies_rpm

pcre-8.10.tar.gz

openssl-1.0.1e.tar.gz

zlib-1.2.5.zip

nginx-1.13.12.tar.gz

powershell 复制代码
cd /root

#新建 nginx 目录,用于存放安装包和其它依赖文件
mkdir nginx

上传安装包和依赖文件到 /root/nginx 目录下
2、安装依赖rpm
powershell 复制代码
cd  /root/nginx/linux_dependencies_rpm

rpm -ivh --force --nodeps *.rpm
3、安装pcre
powershell 复制代码
cd /root/nginx

tar -zxvf pcre-8.10.tar.gz

cd pcre-8.10

./configure --prefix=/usr/local/pcre

make

make install
4、安装openssl
powershell 复制代码
cd /root/nginx

tar -zxvf openssl-1.0.1e.tar.gz

cd openssl-1.0.1e

./config --prefix=/usr/local/openssl 

make

make install  #如果有报错可以忽略
5、安装zlib
powershell 复制代码
cd /root/nginx

unzip zlib-1.2.5.zip

cd zlib-1.2.5

chmod +x configure

./configure --prefix=/usr/local/zlib

make

make install
6、安装nginx
powershell 复制代码
cd /root/nginx

tar -zxvf nginx-1.13.12.tar.gz

mv nginx-1.13.12 nginx

cd nginx

./configure 

--prefix=/usr/local/nginx 

--with-http_stub_status_module 

--with-http_ssl_module 

--with-http_sub_module 

--without-http_limit_req_module

--without-http_mirror_module

--with-pcre=/root/nginx/pcre-8.10 

--with-openssl=/root/nginx/openssl-1.0.1e 

--with-zlib=/root/nginx/zlib-1.2.5 

--with-stream

make

make install

#启动nginx:

cd /usr/local/nginx

cd sbin

./nginx

ps -ef | grep nginx

本期教程就分享到这里,关注【IT学长】跟着学长学IT!

相关推荐
江湖有缘11 分钟前
Docker实战 :使用Docker部署OneTerm堡垒机
运维·docker·容器
泡沫冰@14 分钟前
ECS 的介绍和使用
linux·服务器·网络
姜太小白39 分钟前
【Linux】df -h 卡住问题的通用排查与解决方案总结
linux·运维·php
土星云SaturnCloud1 小时前
抽水蓄能设备智慧运营:基于土星云边缘计算实现机组全生命周期预测性维护
服务器·人工智能·ai·边缘计算
fengyehongWorld1 小时前
Linux 终端快捷键
linux·运维
hyf3266332 小时前
泛程序:从零开始搭建稳定程序项目框架
运维·服务器·爬虫·百度·seo
哎呦喂我去去去2 小时前
C#实现屏幕墙:同时监控多个电脑桌面(支持Windows、信创Linux、银河麒麟、统信UOS)
linux·windows·c#
为自己_带盐2 小时前
安敢越雷池一步?浅尝雷池WAF社区版
运维·web安全
NiceCloud喜云3 小时前
海外云服务器怎么选?适用场景、价格和避坑经验总结
运维·服务器
easy_coder3 小时前
Linux LVM 知识文档
linux·运维