MYCSS

2019-08-01

FreeBSD. Mosquitto. Mosquitto-Auth-Plugin. LDAP


Mosquitto (http://mosquitto.org)
Mosquitto-Auth-Plugin (https://github.com/jpmens/mosquitto-auth-plug#ldap-auth)

1. Install Mosquitto from ports
$cd /usr/ports/net/mosquitto/
$make config
$make install
$ls -d /usr/ports/net/mosquitto/work/mosquitto-*
/usr/ports/net/mosquitto/work/mosquitto-1.5.8 (remember it)
2. Install openldap client from ports
$cd /usr/ports/net/openldap24-client
$make config
$make install
$make clean 
3. Check openssl lib
$openssl version
OpenSSL 1.0.2o-freebsd  27 Mar 2018
4. Compile Mosquitto from git
$pkg install git
$cd ~ 
$git clone git://github.com/jpmens/mosquitto-auth-plug.git
$cd mosquitto-auth-plug/
4.1. edit config.mk
cp config.mk.in config.mk
MOSQUITTO_SRC = /usr/ports/net/mosquitto/work/mosquitto-1.5.8
OPENSSLDIR = /usr/bin
BACKEND_MYSQL ?= no
BACKEND_LDAP ?= yes 
Copmile path on config.mk or Makefile
CFG_LDFLAGS =-L/usr/local/lib
CFG_CFLAGS =-I/usr/local/include
or edit Makefile
BE_CFLAGS = -I/usr/local/include
BE_LDFLAGS = -L/usr/local/lib/
or run comadns for replace
sed 's#MOSQUITTO_SRC =#MOSQUITTO_SRC = /usr/ports/net/mosquitto/work/mosquitto-1.5.8#' config.mk.in > config.mk 
sed -i "" 's#OPENSSLDIR = /usr#OPENSSLDIR = /usr/bin#' config.mk
sed -i "" 's#BACKEND_MYSQL ?= yes#BACKEND_MYSQL ?= no#' config.mk 
sed -i "" 's#BACKEND_LDAP ?= no#BACKEND_LDAP ?= yes#' config.mk 
sed -i "" 's#CFG_LDFLAGS =#CFG_LDFLAGS =-L/usr/local/lib#' config.mk  
sed -i "" 's#CFG_CFLAGS =#CFG_CFLAGS =-I/usr/local/include#' config.mk
sed -i "" 's#BE_CFLAGS =#BE_CFLAGS = -I/usr/local/include#' Makefile     
sed -i "" 's#BE_LDFLAGS =#BE_LDFLAGS = -L/usr/local/lib/#' Makefile 
4.2 Compile
$pkg install gmake 
$qmake
FreeBSD compile Mosquitto-Auth-Plugin

Коли забув ти рідну мову, біднієш духом ти щодня...
When you forgot your native language you would become a poor at spirit every day ...

Д.Білоус / D.Bilous
Рабів до раю не пускають. Будь вільним!

ipv6 ready