# Nginx dynamic module install



## Mikanoshi (May 15, 2022)

In my make.conf:

```
.if !empty(.CURDIR:M/usr/ports/www/nginx*)
CONFIGURE_ARGS=--add-module=/usr/src/nginx/ngx_log_if --add-dynamic-module=/usr/src/nginx/nginx-module-vts
.endif
```

Dynamic module does compile but `make install` does not copy it to /usr/local/libexec/nginx/.
How to make nginx install it with other modules, so I could update port using portmaster and not building it first and then copying file manually?


----------



## SirDice (May 16, 2022)

Enable the options in the port.


```
===> The following configuration options are available for nginx-1.20.2_9,2:
     DEBUG=off: Build with debugging support
     DEBUGLOG=off: Enable debug log (--with-debug)
     DSO=on: Enable dynamic modules support
     FILE_AIO=on: Enable file aio
     IPV6=on: Enable IPv6 support
     NJS=off: Enable http_javascript module
     THREADS=on: Enable threads support
     WWW=on: Enable html sample files
====> Modules that require MAIL module
     MAIL=on: Enable IMAP4/POP3/SMTP proxy module
     MAIL_IMAP=off: Enable IMAP4 proxy module
     MAIL_POP3=off: Enable POP3 proxy module
     MAIL_SMTP=off: Enable SMTP proxy module
     MAIL_SSL=on: Enable mail_ssl module
====> Modules that require HTTP module
     GOOGLE_PERFTOOLS=off: Enable google perftools module
     HTTP=on: Enable HTTP module
     HTTP_ADDITION=on: Enable http_addition module
     HTTP_AUTH_REQ=on: Enable http_auth_request module
     HTTP_CACHE=on: Enable http_cache module
     HTTP_DAV=on: Enable http_webdav module
     HTTP_FLV=on: Enable http_flv module
     HTTP_GUNZIP_FILTER=on: Enable http_gunzip_filter module
     HTTP_GZIP_STATIC=on: Enable http_gzip_static module
     HTTP_IMAGE_FILTER=off: Enable http_image_filter module
     HTTP_MP4=on: Enable http_mp4 module
     HTTP_PERL=off: Enable http_perl module
     HTTP_RANDOM_INDEX=on: Enable http_random_index module
     HTTP_REALIP=on: Enable http_realip module
     HTTP_REWRITE=on: Enable http_rewrite module
     HTTP_SECURE_LINK=on: Enable http_secure_link module
     HTTP_SLICE=on: Enable http_slice module
     HTTP_SLICE_AHEAD=off: Enable http_slice_ahead module
     HTTP_SSL=on: Enable http_ssl module
     HTTP_STATUS=on: Enable http_stub_status module
     HTTP_SUB=on: Enable http_sub module
     HTTP_XSLT=off: Enable http_xslt module
     HTTPV2=on: Enable HTTP/2 protocol support (SSL req.)
     HTTPV2_AUTOTUNE=off: Enable HTTP/2 upload auto-tuning
     STREAM=on: Enable stream module
     STREAM_SSL=on: Enable stream_ssl module (SSL req.)
     STREAM_SSL_PREREAD=on: Enable stream_ssl_preread module (SSL req.)
     AJP=off: 3rd party ajp module
     AWS_AUTH=off: 3rd party aws auth module
     BROTLI=off: 3rd party brotli module
     CACHE_PURGE=off: 3rd party cache_purge module
     CLOJURE=off: 3rd party clojure module
     CT=off: 3rd party cert_transparency module (SSL req.)
     DEVEL_KIT=off: 3rd party Nginx Development Kit module
     ARRAYVAR=off: 3rd party array_var module
     DRIZZLE=off: 3rd party drizzle module
     DYNAMIC_TLS=off: 3rd party dynamic tls records patch
     DYNAMIC_HC=off: 3rd party dynamic_healthcheck module
     DYNAMIC_UPSTREAM=off: 3rd party dynamic_upstream module
     ECHO=off: 3rd party echo module
     ENCRYPTSESSION=off: 3rd party encrypted_session module
     FORMINPUT=off: 3rd party form_input module
     GRIDFS=off: 3rd party gridfs module
     HEADERS_MORE=off: 3rd party headers_more module
     HTTP_ACCEPT_LANGUAGE=off: 3rd party accept_language module
     HTTP_AUTH_DIGEST=off: 3rd party http_authdigest module
     HTTP_AUTH_JWT=off: 3rd party http_auth_jwt module
     HTTP_AUTH_KRB5=off: 3rd party http_auth_gss module
     HTTP_AUTH_LDAP=off: 3rd party http_auth_ldap module
     HTTP_AUTH_PAM=off: 3rd party http_auth_pam module
     HTTP_DAV_EXT=off: 3rd party webdav_ext module
     HTTP_EVAL=off: 3rd party eval module
     HTTP_FANCYINDEX=off: 3rd party http_fancyindex module
     HTTP_FOOTER=off: 3rd party http_footer module
     HTTP_GEOIP2=off: 3rd party geoip2 module
     HTTP_IP2LOCATION=off: 3rd party ip2location-nginx module
     HTTP_IP2PROXY=off: 3rd party ip2proxy-nginx module
     HTTP_JSON_STATUS=off: 3rd party http_json_status module
     HTTP_MOGILEFS=off: 3rd party mogilefs module
     HTTP_MP4_H264=off: 3rd party mp4/h264 module
     HTTP_NOTICE=off: 3rd party notice module
     HTTP_PUSH=off: 3rd party push module
     HTTP_PUSH_STREAM=off: 3rd party push stream module
     HTTP_REDIS=off: 3rd party http_redis module
     HTTP_RESPONSE=off: 3rd party http_response module
     HTTP_SUBS_FILTER=off: 3rd party subs filter module
     HTTP_TARANTOOL=off: 3rd party tarantool upstream module
     HTTP_UPLOAD=off: 3rd party upload module
     HTTP_UPLOAD_PROGRESS=off: 3rd party uploadprogress module
     HTTP_UPSTREAM_CHECK=off: 3rd party upstream check module
     HTTP_UPSTREAM_FAIR=off: 3rd party upstream fair module
     HTTP_UPSTREAM_STICKY=off: 3rd party upstream sticky module
     HTTP_VIDEO_THUMBEXTRACTOR=off: 3rd party video_thumbextractor module
     HTTP_ZIP=off: 3rd party http_zip module
     ICONV=off: 3rd party iconv module
     LET=off: 3rd party let module
     LINK=off: 3rd party link function module
     LUA=off: 3rd party lua module
     MEMC=off: 3rd party memc (memcached) module
     MODSECURITY3=off: 3rd party modsecurity3 module
     NAXSI=off: 3rd party naxsi module
     OPENTRACING=off: 3rd party opentracing module
     PASSENGER=off: 3rd party passenger module
     POSTGRES=off: 3rd party postgres module
     RDS_CSV=off: 3rd party rds_csv module
     RDS_JSON=off: 3rd party rds_json module
     REDIS2=off: 3rd party redis2 module
     RTMP=off: 3rd party rtmp module
     SET_MISC=off: 3rd party set_misc module
     SFLOW=off: 3rd party sflow module
     SHIBBOLETH=off: 3rd party shibboleth module
     SLOWFS_CACHE=off: 3rd party slowfs_cache module
     SMALL_LIGHT=off: 3rd party small_light module
     SRCACHE=off: 3rd party srcache module
     VOD=off: 3rd party vod module
     VTS=off: 3rd party vts module
     XSS=off: 3rd party xss module
     WEBSOCKIFY=off: 3rd party websockify module
====> GSSAPI implementation (imply HTTP_AUTH_KRB5): you can only select none or one of them
     GSSAPI_HEIMDAL=off: GSSAPI support via security/heimdal
     GSSAPI_MIT=off: GSSAPI support via security/krb5
===> Use 'make config' to modify these settings
```


----------



## Mikanoshi (May 16, 2022)

What options exactly? Dynamic modules are enabled. I'm adding a 3rd-party module that is not in this port.


----------



## SirDice (May 16, 2022)

VTS is:

```
VTS=off: 3rd party vts module
```


----------



## Mikanoshi (May 16, 2022)

What if I need a modified version? Even with selected option the port's version of a module is being installed.


----------



## joneum@ (May 20, 2022)

NGINX uses the VTS module 0.1.18. This is the latest one: https://github.com/vozlt/nginx-module-vts/tags


----------



## Mikanoshi (May 20, 2022)

joneum@ said:


> NGINX uses the VTS module 0.1.18. This is the latest one: https://github.com/vozlt/nginx-module-vts/tags











						nginx-module-vts/ngx_http_vhost_traffic_status_module.h at master · vozlt/nginx-module-vts
					

Nginx virtual host traffic status module. Contribute to vozlt/nginx-module-vts development by creating an account on GitHub.




					github.com


----------



## joneum@ (May 20, 2022)

developer version (dev)


----------



## Mikanoshi (May 20, 2022)

The question was how to auto install custom dynamic module with a port, module's contents are irrelevant.


----------



## joneum@ (May 20, 2022)

sudo cd /usr/ports/www/nginx && make config


----------



## Mikanoshi (May 20, 2022)

joneum@ said:


> sudo cd /usr/ports/www/nginx && make config




```
cd /usr/ports/www/nginx-devel
make install
cp work/stage/usr/local/libexec/nginx/my_module.so /usr/local/libexec/nginx/
make clean
```

"Automated"


----------

