# How to install custom nginx module?



## Vincent See (Feb 22, 2019)

Anyone know or could point me in the right direction how to install custom modules in www/nginx?

I tried to do `cd /usr/ports/www/nginx` and did `./configure --add-module=/root/ngx_http_enhanced_memcached_module --add-dynamic-module=/root/ngx_http_enhanced_memcached_module`
But it returned 
	
	



```
./configure: Command not found
```

I was trying to install this

Compile Nginx with option in ./configure, as static or dynamic module
--add-module=/my/path/to/my/clone/ngx_http_enhanced_memcached_module
--add-dynamic-module=/my/path/to/my/clone/ngx_http_enhanced_memcached_module

Anyone know how can I install a custom module?
I tried `make config` in www/nginx But adding custom modules is not listed there.

Thank you!
- Vincent


----------



## Bobi B. (Feb 22, 2019)

The source code for various ports is not really in /usr/ports; instructions are kept there, where to fetch the source code from and how to build the packages. For your case you might try the following: navigate to /usr/ports/www/nginx, run `make config` and verify DSO loading is enabled (it is enabled by default, if I remember correctly), see if your module is not already there. If not, if you're able to do so, better add a `make config` option to enable given module, it is not that hard: you'll have to add a handful of lines here and there in the Makefile.


----------



## Vincent See (Feb 22, 2019)

Bobi B. said:


> The source code for various ports is not really in /usr/ports; instructions are kept there, where to fetch the source code from and how to build the packages. For your case you might try the following: navigate to /usr/ports/www/nginx, run `make config` and verify DSO loading is enabled (it is enabled by default, if I remember correctly), see if your module is not already there. If not, if you're able to do so, better add a `make config` option to enable given module, it is not that hard: you'll have to add a handful of lines here and there in the Makefile.


Thank you Bobi B., I Will try that now. I appreciate that.


----------



## SirDice (Feb 22, 2019)

Vincent See said:


> I tried  `make config` in www/nginx But adding custom modules is not listed there.


You're looking for the wrong thing. 

Enable this:

```
MEMC=off: 3rd party memc (memcached) module
```

Or install www/nginx-full (which has MEMC turned on).


----------



## Vincent See (Feb 23, 2019)

SirDice said:


> You're looking for the wrong thing.
> 
> Enable this:
> 
> ...


I installed www/nginx-full and it has MEMC turned on, I thought it would let me use the `./configure` command, it still says PR ./configure: Command not found I will try to do some digging on how. Thank you SirDice!

- Vincent


----------

