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!

相关推荐
爱潜水的小L几秒前
自学嵌入式day34,ipc进程间通信
linux·运维·服务器
保持低旋律节奏2 分钟前
linux——进程状态
android·linux·php
zhuzewennamoamtf11 分钟前
Linux I2C设备驱动
linux·运维·服务器
zhixingheyi_tian29 分钟前
Linux 之 memory 碎片
linux
邂逅星河浪漫38 分钟前
【域名解析+反向代理】配置与实现(步骤)-SwitchHosts-Nginx
linux·nginx·反向代理·域名解析·switchhosts
梅尔文.古1 小时前
RaspberryPi-如何启用看门狗
linux·运维·服务器
木子欢儿1 小时前
Ubuntu 24 安装 fcitx5 + rime + 雾凇配置
linux·运维·服务器·ubuntu
sg_knight1 小时前
Nuxt 4 生产环境部署指南 (Node.js + Nginx)
运维·nginx·node.js·nuxt·ssr
Alice1 小时前
linux scripts
java·linux·服务器
企微自动化1 小时前
自动化报表生成:将 RPA 采集的群聊数据自动整理为可视化周报
运维·自动化·rpa