需求描述:

  记录在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. linux命令(33):less

    一.less指令 less 工具也是对文件或其它输出进行分页显示的工具,应该说是linux正统查看文件内容的工具,功能极其强大.less 的用法比起 more 更加的有弹性. 在 more 的时候,我 ...

  2. 【Maven】maven打包生成可执行jar文件

    http://blog.csdn.net/u013177446/article/details/53944424 ******************************************* ...

  3. Datax将本地文件导入Hbase数据库!!!酷酷酷

    Hbase Writer的json文件链接: https://github.com/alibaba/DataX/blob/master/hbase11xwriter/doc/hbase11xwrite ...

  4. Markdown 11种基本语法【转】

    [转自:http://www.cnblogs.com/hnrainll/p/3514637.html] 1. 标题设置(让字体变大,和word的标题意思一样)在Markdown当中设置标题,有两种方式 ...

  5. 基于jQuery图像碎片切换效果插件FragmentFly

    基于jQuery图像碎片切换效果插件FragmentFly.这是一款只需三步轻松完成碎片动画,参数可调,使用方便. 在线预览   源码下载 部分代码: <div class="all_ ...

  6. Servlet入门(第一个Servlet的Web程序)

    新建maven项目,注意项目的类型 project名为ServletExample 点击Finish.建立maven项目完毕例如以下 生成后的文件夹没有java源代码文件夹.依照maven的约定,还要 ...

  7. C#怎么做系统托盘

    建个WinForm项目,其它操作略过.拉个NotifyIcon控件,将属性Visable设置成False没有Icon图标 还要加 Icon图用Form的SizeChanged事件,代码如下:窗口最小 ...

  8. Hadoop的体系结构之HDFS的体系结构

    Hadoop的体系结构 Hadoop不仅是一个用于分布式存储的分布式文件系统,而是设计用来在由通用计算设备组成的大型集群上执行分布式应用的框架. HDFS和MapReduce是Hadoop中的两个最基 ...

  9. JavaScrip——练习(求整数和、求整数积)

    用HTML和JSp来实现 1.HTML调用JSp语法:<script type="text/javascript" src="整数和jsp.js"> ...

  10. BusyBox telnet配置

    1.  busybox配置telnet相关命令. 2.  devpts文件系统,是目前最常见的pseudo终端,使用telnetd服务器,必须加载该文件系统. 在/dev目录下创建一个pts目录,用来 ...