mosquitto编译安装笔记


wget http://mosquitto.org/files/source/mosquitto-1.3.1.tar.gz

tar zxf mosquitto-1.3.1.tar.gz

cd mosquitto-1.3.1

vim config.mk

把WITH_SRV:=yes注释掉


创建配置文件,使用默认配置

cp /etc/mosquitto/mosquitto.conf.example /etc/mosquitto/mosquitto.conf

vim /etc/mosquitto/mosquitto.conf

修改:

password_file /etc/mosquitto/pwfile

创建一个test用户:

/usr/local/mosquitto/bin/mosquitto_passwd -c /etc/mosquitto/pwfile test

输入两次密码即可

添加用户:

#/usr/local/mosquitto/bin/mosquitto_passwd -u /etc/mosquitto/pwfile test2


创建linux上的mosquitto用户(默认使用该用户启动)

useradd -s /sbin/nologin mosquitto


启动服务

/usr/local/mosquitto/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -d

你可能感兴趣的:(centos,mqtt,mosquitto)