自前でOpenSSLをコンパイルしていて、それにリンクするNginxをコンパイルするときの勘所
スポンサーリンク

自前でOpenSSLをコンパイルインストールしていて、Nginxも自前でコンパイルするときは下記パラメーターが必要になります。
#少しハマったのでメモ

↓↓↓↓↓↓↓↓↓↓↓↓↓の指定をする必要があります。

-I/var/home/lib/openssl/include/openssl
-L/var/home/lib/openssl/lib
./configure \
 --prefix=/var/home/ap/nginx \
 --with-cc-opt="-Wno-error -I/var/home/lib/openssl/include/openssl" \ ←これ
 --with-ld-opt="-L/var/home/lib/openssl/lib" \ ←これ
 --with-http_ssl_module \
 --with-http_gzip_static_module \
 --with-http_stub_status_module \
 --with-http_ssl_module \
 --with-http_gzip_static_module \
 --with-http_stub_status_module \
 --with-http_realip_module \
 --sbin-path=/var/home/ap/nginx/nginx \
 --conf-path=/var/home/ap/nginx/etc/nginx.conf \
 --with-pcre \
 --without-http_autoindex_module \
 --without-http_browser_module \
 --without-http_empty_gif_module \
 --without-http_geo_module \
 --without-http_limit_req_module \
 --without-http_limit_conn_module \
 --without-http_map_module \
 --without-http_memcached_module \
 --without-http_scgi_module \
 --without-http_split_clients_module \
 --without-http_upstream_ip_hash_module \
 --without-http_userid_module \
 --without-http_uwsgi_module \
 --with-debug

UnitファイルへのLD_LIBRARY_PATHの設定も忘れないようにしましょう。

view /usr/lib/systemd/system/nginx.service

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
Environment="LD_LIBRARY_PATH=/var/home/lib/openssl/lib:/var/home/lib/boost/lib:/var/home/ap/mysql/lib:/var/home/lib/libmcrypt/lib/lib:/var/home/ap/ruby/lib" ←これ 
ExecStartPre=/var/home/ap/nginx/nginx -t -c /var/home/ap/nginx/etc/nginx.conf
ExecStart=/var/home/ap/nginx/nginx -c /var/home/ap/nginx/etc/nginx.conf
ExecReload=/var/home/ap/nginx/nginx -s reload -c /var/home/ap/nginx/etc/nginx.conf
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target



ここまで読んで頂きありがとうございます。
現在、ランキング参加中です。良ければランキングボタンをクリック願います。
↓↓↓↓↓↓↓↓

オープンソースランキング

にほんブログ村 IT技術ブログへ
にほんブログ村

にほんブログ村 IT技術ブログ オープンソースへ
にほんブログ村

スポンサーリンク
おすすめの記事