官网下载地址:
https://nginx.org/en/download.html
国内镜像地址:
https://mirrors.huaweicloud.com/nginx
1. 将下载的Nginx安装包上传到Linux服务器指定安装盘符下,解压zip包
tar -zxvf nginx-1.23.3.tar.gz
2. 安装编译文件及库文件
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre-devel
3. 进入到解压后的文件夹下
cd /usr/zenith/nginx-1.23.3
4. 编译安装
- //编译
- ./configure --prefix=/usr/zenith/nginx-1.23.3
- //安装
- make && make install
5. 命令(需要在nigix的sbin文件夹目录下执行)
- #启动
- ./nginx
- #停止
- ./nginx -s stop
- #退出
- ./nginx -s quit
- #重启
- ./nginx -s reload
- ps -ef | grep nginx
- ps -C nginx -o pid
- netstat -anp | grep :80
