Porównaj ceny domen i usług IT, sprzedawców z całego świata

Kompilowanie nginx 1.11.9 na CentOS 6 z OpenSSL 1.0.2k


Używam CentOS 6 x64 i chcę skompilować nginx 1.11.9 przeciwko OpenSSL 1.0.2k, aby używać HTTP/2.
Pobrałem openssl-1.0.2k do/usr/local/src:
       [root@qpat1 nginx-1.11.9]# ls/usr/local/src
openssl-1.0.2k
Próbuję skompilować nginx za pomocą następujących poleceń:
       $ ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --with-openssl=/usr/local/src/openssl-1.0.2k
$ make
Działa przez chwilę, a potem zaczyna działać:
       objs/src/mail/ngx_mail_pop3_module.o \
objs/src/mail/ngx_mail_pop3_handler.o \
objs/src/mail/ngx_mail_imap_module.o \
objs/src/mail/ngx_mail_imap_handler.o \
objs/src/mail/ngx_mail_smtp_module.o \
objs/src/mail/ngx_mail_smtp_handler.o \
objs/src/mail/ngx_mail_auth_http_module.o \
objs/src/mail/ngx_mail_proxy_module.o \
objs/src/stream/ngx_stream.o \
objs/src/stream/ngx_stream_variables.o \
objs/src/stream/ngx_stream_script.o \
objs/src/stream/ngx_stream_handler.o \
objs/src/stream/ngx_stream_core_module.o \
objs/src/stream/ngx_stream_log_module.o \
objs/src/stream/ngx_stream_proxy_module.o \
objs/src/stream/ngx_stream_upstream.o \
objs/src/stream/ngx_stream_upstream_round_robin.o \
objs/src/stream/ngx_stream_write_filter_module.o \
objs/src/stream/ngx_stream_ssl_module.o \
objs/src/stream/ngx_stream_realip_module.o \
objs/src/stream/ngx_stream_limit_conn_module.o \
objs/src/stream/ngx_stream_access_module.o \
objs/src/stream/ngx_stream_geo_module.o \
objs/src/stream/ngx_stream_map_module.o \
objs/src/stream/ngx_stream_split_clients_module.o \
objs/src/stream/ngx_stream_return_module.o \
objs/src/stream/ngx_stream_upstream_hash_module.o \
objs/src/stream/ngx_stream_upstream_least_conn_module.o \
objs/src/stream/ngx_stream_upstream_zone_module.o \
objs/src/stream/ngx_stream_ssl_preread_module.o \
objs/ngx_modules.o \
-Wl,-z,relro -Wl,-z,now -pie -ldl -lpthread -lpthread -lcrypt -lpcre/usr/local/src/openssl-1.0.2k/.openssl/lib/libssl.a/usr/local/src/openssl-1.0.2k/.openssl/lib/libcrypto.a -ldl -lz \
-Wl,-E
/usr/bin/ld:/usr/local/src/openssl-1.0.2k/.openssl/lib/libssl.a(s23_meth.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/src/openssl-1.0.2k/.openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory `/root/nginx-http2/nginx-1.11.9'
make: *** [build] Error 2
Próbowałem wszystkiego, o czym mogłem pomyśleć. Postępowałem zgodnie z instrukcjami, które znalazłem dla podobnych problemów, aby skompilować OpenSSL z -fPIC:
       ./config -fPIC
make depend
make
make install
Wydaje się, że nic nie działa. Każda rada jest mile widziana.
Zaproszony:
Anonimowy użytkownik

Anonimowy użytkownik

Potwierdzenie od:

Zainspirowany IRC, odkryłem, że plik Makefile wygenerowany przez skrypt konfiguracyjny nginx nie kompiluje OpenSSL (ani żadnych innych źródeł, których używasz, takich jak zlib) z
         -fPIC
... Edycja wygenerowanego pliku Makefile (objs/Makefile), znalezienie openssl
         ./config
polecenie i dodaj
         -fPIC
do tego wiersza poleceń skompilował.
Anonimowy użytkownik

Anonimowy użytkownik

Potwierdzenie od:

Mam instrukcje tworzenia Nginx ze źródła pod adresem

ta odpowiedź
https://serverfault.com/a/772864/306795... To było całkiem proste. Nie stworzyłem OpenSSL, użyłem pliku binarnego.

Aby odpowiedzieć na pytania, Zaloguj się lub Zarejestruj się