多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 一、安装 准备环境 ``` yum install -y gcc-c++ yum install -y openssl-devel yum install -y cmake wget https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.15.tar.gz tar vzxf v1.7.15.tar.gz cd cJSON-1.7.15 make make install ``` ``` wget https://mosquitto.org/files/source/mosquitto-2.0.12.tar.gz tar zxvf mosquitto-2.0.12.tar.gz cd mosquitto-2.0.12 make make install prefix=/usr/lib/app/mosquitto ``` 添加启动用户 ``` groupadd mosquitto useradd -g mosquitto mosquitto -s /sbin/nologin ``` ## 二、运行 进入安装主目录; ``` cp /etc/mosquitto/mosquitto.conf.example mosquitto.conf mosquitto -c mosquitto.conf ``` ![](https://img.kancloud.cn/6c/43/6c4314e4a2d7dd5903db92a41024c0f8_1055x153.png) 后台运行: ``` mosquitto -c mosquitto.conf -d ```