安装nginx版本为1.7.5

一。下载nginx

官方地址:http://www.nginx.org/

下载地址:http://nginx.org/download/

Nginx官网提供了三个类型的版本

  1. Mainline version:Mainline 是 Nginx 目前主力在做的版本,可以说是开发版
  2. Stable version:最新稳定版,生产环境上建议使用的版本
  3. Legacy versions:遗留的老版本的稳定版

选择nginx-1.7.5

  将该下载包拷贝到/alidata/tools/下(随意了,找个地方就好,我的/alidata 是挂载进来的大盘,所以我习惯放这里)

cd /alidata/tools/
wget -c http://nginx.org/download/nginx-1.7.5.tar.gz

二。安装

tar zxvf nginx-1.7..tar.gz
cd nginx-1.7.

按照一些网络资料的介绍,执行如下命令即可完成安装

./configure

make

make install

  设置一下配置信息 ./configure --prefix=/alidata/server/nginx-1.7.5 ,或者不执行此步,直接默认配置

但在实际安装过程中会,执行./configure时,根据系统的配置不同会有不同的错误提示,这里不罗嗦了,安装nginx需要安装openssl和 pcre,

  一般而言 OpenSSL 一般机子自己已经安装过了,下面我们看看pcre 的安装

下载pcre:http://sourceforge.net/projects/pcre/files/ ,选择pcre-8.35.tar.gz,拷贝到/alidata/tools/下并解压

下载OpenSSL :http://www.openssl.org/source/ ,选择openssl-1.0.1i.tar.gz,拷贝到/alidata/tools/下并解压

接着我们安装nginx,

cd /alidata/tools/nginx-1.7.

./configure --prefix=/alidata/server/nginx-1.7. --with-pcre=/alidata/tools/pcre-8.35 --with-http_ssl_module --with-openssl=/usr/bin/openssl

注意: 这里的 OpenSSL 和 pcre 都必须是源码, 不能是编译后的路径

ok,nginx安装完成。

  启动 nginx:

/alidata/server/nginx-1.7./sbin/nginx -c /alidata/server/nginx-1.7./conf/nginx.conf

接着访问这台机器的80的端口,如果请求成功,则说明配置成功

为了操作方便,可以自己写一个nginx命令脚本,放到/etc/init.d下,并赋予其执行权限即可,详见附件,执行方法如下:

启动:service nginx start

停止:service nginx stop

重启:service nginx reconfigure

查看状态:service nginx status

debug 1:

[root@iZ23lt92evyZ ~]# cd /alidata/server/
[root@iZ23lt92evyZ server]# wget -c http://nginx.org/download/nginx-1.7.5.tar.gz
---- ::-- http://nginx.org/download/nginx-1.7.5.tar.gz
Resolving nginx.org... 206.251.255.63
Connecting to nginx.org|206.251.255.63|:... connected.
HTTP request sent, awaiting response... OK
Length: (798K) [application/octet-stream]
Saving to: 鈥渘ginx-1.7..tar.gz鈥 %[======================================>] , 195K/s in .2s -- :: ( KB/s) - 鈥渘ginx-1.7..tar.gz鈥saved [/] [root@iZ23lt92evyZ server]#

debug 2:

[root@iZ23lt92evyZ nginx-1.7.]# ./configure --prefix=/alidata/server/nginx-1.7. --with-pcre=/alidata/tools/pcre-8.35 --with-http_ssl_module --with-openssl=/alidata/tools/openssl-1.0.1i
checking for OS
+ Linux 2.6.-431.20..el6.x86_64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.4. (Red Hat 4.4.-) (GCC)
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for O_PATH ... not found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... not found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for int size ... bytes
checking for long size ... bytes
checking for long long size ... bytes
checking for void * size ... bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... bytes
checking for off_t size ... bytes
checking for time_t size ... bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for zlib library ... found
creating objs/Makefile Configuration summary
+ using PCRE library: /alidata/tools/pcre-8.35
+ using OpenSSL library: /alidata/tools/openssl-1.0.1i
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library nginx path prefix: "/alidata/server/nginx-1.7.5"
nginx binary file: "/alidata/server/nginx-1.7.5/sbin/nginx"
nginx configuration prefix: "/alidata/server/nginx-1.7.5/conf"
nginx configuration file: "/alidata/server/nginx-1.7.5/conf/nginx.conf"
nginx pid file: "/alidata/server/nginx-1.7.5/logs/nginx.pid"
nginx error log file: "/alidata/server/nginx-1.7.5/logs/error.log"
nginx http access log file: "/alidata/server/nginx-1.7.5/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"

linux 下安装 nginx的更多相关文章

  1. 【云服务器部署】---Linux下安装nginx

    [云服务器部署]---Linux下安装nginx 之前两篇,分别讲了:Linux下安装MySQL  和  springboot项目部署云服务器 nginx安装也是挺简单的.具体步骤如下: 第一步,下载 ...

  2. linux下安装nginx及初步认识

    linux下安装配置nginx nginx:是一个高性能的反向代理服务器正向代理代理的是客户端,反向代理代理的是服务端. 这里以nginx-1.12.2版本为例子 1.首先去官网下载nginx-1.1 ...

  3. linux 下 安装nginx及压力测试

    linux 编译安装nginx,配置自启动脚本 下载nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz下载openssl : wget h ...

  4. Linux下安装Nginx并配置一个图片服务器

    首先安装nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没 ...

  5. linux下安装nginx和配置

    1.系统:centos6.8 2.安装准备: 安装nginx前,我们首先要确保系统安装了g++.gcc.openssl-devel.pcre-devel和zlib-devel软件,可通过如图所示命令进 ...

  6. linux下安装nginx+php+mysql环境 详细教程

    话不多说上代码 linux环境:centos 7.0 64位 nginx:nginx-1.8.0.tar.gz php: php-7.1.1.tar.gz mysql: mysql-5.6.21.ta ...

  7. Linux下安装Nginx服务器

    安装Nginx之前,首先要安装好编译环境gcc和g++,然后以CentOS为例安装Nginx,安装Nginx需要PRCE库.zlib库和ssl的支持,除了ssl外其他的我们都是去官网下载: Nginx ...

  8. Linux下安装Nginx详细图解教程

    什么是Nginx? Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器,在高连接并发的情况下N ...

  9. linux下安装nginx、pcre、zlib、openssl

    1.安装nginx之前需要安装PCRE库的安装  最新下载地址   ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ tar –zxvf p ...

随机推荐

  1. android APP是否需要缓存?+简单架构

    问题的由来 昨天,当我写完我的第一篇博客之后,我便百无聊赖的玩起了手机!当我打开Google自带的一些app的时候,发现他们直接叫我连接网络,并没有缓存上次从网络获取的数据.这就让我感到很奇怪!于是我 ...

  2. SQL循环

    加群学习:457351423 这里有4000多部学习视频,有需要的欢迎进群学习! declare @temp Table ( nf varchar(50), yf varchar(50), sm va ...

  3. INSERT IGNORE 与 INSERT INTO的区别

    例 insert ignore表示,如果中已经存在相同的记录,则忽略当前新数据: insert ignore into table(name)  select  name from table2 例 ...

  4. 【SNMP】SNMP概述

    SNMP概述 SNMP(Simple Network Management Protocol,简单网络管理协议)是目前UDP/IP网络中应用最为广泛的网络管理协议,它提供了一个管理框架来监控和维护互联 ...

  5. 对索引像素格式的图片进行Setpixel(具有索引像素格式的图像不支持SetPixel)解决方案

    最近编写了一个验证码识别软件.其中对png.jpg图片进行二值化处理时,出现了错误:具有索引像素格式的图像不支持SetPixel解决方案.从字面上来看,这说明我对一个具有索引色的图片进行了直接RGB颜 ...

  6. BeanDefinition的Resource定位——3

    1.我们重点看看AbstractRefreshableApplicationContext的refreshBeanFactory方法的实现,这个refreshBeanFactory被FileSyste ...

  7. 杭电ACM2076--夹角有多大(题目已修改,注意读题)

    杭电ACM2076--夹角有多大(题目已修改,注意读题) http://acm.hdu.edu.cn/showproblem.php?pid=2076 思路很简单.直接贴代码.过程分析有点耗时间. / ...

  8. css解决IE6、Chrome、ff 浏览器position:fixed;和闪动问题

    首先说下开发模式,刚刚开始接触,基本沿用web端开发方式,目前开发模式上没有找到的适合的,现在基本这样:1,电脑nginx配置服务器3,电脑和手机连同一个局域网,2,android root 和 ip ...

  9. 文件墙 CFilewall

    文件墙 CFilewall 记于 2013-09-26 == @[代码] [C#] []WPF] #### 使用了一些公司的组件和放大,但是不多,可以单独抽取出来 --- 程序结构 - Control ...

  10. Android listview viewpager解决冲突 滑动

    Android listview viewpager滑动 跳动 冲突解决 ListView中嵌套ViewPage有或者滑动手势冲突解决   在listview 上使用 addHeaderView 在第 ...