需要安装下面的基础包
安装libxslt
libxslt是一个快速XSLT引擎,它可以将通过XSL层叠样式表把XML转换为相应格式的文件
yum -y install libxslt
安装xsltproc
sudo apt-get install xsltproc
安装cJSON(源码安装)
cJSON是C语言中一个JSON一个编解码器
下载Mosquitto代码,在代码目录中执行
make && make install
使用代码编译安装,其配置文件在/etc/mosquitto/目录下,拷贝mosquitto和pwfile两个文件进行备份
在mosquitto.conf配置文件中修改
配置用户执行下面的代码,执行后要求输入密码,这个命令会覆盖已有的,所以可以另创建一个文件生成,然后再粘过去
mosquitto_passwd -c /etc/mosquitto/pwfile admin
启动mosquitto
mosquitto -c /etc/mosquitto/mosquitto.conf -d