nginx1.8编译安装


1:操作系统环境如下

[[email protected] ~]# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m
[[email protected] ~]# uname -r
2.6.32-358.el6.x86_64
[[email protected] ~]#

2:nginx软件包版本

[[email protected] src]# ll nginx-1.8.0.tar.gz 
-rw-r--r-- 1 root root 832104 Dec 18 06:49 nginx-1.8.0.tar.gz

nginx1.8源码下载地址

[[email protected] src]# wget http://nginx.org/download/nginx-1.8.0.tar.gz

3:安装nginx

[[email protected] src]# ll nginx-1.8.0.tar.gz 
-rw-r--r-- 1 root root 832104 Dec 18 06:49 nginx-1.8.0.tar.gz
[[email protected] src]# tar fxz nginx-1.8.0.tar.gz
[[email protected] src]# cd nginx-1.8.0
[[email protected] nginx-1.8.0]#./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
[[email protected] nginx-1.8.0]#make
[[email protected] nginx-1.8.0]# make install

创建nginx 启动用户nginx

[[email protected] nginx-1.8.0]# useradd nginx -s /sbin/nologin -M

4:启动nginx

[[email protected] ~]# /usr/local/nginx/sbin/nginx
[[email protected] ~]# lsof -i:80
COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   3250  root   10u  IPv4  15355      0t0  TCP *:http (LISTEN)
nginx   3251 nginx   10u  IPv4  15355      0t0  TCP *:http (LISTEN)

查看nginx版本以及编译参数

[[email protected] ~]# /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.8.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module

5:访问nginx

[

[email protected] ~]# elinks http://127.0.0.1 --dump
                               Welcome to nginx!
   If you see this page, the nginx web server is successfully installed and
   working. Further configuration is required.
   For online documentation and support please refer to [1]nginx.org.
   Commercial support is available at [2]nginx.com.
   Thank you for using nginx.
References
   Visible links
   1. http://nginx.org/
   2. http://nginx.com/

6:nginx总结问题

安装nginx过程会提示缺少相应的依赖包

yum install make gcc -y

安装nginx提示缺少pcre库问题

解决:yum install pcre-devel pcre -y

安装nginx提示openssl问题

解决:yum install openssl-devel openssl -y
启动nginx提示如下:
/usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
解决:
echo “/usr/local/lib” >> /etc/ld.so.conf
ldconfig
时间: 2024-08-25 07:15:10

nginx1.8编译安装的相关文章

Nginx1.10编译安装

企业实战千万PV的Nginx就得这么安装 更多文章请访问 乌龟运维 wuguiyunwei.com 已经上线六个个多月 现在非常稳定 这是现在的整理 Nginx 下载 wget http://nginx.org/download/nginx-1.10.3.tar.gz Openssl 下载 Wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz Pcre 下载 wget ftp://ftp.csx.cam.ac.uk/pub/softw

CentOS6.8编译安装Nginx1.10.2+MySQL5.7.16+PHP7.0.12

1.    下载 #MySQL下载地址 http://dev.mysql.com/downloads/mysql/ #Nginx下载地址 http://nginx.org/en/download.html #PHP下载地址 http://php.net/downloads.php 使用WinSCP把下载好的压缩包上传到/usr/local/src目录 mysql-5.7.16.tar.gz nginx-1.10.2.tar.gz php-7.0.12.tar.gz 2.    安装 2.1   

centos 6.9 编译安装 Nginx1.12.1

centos 6.9 使用yum 安装 Nginx1.12.1 Nginx (engine x) 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器.Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点(俄文:Рамблер)开发的,第一个公开版本0.1.0发布于2004年10月4日. 其将源代码以类BSD许可证的形式发布,因它的稳定性.丰富的功能集.示例配置文件和低系统资源的消耗而闻名.2011年6月1日,nginx 1.0.4发布. Ng

【服务器环境搭建-Centos】Nginx1.9.9 安装(编译源码)

nginx官网不同版本下载地址:http://nginx.org/download/ 我使用的是nginx-1.9.8.tar.gz 安装其他支持软件 可以使用rpm –q xxx   查询库是否已经安装成功 gcc.make工具 rewrite 模块需要 pcre 库 ( 下载: http://www.pcre.org/ ) gzip 模块需要 zlib 库 ( 下载: http://www.zlib.net/ ) ssl 功能需要 openssl 库 ( 下载: http://www.ope

CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3(转)

vi /etc/sysconfig/iptables #编辑防火墙配置文件 # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state

二、Ubuntu下编译安装Nginx1.8.0

    在Ubuntu下搭建LNMP环境.编译安装mysql,nginx,php.最后在LNMP前提下安装composer,并且安装laravel框架.首先,第二步开始编译安装Nginx1.8.0 1.先进入"/usr/local/src"文件夹中,接着键入 "sudo wget http://nginx.org/download/nginx-1.8.0.tar.gz"回车,等待下载完毕.下载完毕后,执行"sudo tar zxvf nginx-1.8.0

CentOS 7.1编译安装Nginx1.8.1+MySQL5.6.19+PHP5.5.14

废话少说,直接部署 一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.se

LNMP编译安装(centos7+nginx1.9+mysql5.6+php5.5)

LNMP编译安装 # 需先配置IP # 软件包的路径 /usr/local/src yum install -y libjpeg-devel libpng-devel freetype-devel curl-devel python-devel curl-devel gcc gcc-c++ bison-devel  ncurses-devel lrzsz openssl-devel libjpeg-devel libpng-devel freetype-devel curl-devel  pyt

centos编译安装php5.6.20+nginx1.8.1+mysql5.6.17

LNMP 代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构. 本次实践需求: 实践centos6.5编译安装 LNMP生产环境 架构 web生产环境 使用 xcache 优化php 作为 Web 服务器:相比 Apache,Nginx 使用更少的资源,支持更多的并发连接,体现更高的效率. 作为负载均衡服务器:Nginx既可以在内部直接支持Rails和PHP,也可以支持作为 HTTP代理服务器对外进行服务.Nginx用C编写,不论是系统资源开销还是CPU使用效率都比Pe