Linux搭建MQTT服务器(mosquitto)并使用

  • 下载源码

Index of /files/source/ (mosquitto.org)

  • 解包

    $ tar xf mosquitto-2.0.9.tar.gz

  • 编译准备

    sudo apt install -y gcc g++ cmake openssl libssl-dev

  • 编译及安装

    $ cd mosquitto-2.0.9
    $ make
    $ sudo make install

  • 配置文件(修改端口)

    $ cd /etc/mosquitto/
    $ sudo cp mosquitto.conf.example mosquitto.conf

mosquitto 2.0修改端口-CSDN博客

  • 启动

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

  • 测试

相关推荐
倔强的初学者3 分钟前
Python aiortc API
服务器·python·webrtc
shelby_loo12 分钟前
Ubuntu 下通过 Docker 部署 NGINX 服务器
服务器·ubuntu·docker
x,,xx1113 小时前
防火墙的安全策略
linux·服务器·数据库
Stark、3 小时前
【Linux系统编程】进程间通信(管道:匿名管道、命名管道、实战练习)
linux·运维·服务器·c语言·后端
犀利卓6 小时前
Linux——文件与磁盘
linux·运维·服务器
大海绵啤酒肚6 小时前
Kubernetes | Rocky Linux 8.9 安装部署 kubernetes集群
linux·容器·kubernetes
Gratitute_林腾6 小时前
neo4j-在Linux中安装neo4j
linux·neo4j
数据的世界0110 小时前
VMware下Linux和macOS遇到的一些问题总结
linux·运维·macos
向着开发进攻11 小时前
Linux 常用命令与实战教程
linux·运维·服务器
狂爱代码的码农11 小时前
Ubuntu22.04如何设置linux-lowlatency核心
服务器