需求描述:

  记录在linux平台,nginx安装的过程.

环境描述:

  操作系统:Red Hat Enterprise Linux Server release 6.6 (Santiago)

  操作内核版本:2.6.32-504.el6.x86_64

  nginx版本:nginx-1.14.0

安装过程:

1.下载nginx的源码包

软件分享(百度云):

https://pan.baidu.com/s/1305ocsP2gHXdLR6PHmhDBA

2.将nginx源码包上传到服务器上

[root@testvm software]# pwd
/opt/software
[root@testvm software]# ls -ltr
total
-rw-r--r--. root root Apr : nginx-1.14..tar.gz

3.创建nginx软件安装路径

mkdir -p /opt/app/nginx

4.解压nginx源码包,并进入解压后的目录

[root@testvm software]# tar -zxf nginx-1.14..tar.gz
[root@testvm software]# ls -l
total
drwxr-xr-x. Apr : nginx-1.14.
-rw-r--r--. root root Apr : nginx-1.14..tar.gz
[root@testvm software]# cd nginx-1.14.
[root@testvm nginx-1.14.]# ls -l
total
drwxr-xr-x. Apr : auto
-rw-r--r--. Apr : CHANGES
-rw-r--r--. Apr : CHANGES.ru
drwxr-xr-x. Apr : conf
-rwxr-xr-x. Apr : configure
drwxr-xr-x. Apr : contrib
drwxr-xr-x. Apr : html
-rw-r--r--. Apr : LICENSE
drwxr-xr-x. Apr : man
-rw-r--r--. Apr : README
drwxr-xr-x. Apr : src

5.安装nginx编译,安装时需要的依赖软件包

  5.1安装开发者工具组"Development tools"

yum groupinstall "Development tools" --assumeyes

  5.2安装zlib,zlib-devel,openssl,openss-devel,pcre,pcre-devel软件包

yum install -y zlib zlib-devel openssl openssl-devel pcre pcre-devel

6.创建nginx用户,用户组

useradd nginx
id nginx

7.进入nginx源码包解压后的目录,配置nginx

./configure --prefix=/opt/app/nginx \
--user=nginx \
--group=nginx \
--sbin-path=/opt/app/nginx/sbin/nginx \
--conf-path=/opt/app/nginx/conf/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--error-log-path=/opt/app/nginx/log/error.log \
--http-log-path=/opt/app/nginx/log/access.log \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-pcre \
--with-file-aio \
--with-http_realip_module \
--without-http_scgi_module \
--without-http_uwsgi_module

备注:配置过程,可以设置不同的组件.

执行过程:

[root@testvm nginx-1.14.0]# ./configure --prefix=/opt/app/nginx \
> --user=nginx \
> --group=nginx \
> --sbin-path=/opt/app/nginx/sbin/nginx \
> --conf-path=/opt/app/nginx/conf/nginx.conf \
> --pid-path=/var/run/nginx.pid \
> --lock-path=/var/run/nginx.lock \
> --error-log-path=/opt/app/nginx/log/error.log \
> --http-log-path=/opt/app/nginx/log/access.log \
> --with-http_gzip_static_module \
> --with-http_stub_status_module \
> --with-http_ssl_module \
> --with-pcre \
> --with-file-aio \
> --with-http_realip_module \
> --without-http_scgi_module \
> --without-http_uwsgi_module
checking for OS
 + Linux 2.6.32-504.el6.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... 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 EPOLLEXCLUSIVE ... not 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 prctl(PR_SET_KEEPCAPS) ... found
checking for capabilities ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... 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 sched_setaffinity() ... found
checking for SO_SETFIB ... not found
checking for SO_REUSEPORT ... found
checking for SO_ACCEPTFILTER ... not found
checking for SO_BINDANY ... not found
checking for IP_TRANSPARENT ... found
checking for IP_BINDANY ... not found
checking for IP_BIND_ADDRESS_NO_PORT ... not found
checking for IP_RECVDSTADDR ... not found
checking for IP_SENDSRCADDR ... not found
checking for IP_PKTINFO ... found
checking for IPV6_RECVPKTINFO ... 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 kqueue AIO support ... not found
checking for Linux AIO support ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint32_t ... found
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 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 ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for pwritev() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for clock_gettime(CLOCK_MONOTONIC) ... not found
checking for clock_gettime(CLOCK_MONOTONIC) in librt ... 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 sysconf(_SC_LEVEL1_DCACHE_LINESIZE) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
checking for PCRE library ... found
checking for PCRE JIT support ... not found
checking for OpenSSL library ... found
checking for zlib library ... found
creating objs/Makefile Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + using system zlib library   nginx path prefix: "/opt/app/nginx"
  nginx binary file: "/opt/app/nginx/sbin/nginx"
  nginx modules path: "/opt/app/nginx/modules"
  nginx configuration prefix: "/opt/app/nginx/conf"
  nginx configuration file: "/opt/app/nginx/conf/nginx.conf"
  nginx pid file: "/var/run/nginx.pid"
  nginx error log file: "/opt/app/nginx/log/error.log"
  nginx http access log file: "/opt/app/nginx/log/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的安装路径,启动用户,配置文件的路径,日志文件路径

8.编译,安装

make
make install

9.安装完成之后,查看nginx目录中内容

[root@testvm nginx]# pwd
/opt/app/nginx
[root@testvm nginx]# ll
total
drwxr-xr-x. root root Apr : conf
drwxr-xr-x. root root Apr : html
drwxr-xr-x. root root Apr : log
drwxr-xr-x. root root Apr : sbin

10.启动nginx,查看启动后的后台进程信息

[root@testvm nginx]# ps -ef | grep nginx
root      4259  1307  0 10:22 pts/0    00:00:00 grep nginx
[root@testvm nginx]# /opt/app/nginx/sbin/nginx -c /opt/app/nginx/conf/nginx.conf
[root@testvm nginx]# ps -ef | grep nginx
root      4261     1  0 10:22 ?        00:00:00 nginx: master process /opt/app/nginx/sbin/nginx -c /opt/app/nginx/conf/nginx.conf
nginx     4262  4261  0 10:22 ?        00:00:00 nginx: worker process                                      
root      4264  1307  0 10:22 pts/0    00:00:00 grep nginx

11.通过浏览器页面进行查看

备注:已经能够通过页面进行访问,nginx安装正确.

文档创建时间:2018年4月24日10:23:57

linux环境中,nginx安装过程的更多相关文章

  1. 【事件中心 Azure Event Hub】在Linux环境中(Ubuntu)安装Logstash的简易步骤及配置连接到Event Hub

    在文章([事件中心 Azure Event Hub]使用Logstash消费EventHub中的event时遇见的几种异常(TimeoutException, ReceiverDisconnected ...

  2. zip格式jdk在Linux环境下的安装过程

    1下载jdk [root@localhost opt]# cd soft_bak/[root@localhost soft_bak]# lsjdk1.7.0_25.zip postgresql-9.4 ...

  3. Linux(CentOS7)下Nginx安装

    记录一下 Linux(CentOS7) 下 Nginx 安装过程 一.准备工作 版本说明: Linux版本:CentOS 7 64位 Nginx版本:nginx-1.20.0 1. 下载安装文件 采用 ...

  4. linux系统中Nginx+FFmPeg+vlc实现网页视频播放配置过程

    linux系统中Nginx+FFmPeg实现网页监控视频播放配置过程 1.安装好的nginx上添加模块nginx-http-fiv-module-master 此模块是rtmp模块的升级版,有它所有的 ...

  5. 全世界最详细的图形化VMware中linux环境下oracle安装(二)【weber出品必属精品】

    <ORACLE 10.2.05版本的升级补丁安装> 首先我们解压 $ unzip p8202632_10205_LINUX.zip 解压后我们会发现多出了个文件夹,他是:Disk1,进入D ...

  6. 全世界最详细的图形化VMware中linux环境下oracle安装(一)【weber出品必属精品】

    安装流程:前期准备工作--->安装ORACLE软件--->安装升级补丁--->安装odbc创建数据库--->安装监听器--->安装EM <前期准备工作> 安装 ...

  7. Linux中Nginx安装与配置详解

    转载自:http://www.linuxidc.com/Linux/2016-08/134110.htm Linux中Nginx安装与配置详解(CentOS-6.5:nginx-1.5.0). 1 N ...

  8. linux环境中安装ftp服务

    需求说明: 今天项目中有一个新的需求,需要在linux环境中搭建一个ftp服务,在此记录下. 操作过程: 1.通过yum的方式安装ftp服务对应的软件包 [root@testvm01 ~]# yum ...

  9. linux中Nginx安装

    linux中Nginx安装 编译安装 ​ Nginx的优点太多,这里不再赘述,详情请看这篇博客深入理解nginx. ​ Nginx的安装有rpm包安装.编译安装和docker安装.本文将介绍编译安装方 ...

随机推荐

  1. ssh-copy-id 安全地复制公钥到远程服务器上

    [root@NB .ssh]# ssh-copy-id -i id_rsa.pub " -p22 root@150.57.38.226" root@150.57.38.226's ...

  2. 将ip地址转换成C段地址的UDF

    将ip地址转换成C段地址的UDF,最重要的是判断IP地址的正则表达式. package cn.cnnic.ops.Study; import java.util.regex.Pattern; impo ...

  3. 解决CentOS中/var目录满的问题

    最近服务器的/var目录总是报警说磁盘满了,查看以后发现主要是/var/log/maillog和/var/spool/mail/root和/var/spool/mqueue目录.从搜索的结果看到应该是 ...

  4. 十倍交叉验证 10-fold cross-validation

          10-fold cross-validation,用来测试算法准确性.是常用的测试方法.将数据集分成十份,轮流将其中9份作为训练数据,1份作为测试数据,进行试验.每次试验都会得出相应的正确 ...

  5. 【Unity笔记】给UGUI元素添加交互性

    如果想给UGUI元素添加交互性,如使一张图片能够被点击,具有normal.Highlighted.Pressed三态,可以给该物体添加组件Selectable. 已经具有交互性的物体不能再添加Sele ...

  6. Cent OS 6.5下安装gcc-5.3.0

    目录: .下载源码包 .安装以前版本的GCC编译器 .文件传输 .熟悉解压命令 .安装流程 .开始安装 .安装必备包之GMP,MPFR,MPC的安装 .继续安装         [1.下载源码包]   ...

  7. [log]利用logrotate对Linux log进行管理

    转自:http://feikiss.iteye.com/blog/1402181 https://linux.cn/article-4126-1.html Syslog-ng服务是Linux系统中重要 ...

  8. Spring Boot 更换 Banner

    Spring 启动时,会有一个Banner图案,这个图案是可以更换的 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ ...

  9. Extjs 弹出下拉Grid

    /** * 系统通用下拉选择Gird */ Ext.define("Common.picker.GridPicker", { extend: "Ext.form.fiel ...

  10. JavaScrip——DOM操作(查找HTML元素/修改元素)

    innerHTML 1.查找元素——document.getElementById("intro") 2.输出查找的结果: (1)var a=document.getElement ...