To install nginx with txid module
install nginx-full package:
COPYsudo apt-get install nginx-full
download last nginx source:
COPYwget http://nginx.org/download/nginx-1.9.9.tar.gz
examine what flags and modules your current nginx installed with:
COPYnginx -V
you will see something like
COPYnginx version: nginx/1.6.2 (Ubuntu)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/nginx-gKBGMk/nginx-1.6.2/debian/modules/nginx-auth-pam --add-module=/build/nginx-gKBGMk/nginx-1.6.2/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-gKBGMk/nginx-1.6.2/debian/modules/nginx-echo --add-module=/build/nginx-gKBGMk/nginx-1.6.2/debian/modules/nginx-upstream-fair --add-module=/build/nginx-gKBGMk/nginx-1.6.2/debian/modules/ngx_http_substitutions_filter_module
copy output to your editor for later use.
extract nginx source
COPYtar –xvf nginx-1.9.9.tar.gz
cd to it
COPYcd nginx-1.9.9
install required dependencies
COPYsudo apt-get install build-essential
clone txid git repo into the current folder
COPYgit clone [email protected]:streadway/ngx_txid.git
go to your editor and prepare configuration parameters based on the output copied here previously
COPY./configure --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=ngx_txid
now run this command in current folder. Note that we use --with-http_v2_module
instead of --with-http_spdy_module
and add --add-module=ngx_txid
at the end
install libgd-dev
in case of this error:
./configure: error: the HTTP image filter module requires the GD library.
install libgeoip-dev
in case of:
./configure: error: the GeoIP module requires the GeoIP library.
install libssl-dev
in case of:
./configure: error: SSL modules require the OpenSSL library.
install libpcre++-dev
in case of:
./configure: error: the HTTP rewrite module requires the PCRE library.
install libxslt1-dev
in case of:
./configure: error: the HTTP XSLT module requires the libxml2/libxslt
after success of ./configure
run
COPYmake
COPYsudo make install
and now newely builded nginx binary can be found here: /usr/share/nginx/sbin/
check that this binary builded correctly:
COPY/usr/share/nginx/sbin/nginx -V
output will be like
COPYnginx version: nginx/1.9.9
built by gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=../ngx_txid
now stop nginx
COPYsudo service nginx stop
and change the binaries:
COPYsudo mv /usr/sbin/nginx /usr/sbin/nginx_back
sudo mv /usr/share/nginx/sbin/nginx /usr/sbin/nginx
check that everything is as expected
COPYnginx -V
output should be like
COPYnginx version: nginx/1.9.9
built by gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=../ngx_txid
and finally start our fresh compiled nginx
COPYsudo service nginx start
now nginx sources can be removed:
COPYcd ..
COPYrm -rf nginx-1.9.9
Source
https://makandracards.com/konjoot/38441-ubuntu-nginx-with-txid-module
了解 Starx's Home 的更多信息
Subscribe to get the latest posts sent to your email.
0 条评论