编译nginx报错SSL modules require the OpenSSL library.You can either do not enable the modules解决办法

sh ./configure --prefix=/opt/openresty/nginx \
  --with-cc-opt='-O2' \
  --add-module=../ngx_devel_kit-0.3.1 \
  --add-module=../echo-nginx-module-0.62 \
  --add-module=../xss-nginx-module-0.06 \
  --add-module=../ngx_coolkit-0.2 \
  --add-module=../set-misc-nginx-module-0.32 \
  --add-module=../form-input-nginx-module-0.12 \
  --add-module=../encrypted-session-nginx-module-0.08 \
  --add-module=../srcache-nginx-module-0.32 \
  --add-module=../ngx_lua-0.10.20 \
  --add-module=../ngx_lua_upstream-0.07 \
  --add-module=../headers-more-nginx-module-0.33 \
  --add-module=../array-var-nginx-module-0.05 \
  --add-module=../memc-nginx-module-0.19 \
  --add-module=../redis2-nginx-module-0.15 \
  --add-module=../redis-nginx-module-0.3.7 \
  --add-module=../rds-json-nginx-module-0.15 \
  --add-module=../rds-csv-nginx-module-0.09 \
  --add-module=../ngx_stream_lua-0.0.10 \
  --with-ld-opt='-Wl,-rpath,/opt/openresty/luajit/lib' \
  --with-http_stub_status_module --with-http_realip_module --with-http_v2_module --with-http_reqstat_module --add-module=/opt/openresty-1.19.9.1/bundle/nginx_upstream_session_sticky_module --add-module=/opt/openresty-1.19.9.1/bundle/nginx_upstream_check_module-master --add-module=/opt/openresty-1.19.9.1/bundle/lua-var-nginx-module --add-module=/opt/openresty-1.19.9.1/bundle/ngx_cache_purge-2.3 --add-module=/opt/openresty-1.19.9.1/bundle/ngx_http_geoip2_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module
checking for OS
 + Linux 3.10.0-1160.42.2.el7.x86_64 x86_64
...checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
...checking for gcc -pipe switch ... found
...checking for --with-ld-opt="-Wl,-rpath,/opt/openresty/luajit/lib" ... 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 ... 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 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 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 ... 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 ... 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 strerrordesc_np() ... not found
...checking for sys_nerr ... found
...checking for localtime_r() ... found
...checking for clock_gettime(CLOCK_MONOTONIC) ... 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 ioctl(FIONREAD) ... 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 SOCK_CLOEXEC support ... found
...checking for FD_CLOEXEC support ... found
configuring additional modules
adding module in ../ngx_devel_kit-0.3.1
 + ngx_devel_kit was configured
adding module in ../echo-nginx-module-0.62
 + ngx_http_echo_module was configured
adding module in ../xss-nginx-module-0.06
 + ngx_http_xss_filter_module was configured
adding module in ../ngx_coolkit-0.2
 + ngx_coolkit_module was configured
adding module in ../set-misc-nginx-module-0.32
found ngx_devel_kit for ngx_set_misc; looks good.
 + ngx_http_set_misc_module was configured
adding module in ../form-input-nginx-module-0.12
found ngx_devel_kit for ngx_form_input; looks good.
 + ngx_http_form_input_module was configured
adding module in ../encrypted-session-nginx-module-0.08
found ngx_devel_kit for ngx_encrypted_session; looks good.
 + ngx_http_encrypted_session_module was configured
adding module in ../srcache-nginx-module-0.32
 + ngx_http_srcache_filter_module was configured
adding module in ../ngx_lua-0.10.20
...checking for LuaJIT library in /opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib and /opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/include/luajit-2.1 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found
...checking for LuaJIT 2.x ... found
...checking for Lua language 5.1 ... found
...checking for LuaJIT has FFI ... found
...checking for export symbols by default (-E) ... found
...checking for export symbols by default (--export-all-symbols) ... not found
...checking for SO_PASSCRED ... found
...checking for SA_RESTART ... found
...checking for malloc_trim ... found
...checking for pipe2 ... found
...checking for signalfd ... found
...checking for execvpe ... found
 + ngx_http_lua_module was configured
adding module in ../ngx_lua_upstream-0.07
 + ngx_http_lua_upstream_module was configured
adding module in ../headers-more-nginx-module-0.33
 + ngx_http_headers_more_filter_module was configured
adding module in ../array-var-nginx-module-0.05
found ngx_devel_kit for ngx_array_var; looks good.
 + ngx_http_array_var_module was configured
adding module in ../memc-nginx-module-0.19
 + ngx_http_memc_module was configured
adding module in ../redis2-nginx-module-0.15
 + ngx_http_redis2_module was configured
adding module in ../redis-nginx-module-0.3.7
 + ngx_http_redis_module was configured
adding module in ../rds-json-nginx-module-0.15
 + ngx_http_rds_json_filter_module was configured
adding module in ../rds-csv-nginx-module-0.09
 + ngx_http_rds_csv_filter_module was configured
adding module in ../ngx_stream_lua-0.0.10
...checking for LuaJIT library in /opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib and /opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/include/luajit-2.1 (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl) ... found
...checking for LuaJIT 2.x ... found
...checking for Lua language 5.1 ... found
...checking for LuaJIT has FFI ... found
...checking for export symbols by default (-E) ... found
...checking for export symbols by default (--export-all-symbols) ... not found
...checking for SO_PASSCRED ... found
...checking for SA_RESTART ... found
...checking for require defined symbols (--require-defined) ... found
 + ngx_stream_lua_module was configured
adding module in /opt/openresty-1.19.9.1/bundle/nginx_upstream_session_sticky_module
...checking for ngx_http_upstream_session_sticky_module ... found
 + ngx_http_upstream_session_sticky_module was configured
adding module in /opt/openresty-1.19.9.1/bundle/nginx_upstream_check_module-master
...checking for ngx_http_upstream_check_module ... found
 + ngx_http_upstream_check_module was configured
adding module in /opt/openresty-1.19.9.1/bundle/lua-var-nginx-module
 + ngx_http_lua_var_module was configured
adding module in /opt/openresty-1.19.9.1/bundle/ngx_cache_purge-2.3
 + ngx_http_cache_purge_module was configured
adding module in /opt/openresty-1.19.9.1/bundle/ngx_http_geoip2_module
...checking for MaxmindDB library ... found
 + ngx_geoip2_module was configured
...checking for PCRE library ... found
*** src/core/nginx.h            src/core/ngx_config.h            src/core/ngx_core.h            src/core/ngx_log.h            src/core/ngx_palloc.h            src/core/ngx_array.h            src/core/ngx_list.h            src/core/ngx_hash.h            src/core/ngx_buf.h            src/core/ngx_queue.h            src/core/ngx_string.h            src/core/ngx_parse.h            src/core/ngx_parse_time.h            src/core/ngx_inet.h            src/core/ngx_file.h            src/core/ngx_crc.h            src/core/ngx_crc32.h            src/core/ngx_murmurhash.h            src/core/ngx_md5.h            src/core/ngx_sha1.h            src/core/ngx_rbtree.h            src/core/ngx_radix_tree.h            src/core/ngx_rwlock.h            src/core/ngx_slab.h            src/core/ngx_times.h            src/core/ngx_shmtx.h            src/core/ngx_connection.h            src/core/ngx_cycle.h            src/core/ngx_conf_file.h            src/core/ngx_module.h            src/core/ngx_resolver.h            src/core/ngx_open_file_cache.h            src/core/ngx_crypt.h            src/core/ngx_proxy_protocol.h            src/core/ngx_syslog.h src/event/ngx_event.h             src/event/ngx_event_timer.h             src/event/ngx_event_posted.h             src/event/ngx_event_connect.h             src/event/ngx_event_pipe.h             src/os/unix/ngx_time.h             src/os/unix/ngx_errno.h             src/os/unix/ngx_alloc.h             src/os/unix/ngx_files.h             src/os/unix/ngx_channel.h             src/os/unix/ngx_shmem.h             src/os/unix/ngx_process.h             src/os/unix/ngx_setaffinity.h             src/os/unix/ngx_setproctitle.h             src/os/unix/ngx_atomic.h             src/os/unix/ngx_gcc_atomic_x86.h             src/os/unix/ngx_thread.h             src/os/unix/ngx_socket.h             src/os/unix/ngx_os.h             src/os/unix/ngx_user.h             src/os/unix/ngx_dlopen.h             src/os/unix/ngx_process_cycle.h src/os/unix/ngx_linux_config.h src/os/unix/ngx_linux.h src/event/ngx_event_openssl.h src/core/ngx_regex.h *** YES *** src/core src/event src/event/modules src/os/unix ../ngx_devel_kit-0.3.1/objs objs/addon/ndk ../ngx_lua-0.10.20/src/api ../ngx_stream_lua-0.0.10/src/api /opt/openresty-1.19.9.1/bundle/nginx_upstream_session_sticky_module /opt/openresty-1.19.9.1/bundle/nginx_upstream_check_module-master /opt/openresty-1.19.9.1/bundle/lua-var-nginx-module/src  *** -Wl,--require-defined=pcre_version -Wl,-E -Wl,-E  -ldl -lpthread -lcrypt -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lmaxminddb -lmaxminddb -lpcre ***  *** -lpcre
...checking for PCRE JIT support ... found
1++++++++++++++++++++++ -Wl,--require-defined=pcre_version -Wl,-E -Wl,-E  -ldl -lpthread -lcrypt -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lmaxminddb -lmaxminddb -lpcre -ldl
...checking for OpenSSL library ... not found
--------------------- -Wl,--require-defined=pcre_version -Wl,-E -Wl,-E  -ldl -lpthread -lcrypt -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lmaxminddb -lmaxminddb -lpcre
--------------------- NO
--------------------- -ldl
--------------------- src/core src/event src/event/modules src/os/unix ../ngx_devel_kit-0.3.1/objs objs/addon/ndk ../ngx_lua-0.10.20/src/api ../ngx_stream_lua-0.0.10/src/api /opt/openresty-1.19.9.1/bundle/nginx_upstream_session_sticky_module /opt/openresty-1.19.9.1/bundle/nginx_upstream_check_module-master /opt/openresty-1.19.9.1/bundle/lua-var-nginx-module/src 
--------------------- -L/usr/lib64 -lssl -lcrypto -ldl -lpthread
...checking for OpenSSL library in /usr/local/ ... not found
3++++++++++++++++++++++ -Wl,--require-defined=pcre_version -Wl,-E -Wl,-E  -ldl -lpthread -lcrypt -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lmaxminddb -lmaxminddb -lpcre -ldl
...checking for OpenSSL library in /usr/pkg/ ... not found
5++++++++++++++++++++++ -Wl,--require-defined=pcre_version -Wl,-E -Wl,-E  -ldl -lpthread -lcrypt -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -L/opt/openresty-1.19.9.1/build/luajit-root/opt/openresty/luajit/lib -lluajit-5.1 -lm -ldl -lmaxminddb -lmaxminddb -lpcre -ldl
...checking for OpenSSL library in /opt/local/ ... not found

./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl= option.............

ERROR: failed to run command: sh ./configure --prefix=/opt/openresty/nginx \...

我的情况是系统自带了openssl 1.0.1,然后又自己装了openssl 1.1.1,就出这个问题了。然后执行:yum remove openssl-devel卸载就好了。

你可能感兴趣的:(nginx开发学习汇总,nginx,web安全,waf)