linux环境中,nginx安装过程
需求描述:
记录在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安装过程的更多相关文章
- 【事件中心 Azure Event Hub】在Linux环境中(Ubuntu)安装Logstash的简易步骤及配置连接到Event Hub
在文章([事件中心 Azure Event Hub]使用Logstash消费EventHub中的event时遇见的几种异常(TimeoutException, ReceiverDisconnected ...
- zip格式jdk在Linux环境下的安装过程
1下载jdk [root@localhost opt]# cd soft_bak/[root@localhost soft_bak]# lsjdk1.7.0_25.zip postgresql-9.4 ...
- Linux(CentOS7)下Nginx安装
记录一下 Linux(CentOS7) 下 Nginx 安装过程 一.准备工作 版本说明: Linux版本:CentOS 7 64位 Nginx版本:nginx-1.20.0 1. 下载安装文件 采用 ...
- linux系统中Nginx+FFmPeg+vlc实现网页视频播放配置过程
linux系统中Nginx+FFmPeg实现网页监控视频播放配置过程 1.安装好的nginx上添加模块nginx-http-fiv-module-master 此模块是rtmp模块的升级版,有它所有的 ...
- 全世界最详细的图形化VMware中linux环境下oracle安装(二)【weber出品必属精品】
<ORACLE 10.2.05版本的升级补丁安装> 首先我们解压 $ unzip p8202632_10205_LINUX.zip 解压后我们会发现多出了个文件夹,他是:Disk1,进入D ...
- 全世界最详细的图形化VMware中linux环境下oracle安装(一)【weber出品必属精品】
安装流程:前期准备工作--->安装ORACLE软件--->安装升级补丁--->安装odbc创建数据库--->安装监听器--->安装EM <前期准备工作> 安装 ...
- Linux中Nginx安装与配置详解
转载自:http://www.linuxidc.com/Linux/2016-08/134110.htm Linux中Nginx安装与配置详解(CentOS-6.5:nginx-1.5.0). 1 N ...
- linux环境中安装ftp服务
需求说明: 今天项目中有一个新的需求,需要在linux环境中搭建一个ftp服务,在此记录下. 操作过程: 1.通过yum的方式安装ftp服务对应的软件包 [root@testvm01 ~]# yum ...
- linux中Nginx安装
linux中Nginx安装 编译安装 Nginx的优点太多,这里不再赘述,详情请看这篇博客深入理解nginx. Nginx的安装有rpm包安装.编译安装和docker安装.本文将介绍编译安装方 ...
随机推荐
- MYSQL IO innodb-buffer-pool
http://mysql.taobao.org/monthly/2016/02/02/ MySQL · 性能优化· 5.7.6 InnoDB page flush 优化 MySQL · 性能优化· I ...
- php array_diff分析
前段时间和一个人聊天,聊到怎么用一个方法一次对两个数组取差集,我说使用array_diff倒是可以做到这个,但是不能只用一次,得两次.然后他就开始跟我讲他理解的array_diff的底层原理:“首先p ...
- VBA学习笔记(3)--文件夹操作
说明(2017.3.22): 1. 根据兰色幻想VBA80集视频教学,总结 2. 大部分可以用自带函数处理,不过复制文件夹需要用到FileSystemObject对象,打开文件夹用到shell Pub ...
- iOS使用webView加载HTML网页链接简单展示
//网页视图 _webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 64, mWidth, mHeight-64)]; _webView.d ...
- get_class_vars
个人理解:感觉就是一个将类里的属性值转换为数组的一个东西. <?php class myclass { var $var1; // 此变量没有默认值…… var $var2 = "xy ...
- 通过buildroot 移植 libsocketcan.so 以及 can 工具
进入buildroot make menuconfig Target packages ---> Networking applications ---> [*] can-utils // ...
- 在XP系统下如何访问win10共享的打印机
< > 找到 GUEST 用户,添加即可. 2. Win10 共享本地打印机 右击要共享的打印机,共享选项卡,设置共享名,这个共享很重要,要记住,尽量设置简单点.IP + 共享名就是网络打 ...
- Codeforces 558C Amr and Chemistry 暴力 - -
点击打开链接 Amr and Chemistry time limit per test 1 second memory limit per test 256 megabytes input stan ...
- LINQ操作符二:SelectMany
SelectMany操作符提供了将多个from子句组合起来的功能,相当于数据库中的多表连接查询,它将每个对象的结果合并成单个序列. 示例: student类: using System; using ...
- DataTable的AcceptChanges()和RejectChanges()方法
一.DataTable.AcceptChanges()方法 提交自上次调用AcceptChanges()方法以来对该表进行的所有更改.调用AcceptChanges()时,任何扔处于编辑模式的Data ...