Nginx编译安装
安装前的准备
yum install -y vim lrzsz tree screen psmisc lsof tcpdump wget ntpdate gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel net-tools iotop bc zip unzip zlib-devel bash-completion nfs-utils automake libxml2 libxml2-devel libxslt libxslt-devel perl perl-ExtUtils-Embed
1.1 安装Nginx
官方源码包下载地址:
https://nginx.org/en/download.html
nginx-1.16.1地址:https://nginx.org/download/nginx-1.16.1.tar.gz
[root@localhost@~]->cd /usr/local/src/
[root@localhost@src]->wget https://nginx.org/download/nginx-1.16.1.tar.gz
[root@localhost@src]->tar xvf nginx-1.16.1.tar.gz
[root@localhost@src]->cd nginx-1.16.1
1.2 编译
[root@localhost@nginx-1.16.1]->./configure --prefix=/apps/nginx \ # 选择安装目录
> --user=nginx \ # 选择属主
> --group=nginx \ # 选择属组
> --with-http_ssl_module \ # 选择安装的模组
> --with-http_v2_module \
> --with-http_realip_module \ # 开启转发后,往后端服务器转发用户真实地址
> --with-http_stub_status_module \ # 开启状态页
> --with-http_gzip_static_module \
> --with-pcre \ # 开启正则表达式
> --with-stream \

这篇博客详细介绍了如何在Linux环境下手动编译安装Nginx,从下载官方源码到make&&make install,再到验证版本信息和访问web界面。同时,文中还涉及到创建和验证启动脚本的步骤。
最低0.47元/天 解锁文章
5391

被折叠的 条评论
为什么被折叠?



