linux下安装mosquito并用mqtt。fx测

默认加粗斜向为重点

mosquitto-1.4.5  mosquitto-1.4.5.tar.gz
[root@dsch03 softmos]# cd mosquitto-1.4.5
[root@dsch03 mosquitto-1.4.5]# ls
about.html       config.h         installer    misc             readme-windows.txt
aclfile.example  config.mk        lib          mosquitto.conf   security
ChangeLog.txt    CONTRIBUTING.md  LICENSE.txt  notice.html      service
client           edl-v10          logo         pskfile.example  src
CMakeLists.txt   epl-v10          Makefile     pwfile.example   test
compiling.txt    examples         man          readme.md
[root@dsch03 mosquitto-1.4.5]# make
set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/lib'
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c mosquitto.c -o mosquitto.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c logging_mosq.c -o logging_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c memory_mosq.c -o memory_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c messages_mosq.c -o messages_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c net_mosq.c -o net_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c read_handle.c -o read_handle.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c read_handle_client.c -o read_handle_client.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c read_handle_shared.c -o read_handle_shared.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c send_mosq.c -o send_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c send_client_mosq.c -o send_client_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c socks_mosq.c -o socks_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c srv_mosq.c -o srv_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c thread_mosq.c -o thread_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c time_mosq.c -o time_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c tls_mosq.c -o tls_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c util_mosq.c -o util_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -DWITH_SOCKS -DWITH_SRV -c will_mosq.c -o will_mosq.o
cc -shared  -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.1 mosquitto.o logging_mosq.o memory_mosq.o messages_mosq.o net_mosq.o read_handle.o read_handle_client.o read_handle_shared.o send_mosq.o send_client_mosq.o socks_mosq.o srv_mosq.o thread_mosq.o time_mosq.o tls_mosq.o util_mosq.o will_mosq.o -o libmosquitto.so.1  -lrt -lssl -lcrypto -lpthread -lcares
ar cr libmosquitto.a mosquitto.o logging_mosq.o memory_mosq.o messages_mosq.o net_mosq.o read_handle.o read_handle_client.o read_handle_shared.o send_mosq.o send_client_mosq.o socks_mosq.o srv_mosq.o thread_mosq.o time_mosq.o tls_mosq.o util_mosq.o will_mosq.o
make -C cpp
make[2]: Entering directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
g++ -Wall -ggdb -O2  -I. -I.. -I../lib  -fPIC -c mosquittopp.cpp -o mosquittopp.o
g++ -shared  -Wl,-soname,libmosquittopp.so.1 mosquittopp.o -o libmosquittopp.so.1 ../libmosquitto.so.1
make[2]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib'
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/client'
cc -c pub_client.c -o pub_client.o -Wall -ggdb -O2  -I../lib -DVERSION="\"1.4.5\"" -DWITH_TLS -DWITH_TLS_PSK -DWITH_SOCKS -DWITH_SRV
cc -c client_shared.c -o client_shared.o -Wall -ggdb -O2  -I../lib -DVERSION="\"1.4.5\"" -DWITH_TLS -DWITH_TLS_PSK -DWITH_SOCKS -DWITH_SRV
cc pub_client.o client_shared.o -o mosquitto_pub  -L../lib ../lib/libmosquitto.so.1
cc -c sub_client.c -o sub_client.o -Wall -ggdb -O2  -I../lib -DVERSION="\"1.4.5\"" -DWITH_TLS -DWITH_TLS_PSK -DWITH_SOCKS -DWITH_SRV
cc sub_client.o client_shared.o -o mosquitto_sub  -L../lib ../lib/libmosquitto.so.1
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/client'
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/src'
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c mosquitto.c -o mosquitto.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c bridge.c -o bridge.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c conf.c -o conf.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c context.c -o context.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c database.c -o database.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c logging.c -o logging.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c loop.c -o loop.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/memory_mosq.c -o memory_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c persist.c -o persist.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c net.c -o net.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/net_mosq.c -o net_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c read_handle.c -o read_handle.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c read_handle_client.c -o read_handle_client.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c read_handle_server.c -o read_handle_server.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/read_handle_shared.c -o read_handle_shared.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c security.c -o security.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c security_default.c -o security_default.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/send_client_mosq.c -o send_client_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/send_mosq.c -o send_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c send_server.c -o send_server.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c service.c -o service.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c subs.c -o subs.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c sys_tree.c -o sys_tree.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/time_mosq.c -o time_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/tls_mosq.c -o tls_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/util_mosq.c -o util_mosq.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c websockets.c -o websockets.o
cc -Wall -ggdb -O2  -I. -I.. -I../lib  -DVERSION="\"1.4.5\"" -DTIMESTAMP="\"2020-09-10 18:09:27+0800\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_EC -c ../lib/will_mosq.c -o will_mosq.o
cc mosquitto.o bridge.o conf.o context.o database.o logging.o loop.o memory_mosq.o persist.o net.o net_mosq.o read_handle.o read_handle_client.o read_handle_server.o read_handle_shared.o security.o security_default.o send_client_mosq.o send_mosq.o send_server.o service.o subs.o sys_tree.o time_mosq.o tls_mosq.o util_mosq.o websockets.o will_mosq.o -o mosquitto  -ldl -lm -lrt -Wl,--dynamic-list=linker.syms -lssl -lcrypto -luuid
cc -Wall -ggdb -O2  -c mosquitto_passwd.c -o mosquitto_passwd.o
cc mosquitto_passwd.o -o mosquitto_passwd  -lcrypto
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/src'
set -e; for d in man; do make -C ${d}; done
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/man'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/man'
[root@dsch03 mosquitto-1.4.5]# make install
set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/lib'
make -C cpp
make[2]: Entering directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib'
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/client'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/client'
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/src'
set -e; for d in lib client src; do make -C ${d} install; done
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/lib'
make -C cpp
make[2]: Entering directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
install -d /usr/local/lib/
install -s --strip-program=strip libmosquitto.so.1 /usr/local/lib/libmosquitto.so.1
ln -sf libmosquitto.so.1 /usr/local/lib/libmosquitto.so
install -d /usr/local/include/
install mosquitto.h /usr/local/include/mosquitto.h
make -C cpp install
make[2]: Entering directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
install -d /usr/local/lib/
install -s --strip-program=strip libmosquittopp.so.1 /usr/local/lib/libmosquittopp.so.1
ln -sf libmosquittopp.so.1 /usr/local/lib/libmosquittopp.so
install -d /usr/local/include/
install mosquittopp.h /usr/local/include/mosquittopp.h
make[2]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib/cpp'
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/lib'
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/client'
install -d /usr/local/bin
install -s --strip-program=strip mosquitto_pub /usr/local/bin/mosquitto_pub
install -s --strip-program=strip mosquitto_sub /usr/local/bin/mosquitto_sub
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/client'
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/src'
install -d /usr/local/sbin
install -s --strip-program=strip mosquitto /usr/local/sbin/mosquitto
install mosquitto_plugin.h /usr/local/include/mosquitto_plugin.h
install -s --strip-program=strip mosquitto_passwd /usr/local/bin/mosquitto_passwd
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/src'
set -e; for d in man; do make -C ${d} install; done
make[1]: Entering directory `/root/softmos/mosquitto-1.4.5/man'
install -d /usr/local/share/man/man8
install -m 644 mosquitto.8 /usr/local/share/man/man8/mosquitto.8
install -d /usr/local/share/man/man5
install -m 644 mosquitto.conf.5 /usr/local/share/man/man5/mosquitto.conf.5
install -d /usr/local/share/man/man1
install -m 644 mosquitto_passwd.1 /usr/local/share/man/man1/mosquitto_passwd.1
install -m 644 mosquitto_pub.1 /usr/local/share/man/man1/mosquitto_pub.1
install -m 644 mosquitto_sub.1 /usr/local/share/man/man1/mosquitto_sub.1
install -d /usr/local/share/man/man7
install -m 644 mqtt.7 /usr/local/share/man/man7/mqtt.7
install -m 644 mosquitto-tls.7 /usr/local/share/man/man7/mosquitto-tls.7
install -d /usr/local/share/man/man3
install -m 644 libmosquitto.3 /usr/local/share/man/man3/libmosquitto.3
make[1]: Leaving directory `/root/softmos/mosquitto-1.4.5/man'
install -d /etc/mosquitto
install -m 644 mosquitto.conf /etc/mosquitto/mosquitto.conf.example
install -m 644 aclfile.example /etc/mosquitto/aclfile.example
install -m 644 pwfile.example /etc/mosquitto/pwfile.example
install -m 644 pskfile.example /etc/mosquitto/pskfile.example
[root@dsch03 mosquitto-1.4.5]# mosquitto -v
1599732615: mosquitto version 1.4.5 (build date 2020-09-10 18:09:27+0800) starting
1599732615: Using default config.
1599732615: Opening ipv4 listen socket on port 1883.
1599732615: Opening ipv6 listen socket on port 1883.
1599732615: Error: Invalid user 'mosquitto'.
[root@dsch03 mosquitto-1.4.5]# ls
about.html       config.h         installer    misc             readme-windows.txt
aclfile.example  config.mk        lib          mosquitto.conf   security
ChangeLog.txt    CONTRIBUTING.md  LICENSE.txt  notice.html      service
client           edl-v10          logo         pskfile.example  src
CMakeLists.txt   epl-v10          Makefile     pwfile.example   test
compiling.txt    examples         man          readme.md
[root@dsch03 mosquitto-1.4.5]# vim config.mk
# =============================================================================
# User configuration section.
#
# These options control compilation on all systems apart from Windows and Mac
# OS X. Use CMake to compile on Windows and Mac.
#
# Largely, these are options that are designed to make mosquitto run more
# easily in restrictive environments by removing features.
#
# Modify the variable below to enable/disable features.
#
# Can also be overriden at the command line, e.g.:
#
# make WITH_TLS=no
# =============================================================================

# Uncomment to compile the broker with tcpd/libwrap support.
#WITH_WRAP:=yes

# Comment out to disable SSL/TLS support in the broker and client.
# Disabling this will also mean that passwords must be stored in plain text. It
# is strongly recommended that you only disable WITH_TLS if you are not using
# password authentication at all.
WITH_TLS:=yes

# Uncomment to compile the broker with tcpd/libwrap support.
#WITH_WRAP:=yes

# Comment out to disable SSL/TLS support in the broker and client.
# Disabling this will also mean that passwords must be stored in plain text. It
# is strongly recommended that you only disable WITH_TLS if you are not using
# password authentication at all.
WITH_TLS:=yes

# Comment out to disable TLS/PSK support in the broker and client. Requires
# WITH_TLS=yes.
# This must be disabled if using openssl < 1.0.
WITH_TLS_PSK:=yes

# Comment out to disable client client threading support.
WITH_THREADING:=yes

# Comment out to remove bridge support from the broker. This allow the broker
# to connect to other brokers and subscribe/publish to topics. You probably
# want to leave this included unless you want to save a very small amount of
# memory size and CPU time.
WITH_BRIDGE:=yes

# Comment out to remove persistent database support from the broker. This
# allows the broker to store retained messages and durable subscriptions to a
# file periodically and on shutdown. This is usually desirable (and is
# suggested by the MQTT spec), but it can be disabled if required.
WITH_PERSISTENCE:=yes

# Comment out to remove memory tracking support from the broker. If disabled,
# mosquitto won't track heap memory usage nor export '$SYS/broker/heap/current
# size', but will use slightly less memory and CPU time.
WITH_MEMORY_TRACKING:=yes

# Compile with database upgrading support? If disabled, mosquitto won't
# automatically upgrade old database versions.
# Not currently supported.
#WITH_DB_UPGRADE:=yes

# Comment out to remove publishing of the $SYS topic hierarchy containing
# information about the broker state.
WITH_SYS_TREE:=yes

# Build with SRV lookup support.
WITH_SRV:=yes

# Build using libuuid for clientid generation (Linux only - please report if
"config.mk" 247L, 6679C 已写入                                        
[root@dsch03 mosquitto-1.4.5]# cd /etc
[root@dsch03 etc]# ls
abrt                       hosts.deny                    prelink.conf.d
acpi                       idmapd.conf                   printcap
adjtime                    init                          profile
aliases                    init.d                        profile.d
aliases.db                 inittab                       protocols
alsa                       inputrc                       pulse
alternatives               ipa                           quotagrpadmins
anacrontab                 iproute2                      quotatab
asound.conf                issue                         rc
at.deny                    issue.net                     rc0.d
audisp                     java                          rc1.d
audit                      jvm                           rc2.d
autofs_ldap_auth.conf      jvm-commmon                   rc3.d
auto.master                kde                           rc4.d
auto.misc                  kdump-adv-conf                rc5.d
auto.net                   kdump.conf                    rc6.d
auto.smb                   krb5.conf                     rc.d
bash_completion.d          latrace.conf                  rc.local
bashrc                     latrace.d                     rc.sysinit
blkid                      ld.so.cache                   readahead.conf
bonobo-activation          ld.so.conf                    redhat-lsb
cas.conf                   ld.so.conf.d                  redhat-release
centos-release             libaudit.conf                 request-key.conf
certmonger                 libreport                     request-key.d
cgconfig.conf              libuser.conf                  resolv.conf
cgrules.conf               localtime                     rpc
cgsnapshot_blacklist.conf  login.defs                    rpm
chkconfig.d                logrotate.conf                rsyslog.conf
ConsoleKit                 logrotate.d                   rsyslog.d
cron.d                     lsb-release                   rwtab
cron.daily                 lsb-release.d                 rwtab.d
cron.deny                  ltrace.conf                   samba
cron.hourly                lvm                           sasl2
cron.monthly               magic                         scl
crontab                    mailcap                       securetty
cron.weekly                mail.rc                       security
crypttab                   makedev.d                     selinux
csh.cshrc                  man.config                    services
csh.login                  maven                         sestatus.conf
cups                       mime.types                    setuptool.d
dbus-1                     mke2fs.conf                   sgml
default                    modprobe.d                    shadow
depmod.d                   mosquitto                     shadow-
dhcp                       motd                          shells
DIR_COLORS                 mtab                          skel
DIR_COLORS.256color        my.cnf                        smartd.conf
DIR_COLORS.lightbgcolor    nanorc                        sos.conf
dracut.conf                netconfig                     sound
dracut.conf.d              NetworkManager                ssh
drirc                      networks                      ssl
elinks.conf                nfsmount.conf                 sssd
environment                nsswitch.conf                 statetab
ethers                     ntp                           statetab.d
event.d                    ntp.conf                      sudo.conf
exports                    numad.conf                    sudoers
favicon.png                oddjob                        sudoers.d
filesystems                oddjobd.conf                  sudo-ldap.conf
fonts                      oddjobd.conf.d                sysconfig
foomatic                   openldap                      sysctl.conf
fprintd.conf               opt                           system-release
fstab                      pam.d                         system-release-cpe
gai.conf                   pango                         terminfo
gconf                      passwd                        Trolltech.conf
gcrypt                     passwd-                       udev
ghostscript                pcmcia                        updatedb.conf
gnome-vfs-2.0              pinforc                       vimrc
gnupg                      pkcs11                        virc
group                      pki                           warnquota.conf
group-                     plymouth                      wgetrc
grub.conf                  pm                            X11
gshadow                    pm-utils-hd-apm-restore.conf  xdg
gshadow-                   polkit-1                      xinetd.d
gssapi_mech.conf           popt.d                        xml
gtk-2.0                    portreserve                   yp.conf
hal                        postfix                       yum
host.conf                  ppp                           yum.conf
hosts                      prelink.cache                 yum.repos.d
hosts.allow                prelink.conf
[root@dsch03 etc]# cd mosquitto
[root@dsch03 mosquitto]# ls
aclfile.example  mosquitto.conf.example  pskfile.example  pwfile.example
[root@dsch03 mosquitto]# sudo groupadd mosquitto
[root@dsch03 mosquitto]# sudo useradd -g mosquitto mosquitto
[root@dsch03 mosquitto]# mv /etc/mosquitto/mosquitto.conf.example /etc/mosquitto/mosquitto.conf

[root@dsch03 mosquitto]# mosquitto -c /etc/mosquitto/mosquitto.conf -d
1599733204: mosquitto version 1.4.5 (build date 2020-09-10 18:09:27+0800) starting
1599733204: Config loaded from /etc/mosquitto/mosquitto.conf.
1599733204: Opening ipv4 listen socket on port 1883.
[root@dsch03 mosquitto]# 1599733204: Opening ipv6 listen socket on port 1883.
1599733227: New connection from 192.XXXXX.xxxxxxon port 1883.
1599733227: New client connected from 192.XXXXX.xxxxx as cxxxxxxxxxx791517c (c1, k60, u'chXXXXXX').

mqtt。fx设置

linux下安装mosquito并用mqtt。fx测_第1张图片

发布:
linux下安装mosquito并用mqtt。fx测_第2张图片

订阅:
linux下安装mosquito并用mqtt。fx测_第3张图片

你可能感兴趣的:(mosquitto,mqtt,linux,物联网)