nginx下载路径 http://nginx.org/en/download.html
版本: nginx-1.12.2 pgp
步骤:
a、解压nginx-1.12.2.tar.gz
tar -zxvf nginx-1.12.2.tar.gz
b、进入nginx-1.12.2目录
[root@jshy190 crxy]# cd nginx-1.12.2 [root@jshy190 nginx-1.12.2]# ls auto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile man objs README src [root@jshy190 nginx-1.12.2]# ./configure checking for OS + Linux 2.6.32-431.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-4) (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 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_REUSEPORT ... found checking for SO_ACCEPTFILTER ... not found checking for SO_BINDANY ... not found checking for IP_BIND_ADDRESS_NO_PORT ... not found checking for IP_TRANSPARENT ... found checking for IP_BINDANY ... not found checking for IP_RECVDSTADDR ... 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 eventfd() ... 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 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 PCRE library ... not found checking for PCRE library in /usr/local/ ... not found checking for PCRE library in /usr/include/pcre/ ... not found checking for PCRE library in /usr/pkg/ ... not found checking for PCRE library in /opt/local/ ... not found ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=option.
发现PCRE 不可用,好吧,遇到这种错误,想到的是没有安装。顺便检查一下是否安装呗。
[root@jshy190 nginx-1.12.2]# rpm -qa pcre pcre-7.8-6.el6.x86_64
尼玛的,居然存在,那就是版本不对咯,卸载的了。继续吧兄弟:
[root@jshy193 nginx-1.12.2]# rpm -e --nodeps pcre [root@jshy193 nginx-1.12.2]# rpm -qa pcre [root@jshy193 nginx-1.12.2]#
卸载完了开始安装pcre了。
[root@jshy193 nginx-1.12.2]# yum -y install pcre-devel Loaded plugins: fastestmirror, refresh-packagekit, security Determining fastest mirrors * base: mirrors.cn99.com * extras: mirrors.163.com * updates: mirrors.cn99.com base | 3.7 kB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 29 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 5.8 MB 00:02 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package pcre-devel.x86_64 0:7.8-7.el6 will be installed --> Processing Dependency: pcre = 7.8-7.el6 for package: pcre-devel-7.8-7.el6.x86_64 --> Processing Dependency: libpcreposix.so.0()(64bit) for package: pcre-devel-7.8-7.el6.x86_64 --> Processing Dependency: libpcrecpp.so.0()(64bit) for package: pcre-devel-7.8-7.el6.x86_64 --> Processing Dependency: libpcre.so.0()(64bit) for package: pcre-devel-7.8-7.el6.x86_64 --> Running transaction check ---> Package pcre.x86_64 0:7.8-7.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================= Package Arch Version Repository Size ============================================================================================================================================================================================= Installing: pcre-devel x86_64 7.8-7.el6 base 320 k Installing for dependencies: pcre x86_64 7.8-7.el6 base 196 k Transaction Summary ============================================================================================================================================================================================= Install 2 Package(s) Total download size: 516 k Installed size: 1.4 M Downloading Packages: (1/2): pcre-7.8-7.el6.x86_64.rpm | 196 kB 00:00 (2/2): pcre-devel-7.8-7.el6.x86_64.rpm | 320 kB 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 1.5 MB/s | 516 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. ** Found 8 pre-existing rpmdb problem(s), 'yum check' output follows: gnote-0.6.3-3.el6.x86_64 has missing requires of libpcre.so.0()(64bit) gnote-0.6.3-3.el6.x86_64 has missing requires of libpcrecpp.so.0()(64bit) grep-2.6.3-4.el6.x86_64 has missing requires of libpcre.so.0()(64bit) httpd-2.2.15-29.el6.centos.x86_64 has missing requires of libpcre.so.0()(64bit) httpd-tools-2.2.15-29.el6.centos.x86_64 has missing requires of libpcre.so.0()(64bit) less-436-10.el6.x86_64 has missing requires of libpcre.so.0()(64bit) 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of libpcre.so.0()(64bit) 2:postfix-2.6.6-2.2.el6_1.x86_64 has missing requires of pcre Installing : pcre-7.8-7.el6.x86_64 1/2 Installing : pcre-devel-7.8-7.el6.x86_64 2/2 Verifying : pcre-7.8-7.el6.x86_64 1/2 Verifying : pcre-devel-7.8-7.el6.x86_64 2/2 Installed: pcre-devel.x86_64 0:7.8-7.el6 Dependency Installed: pcre.x86_64 0:7.8-7.el6 Complete!
这个就把pcre-devel解决了。OK。接下啦继续nginx步骤了。下面
[root@jshy193 nginx-1.12.2]# ./configure [root@jshy193 nginx-1.12.2]# make [root@jshy193 nginx-1.12.2]# make install
运气不错,make操作正常