首页 / LINUX / 安装Nginx到Linux(源码)
安装Nginx到Linux(源码)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了安装Nginx到Linux(源码),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1825字,纯文字阅读大概需要3分钟。
内容图文
运行环境
系统版本:无
软件版本:无
硬件要求:无
安装过程
NGINX官方提供源码包的下载,NGINX有两个版本Mainline(主线)版和Stable(稳定)版。主线版本我们可以理解为是开发版本,在生产环境中建议使用稳定版本。
源码安装适用于所有Linux操作系统。
NGINX官方下载地址:http://nginx.org/en/download.html。
1、下载软件包
[root@localhost ~]# wget http://nginx.org/download/nginx-1.14.0.tar.gz
2、解压软件包
[root@localhost ~]# tar xzvf nginx-1.14.0.tar.gz
[root@localhost ~]# ls
nginx-1.14.0 nginx-1.14.0.tar.gz
3、安装相关依赖
[root@localhost ~]# yum -y install gcc gcc-c++ autoconf automake pcre pcre-devel zlib zlib-devel openssl openssl-devel gd-devel
4、配置、编译并安装
[root@localhost ~]# cd nginx-1.14.0
[root@localhost nginx-1.14.0]# ./configure --prefix=/usr/local/nginx/ --with-threads --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module=dynamic --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_slice_module --with-http_stub_status_module --with-stream=dynamic --with-compat
[root@localhost nginx-1.14.0]# make -j4 && make install
5、配置环境变量
配置环境变量,使Nginx命令在全局使用。
[root@localhost sbin]# vim /etc/profile
export NGINX_PATH=/usr/local/nginx/sbin
export PATH=$PATH:$NGINX_PATH
[root@localhost sbin]# source /etc/profile
6、查看NGINX的版本及编译选项
[root@localhost conf]# nginx -V
nginx version: nginx/1.14.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx/ --with-threads --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module=dynamic --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_slice_module --with-http_stub_status_module --with-stream=dynamic --with-compat
原文:https://www.cnblogs.com/network-ren/p/12377764.html
内容总结
以上是互联网集市为您收集整理的安装Nginx到Linux(源码)全部内容,希望文章能够帮你解决安装Nginx到Linux(源码)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。