当前位置:   article > 正文

RabbitMQ 修改默认端口_rabbitmq修改默认端口

rabbitmq修改默认端口

一、配置环境变量

下载 erlang 和 rabbitMq

ERLANG_HOME
D:\erl8.2
path添加%ERLANG_HOME%\bin;
cmd下用erl -version检测是否配置成功

RabbitMQ Server安装包下载:http://www.rabbitmq.com/download.html

配置环境变量
RABBIT_HOME
D:\RabbitServer\rabbitmq_server-3.6.6
path添加%RABBIT_HOME%\sbin;

cmd下进入RabbitMQ Server目录下的sbin目录,用rabbitmqctl status检测RabbitMQ是否配置成功

二、rabbitmq管理界面开启

1、官方提供的一个web管理工具(rabbitmq_management)
              http://www.rabbitmq.com/management.html
2、安装了Rabbitmq后,默认也安装了该管理工具,执行命令即可启动
            rabbitmq-plugins enable rabbitmq_management(先定位到rabbitmq安装目录)  
            
3、启动后,直接在浏览器地址输入: http://localhost:15672/   账号密码都是:guest     ;
4、如果无法在web页打开管理界面,则继续按照以下方式操作:

使用管理员打开cmd执行此命令:net stop RabbitMQ && net start RabbitMQ

5、重新打开http://localhost:15672/ ,你会发现管理页面出来了。
 

三、修改端口

有两个目录,一个是安装目录,还有一个是输出目录,在输出目录的下面新建一个 rabbitmq.config文件即可。ps:我的版本是3.9.11

C:\Program Files\RabbitMQ Server\rabbitmq_server-3.9.11\etc\rabbitmq    安装目录

C:\Users\Administrator\AppData\Roaming\RabbitMQ                                   输出目录

  1. [{
  2. rabbit,
  3. [{
  4. tcp_listeners,
  5. [{"0.0.0.0",5672}]
  6. }]
  7. }, {
  8. rabbitmq_management,
  9. [{
  10. listener,
  11. [
  12. {port,15672},
  13. {ip,"0.0.0.0"},
  14. {ssl,false}
  15. ]
  16. }]
  17. }].

 其次,修改了配置文件后,

  rabbitmq-service stop

  rabbitmq-service remove

  rabbitmq-service install

  rabbitmq-service start

5. . 如果config有问题,服务是启动不起来的,而且错误信息也是很难发现的,我最先就是那个端口后面那个逗号没有去掉,结果启动出错,又不知道错误原因,很难排查。

 附:配置文件(这个太多,直接用上面的就行)

  1. %% -*- mode: erlang -*-
  2. %% ----------------------------------------------------------------------------
  3. %% RabbitMQ Sample Configuration File.
  4. %%
  5. %% See http://www.rabbitmq.com/configure.html for details.
  6. %% ----------------------------------------------------------------------------
  7. [
  8. {rabbit,
  9. [%%
  10. %% Network Connectivity
  11. %% ====================
  12. %%
  13. %% By default, RabbitMQ will listen on all interfaces, using
  14. %% the standard (reserved) AMQP port.
  15. %%
  16. %% {tcp_listeners, [5672]},
  17. %% To listen on a specific interface, provide a tuple of {IpAddress, Port}.
  18. %% For example, to listen only on localhost for both IPv4 and IPv6:
  19. %%
  20. %% {tcp_listeners, [{"127.0.0.1", 5672},
  21. %% {"::1", 5672}]},
  22. %% SSL listeners are configured in the same fashion as TCP listeners,
  23. %% including the option to control the choice of interface.
  24. %%
  25. %% {ssl_listeners, [5671]},
  26. %% Number of Erlang processes that will accept connections for the TCP
  27. %% and SSL listeners.
  28. %%
  29. %% {num_tcp_acceptors, 10},
  30. %% {num_ssl_acceptors, 1},
  31. %% Maximum time for AMQP 0-8/0-9/0-9-1 handshake (after socket connection
  32. %% and SSL handshake), in milliseconds.
  33. %%
  34. %% {handshake_timeout, 10000},
  35. %% Log levels (currently just used for connection logging).
  36. %% One of 'debug', 'info', 'warning', 'error' or 'none', in decreasing
  37. %% order of verbosity. Defaults to 'info'.
  38. %%
  39. {log_levels, [{connection, error}, {channel, error}]}
  40. %% Set to 'true' to perform reverse DNS lookups when accepting a
  41. %% connection. Hostnames will then be shown instead of IP addresses
  42. %% in rabbitmqctl and the management plugin.
  43. %%
  44. %% {reverse_dns_lookups, true},
  45. %%
  46. %% Security / AAA
  47. %% ==============
  48. %%
  49. %% The default "guest" user is only permitted to access the server
  50. %% via a loopback interface (e.g. localhost).
  51. %% {loopback_users, [<<"guest">>]},
  52. %%
  53. %% Uncomment the following line if you want to allow access to the
  54. %% guest user from anywhere on the network.
  55. %% {loopback_users, []},
  56. %% Configuring SSL.
  57. %% See http://www.rabbitmq.com/ssl.html for full documentation.
  58. %%
  59. %% {ssl_options, [{cacertfile, "/path/to/testca/cacert.pem"},
  60. %% {certfile, "/path/to/server/cert.pem"},
  61. %% {keyfile, "/path/to/server/key.pem"},
  62. %% {verify, verify_peer},
  63. %% {fail_if_no_peer_cert, false}]},
  64. %% Choose the available SASL mechanism(s) to expose.
  65. %% The two default (built in) mechanisms are 'PLAIN' and
  66. %% 'AMQPLAIN'. Additional mechanisms can be added via
  67. %% plugins.
  68. %%
  69. %% See http://www.rabbitmq.com/authentication.html for more details.
  70. %%
  71. %% {auth_mechanisms, ['PLAIN', 'AMQPLAIN']},
  72. %% Select an authentication database to use. RabbitMQ comes bundled
  73. %% with a built-in auth-database, based on mnesia.
  74. %%
  75. %% {auth_backends, [rabbit_auth_backend_internal]},
  76. %% Configurations supporting the rabbitmq_auth_mechanism_ssl and
  77. %% rabbitmq_auth_backend_ldap plugins.
  78. %%
  79. %% NB: These options require that the relevant plugin is enabled.
  80. %% See http://www.rabbitmq.com/plugins.html for further details.
  81. %% The RabbitMQ-auth-mechanism-ssl plugin makes it possible to
  82. %% authenticate a user based on the client's SSL certificate.
  83. %%
  84. %% To use auth-mechanism-ssl, add to or replace the auth_mechanisms
  85. %% list with the entry 'EXTERNAL'.
  86. %%
  87. %% {auth_mechanisms, ['EXTERNAL']},
  88. %% The rabbitmq_auth_backend_ldap plugin allows the broker to
  89. %% perform authentication and authorisation by deferring to an
  90. %% external LDAP server.
  91. %%
  92. %% For more information about configuring the LDAP backend, see
  93. %% http://www.rabbitmq.com/ldap.html.
  94. %%
  95. %% Enable the LDAP auth backend by adding to or replacing the
  96. %% auth_backends entry:
  97. %%
  98. %% {auth_backends, [rabbit_auth_backend_ldap]},
  99. %% This pertains to both the rabbitmq_auth_mechanism_ssl plugin and
  100. %% STOMP ssl_cert_login configurations. See the rabbitmq_stomp
  101. %% configuration section later in this file and the README in
  102. %% https://github.com/rabbitmq/rabbitmq-auth-mechanism-ssl for further
  103. %% details.
  104. %%
  105. %% To use the SSL cert's CN instead of its DN as the username
  106. %%
  107. %% {ssl_cert_login_from, common_name},
  108. %% SSL handshake timeout, in milliseconds.
  109. %%
  110. %% {ssl_handshake_timeout, 5000},
  111. %% Password hashing implementation. Will only affect newly
  112. %% created users. To recalculate hash for an existing user
  113. %% it's necessary to update her password.
  114. %%
  115. %% {password_hashing_module, rabbit_password_hashing_sha256},
  116. %% Configuration entry encryption.
  117. %% See http://www.rabbitmq.com/configure.html#configuration-encryption
  118. %%
  119. %% To specify the passphrase in the configuration file:
  120. %%
  121. %% {config_entry_decoder, [{passphrase, <<"mypassphrase">>}]}
  122. %%
  123. %% To specify the passphrase in an external file:
  124. %%
  125. %% {config_entry_decoder, [{passphrase, {file, "/path/to/passphrase/file"}}]}
  126. %%
  127. %% To make the broker request the passphrase when it starts:
  128. %%
  129. %% {config_entry_decoder, [{passphrase, prompt}]}
  130. %%
  131. %% To change encryption settings:
  132. %%
  133. %% {config_entry_decoder, [{cipher, aes_cbc256},
  134. %% {hash, sha512},
  135. %% {iterations, 1000}]}
  136. %%
  137. %% Default User / VHost
  138. %% ====================
  139. %%
  140. %% On first start RabbitMQ will create a vhost and a user. These
  141. %% config items control what gets created. See
  142. %% http://www.rabbitmq.com/access-control.html for further
  143. %% information about vhosts and access control.
  144. %%
  145. %% {default_vhost, <<"/">>},
  146. %% {default_user, <<"guest">>},
  147. %% {default_pass, <<"guest">>},
  148. %% {default_permissions, [<<".*">>, <<".*">>, <<".*">>]},
  149. %% Tags for default user
  150. %%
  151. %% For more details about tags, see the documentation for the
  152. %% Management Plugin at http://www.rabbitmq.com/management.html.
  153. %%
  154. %% {default_user_tags, [administrator]},
  155. %%
  156. %% Additional network and protocol related configuration
  157. %% =====================================================
  158. %%
  159. %% Set the default AMQP heartbeat delay (in seconds).
  160. %%
  161. %% {heartbeat, 60},
  162. %% Set the max permissible size of an AMQP frame (in bytes).
  163. %%
  164. %% {frame_max, 131072},
  165. %% Set the max frame size the server will accept before connection
  166. %% tuning occurs
  167. %%
  168. %% {initial_frame_max, 4096},
  169. %% Set the max permissible number of channels per connection.
  170. %% 0 means "no limit".
  171. %%
  172. %% {channel_max, 128},
  173. %% Customising Socket Options.
  174. %%
  175. %% See (http://www.erlang.org/doc/man/inet.html#setopts-2) for
  176. %% further documentation.
  177. %%
  178. %% {tcp_listen_options, [{backlog, 128},
  179. %% {nodelay, true},
  180. %% {exit_on_close, false}]},
  181. %%
  182. %% Resource Limits & Flow Control
  183. %% ==============================
  184. %%
  185. %% See http://www.rabbitmq.com/memory.html for full details.
  186. %% Memory-based Flow Control threshold.
  187. %%
  188. %% {vm_memory_high_watermark, 0.4},
  189. %% Alternatively, we can set a limit (in bytes) of RAM used by the node.
  190. %%
  191. %% {vm_memory_high_watermark, {absolute, 1073741824}},
  192. %%
  193. %% Or you can set absolute value using memory units.
  194. %%
  195. %% {vm_memory_high_watermark, {absolute, "1024M"}},
  196. %%
  197. %% Supported units suffixes:
  198. %%
  199. %% k, kiB: kibibytes (2^10 bytes)
  200. %% M, MiB: mebibytes (2^20)
  201. %% G, GiB: gibibytes (2^30)
  202. %% kB: kilobytes (10^3)
  203. %% MB: megabytes (10^6)
  204. %% GB: gigabytes (10^9)
  205. %% Fraction of the high watermark limit at which queues start to
  206. %% page message out to disc in order to free up memory.
  207. %%
  208. %% Values greater than 0.9 can be dangerous and should be used carefully.
  209. %%
  210. %% {vm_memory_high_watermark_paging_ratio, 0.5},
  211. %% Interval (in milliseconds) at which we perform the check of the memory
  212. %% levels against the watermarks.
  213. %%
  214. %% {memory_monitor_interval, 2500},
  215. %% Set disk free limit (in bytes). Once free disk space reaches this
  216. %% lower bound, a disk alarm will be set - see the documentation
  217. %% listed above for more details.
  218. %%
  219. %% {disk_free_limit, 50000000},
  220. %%
  221. %% Or you can set it using memory units (same as in vm_memory_high_watermark)
  222. %% {disk_free_limit, "50MB"},
  223. %% {disk_free_limit, "50000kB"},
  224. %% {disk_free_limit, "2GB"},
  225. %% Alternatively, we can set a limit relative to total available RAM.
  226. %%
  227. %% Values lower than 1.0 can be dangerous and should be used carefully.
  228. %% {disk_free_limit, {mem_relative, 2.0}},
  229. %%
  230. %% Misc/Advanced Options
  231. %% =====================
  232. %%
  233. %% NB: Change these only if you understand what you are doing!
  234. %%
  235. %% To announce custom properties to clients on connection:
  236. %%
  237. %% {server_properties, []},
  238. %% How to respond to cluster partitions.
  239. %% See http://www.rabbitmq.com/partitions.html for further details.
  240. %%
  241. %% {cluster_partition_handling, ignore},
  242. %% Make clustering happen *automatically* at startup - only applied
  243. %% to nodes that have just been reset or started for the first time.
  244. %% See http://www.rabbitmq.com/clustering.html#auto-config for
  245. %% further details.
  246. %%
  247. %% {cluster_nodes, {['rabbit@my.host.com'], disc}},
  248. %% Interval (in milliseconds) at which we send keepalive messages
  249. %% to other cluster members. Note that this is not the same thing
  250. %% as net_ticktime; missed keepalive messages will not cause nodes
  251. %% to be considered down.
  252. %%
  253. %% {cluster_keepalive_interval, 10000},
  254. %% Set (internal) statistics collection granularity.
  255. %%
  256. %% {collect_statistics, none},
  257. %% Statistics collection interval (in milliseconds).
  258. %%
  259. %% {collect_statistics_interval, 5000},
  260. %% Explicitly enable/disable hipe compilation.
  261. %%
  262. %% {hipe_compile, true},
  263. %% Timeout used when waiting for Mnesia tables in a cluster to
  264. %% become available.
  265. %%
  266. %% {mnesia_table_loading_timeout, 30000},
  267. %% Size in bytes below which to embed messages in the queue index. See
  268. %% http://www.rabbitmq.com/persistence-conf.html
  269. %%
  270. %% {queue_index_embed_msgs_below, 4096}
  271. ]},
  272. %% ----------------------------------------------------------------------------
  273. %% Advanced Erlang Networking/Clustering Options.
  274. %%
  275. %% See http://www.rabbitmq.com/clustering.html for details
  276. %% ----------------------------------------------------------------------------
  277. {kernel,
  278. [%% Sets the net_kernel tick time.
  279. %% Please see http://erlang.org/doc/man/kernel_app.html and
  280. %% http://www.rabbitmq.com/nettick.html for further details.
  281. %%
  282. %% {net_ticktime, 60}
  283. ]},
  284. %% ----------------------------------------------------------------------------
  285. %% RabbitMQ Management Plugin
  286. %%
  287. %% See http://www.rabbitmq.com/management.html for details
  288. %% ----------------------------------------------------------------------------
  289. {rabbitmq_management,
  290. [%% Pre-Load schema definitions from the following JSON file. See
  291. %% http://www.rabbitmq.com/management.html#load-definitions
  292. %%
  293. %% {load_definitions, "/path/to/schema.json"},
  294. %% Log all requests to the management HTTP API to a file.
  295. %%
  296. %% {http_log_dir, "/path/to/access.log"},
  297. %% Change the port on which the HTTP listener listens,
  298. %% specifying an interface for the web server to bind to.
  299. %% Also set the listener to use SSL and provide SSL options.
  300. %%
  301. {listener, [{port, 9080}
  302. %% {ip, "127.0.0.1"},
  303. %% {ssl, true},
  304. %% {ssl_opts, [{cacertfile, "/path/to/cacert.pem"},
  305. %% {certfile, "/path/to/cert.pem"},
  306. %% {keyfile, "/path/to/key.pem"}]}]},
  307. %% One of 'basic', 'detailed' or 'none'. See
  308. %% http://www.rabbitmq.com/management.html#fine-stats for more details.
  309. %% {rates_mode, basic},
  310. %% Configure how long aggregated data (such as message rates and queue
  311. %% lengths) is retained. Please read the plugin's documentation in
  312. %% http://www.rabbitmq.com/management.html#configuration for more
  313. %% details.
  314. %%
  315. %% {sample_retention_policies,
  316. %% [{global, [{60, 5}, {3600, 60}, {86400, 1200}]},
  317. %% {basic, [{60, 5}, {3600, 60}]},
  318. %% {detailed, [{10, 5}]}]}
  319. ]},
  320. %% ----------------------------------------------------------------------------
  321. %% RabbitMQ Shovel Plugin
  322. %%
  323. %% See http://www.rabbitmq.com/shovel.html for details
  324. %% ----------------------------------------------------------------------------
  325. {rabbitmq_shovel,
  326. [{shovels,
  327. [%% A named shovel worker.
  328. %% {my_first_shovel,
  329. %% [
  330. %% List the source broker(s) from which to consume.
  331. %%
  332. %% {sources,
  333. %% [%% URI(s) and pre-declarations for all source broker(s).
  334. %% {brokers, ["amqp://user:password@host.domain/my_vhost"]},
  335. %% {declarations, []}
  336. %% ]},
  337. %% List the destination broker(s) to publish to.
  338. %% {destinations,
  339. %% [%% A singular version of the 'brokers' element.
  340. %% {broker, "amqp://"},
  341. %% {declarations, []}
  342. %% ]},
  343. %% Name of the queue to shovel messages from.
  344. %%
  345. %% {queue, <<"your-queue-name-goes-here">>},
  346. %% Optional prefetch count.
  347. %%
  348. %% {prefetch_count, 10},
  349. %% when to acknowledge messages:
  350. %% - no_ack: never (auto)
  351. %% - on_publish: after each message is republished
  352. %% - on_confirm: when the destination broker confirms receipt
  353. %%
  354. %% {ack_mode, on_confirm},
  355. %% Overwrite fields of the outbound basic.publish.
  356. %%
  357. %% {publish_fields, [{exchange, <<"my_exchange">>},
  358. %% {routing_key, <<"from_shovel">>}]},
  359. %% Static list of basic.properties to set on re-publication.
  360. %%
  361. %% {publish_properties, [{delivery_mode, 2}]},
  362. %% The number of seconds to wait before attempting to
  363. %% reconnect in the event of a connection failure.
  364. %%
  365. %% {reconnect_delay, 2.5}
  366. %% ]} %% End of my_first_shovel
  367. ]}
  368. %% Rather than specifying some values per-shovel, you can specify
  369. %% them for all shovels here.
  370. %%
  371. %% {defaults, [{prefetch_count, 0},
  372. %% {ack_mode, on_confirm},
  373. %% {publish_fields, []},
  374. %% {publish_properties, [{delivery_mode, 2}]},
  375. %% {reconnect_delay, 2.5}]}
  376. ]},
  377. %% ----------------------------------------------------------------------------
  378. %% RabbitMQ Stomp Adapter
  379. %%
  380. %% See http://www.rabbitmq.com/stomp.html for details
  381. %% ----------------------------------------------------------------------------
  382. {rabbitmq_stomp,
  383. [%% Network Configuration - the format is generally the same as for the broker
  384. %% Listen only on localhost (ipv4 & ipv6) on a specific port.
  385. %% {tcp_listeners, [{"127.0.0.1", 61613},
  386. %% {"::1", 61613}]},
  387. %% Listen for SSL connections on a specific port.
  388. %% {ssl_listeners, [61614]},
  389. %% Number of Erlang processes that will accept connections for the TCP
  390. %% and SSL listeners.
  391. %%
  392. %% {num_tcp_acceptors, 10},
  393. %% {num_ssl_acceptors, 1},
  394. %% Additional SSL options
  395. %% Extract a name from the client's certificate when using SSL.
  396. %%
  397. %% {ssl_cert_login, true},
  398. %% Set a default user name and password. This is used as the default login
  399. %% whenever a CONNECT frame omits the login and passcode headers.
  400. %%
  401. %% Please note that setting this will allow clients to connect without
  402. %% authenticating!
  403. %%
  404. %% {default_user, [{login, "guest"},
  405. %% {passcode, "guest"}]},
  406. %% If a default user is configured, or you have configured use SSL client
  407. %% certificate based authentication, you can choose to allow clients to
  408. %% omit the CONNECT frame entirely. If set to true, the client is
  409. %% automatically connected as the default user or user supplied in the
  410. %% SSL certificate whenever the first frame sent on a session is not a
  411. %% CONNECT frame.
  412. %%
  413. %% {implicit_connect, true}
  414. ]},
  415. %% ----------------------------------------------------------------------------
  416. %% RabbitMQ MQTT Adapter
  417. %%
  418. %% See https://github.com/rabbitmq/rabbitmq-mqtt/blob/stable/README.md
  419. %% for details
  420. %% ----------------------------------------------------------------------------
  421. {rabbitmq_mqtt,
  422. [%% Set the default user name and password. Will be used as the default login
  423. %% if a connecting client provides no other login details.
  424. %%
  425. %% Please note that setting this will allow clients to connect without
  426. %% authenticating!
  427. %%
  428. %% {default_user, <<"guest">>},
  429. %% {default_pass, <<"guest">>},
  430. %% Enable anonymous access. If this is set to false, clients MUST provide
  431. %% login information in order to connect. See the default_user/default_pass
  432. %% configuration elements for managing logins without authentication.
  433. %%
  434. %% {allow_anonymous, true},
  435. %% If you have multiple chosts, specify the one to which the
  436. %% adapter connects.
  437. %%
  438. %% {vhost, <<"/">>},
  439. %% Specify the exchange to which messages from MQTT clients are published.
  440. %%
  441. %% {exchange, <<"amq.topic">>},
  442. %% Specify TTL (time to live) to control the lifetime of non-clean sessions.
  443. %%
  444. %% {subscription_ttl, 1800000},
  445. %% Set the prefetch count (governing the maximum number of unacknowledged
  446. %% messages that will be delivered).
  447. %%
  448. %% {prefetch, 10},
  449. %% TCP/SSL Configuration (as per the broker configuration).
  450. %%
  451. %% {tcp_listeners, [1883]},
  452. %% {ssl_listeners, []},
  453. %% Number of Erlang processes that will accept connections for the TCP
  454. %% and SSL listeners.
  455. %%
  456. %% {num_tcp_acceptors, 10},
  457. %% {num_ssl_acceptors, 1},
  458. %% TCP/Socket options (as per the broker configuration).
  459. %%
  460. %% {tcp_listen_options, [{backlog, 128},
  461. %% {nodelay, true}]}
  462. ]},
  463. %% ----------------------------------------------------------------------------
  464. %% RabbitMQ AMQP 1.0 Support
  465. %%
  466. %% See https://github.com/rabbitmq/rabbitmq-amqp1.0/blob/stable/README.md
  467. %% for details
  468. %% ----------------------------------------------------------------------------
  469. {rabbitmq_amqp1_0,
  470. [%% Connections that are not authenticated with SASL will connect as this
  471. %% account. See the README for more information.
  472. %%
  473. %% Please note that setting this will allow clients to connect without
  474. %% authenticating!
  475. %%
  476. %% {default_user, "guest"},
  477. %% Enable protocol strict mode. See the README for more information.
  478. %%
  479. %% {protocol_strict_mode, false}
  480. ]},
  481. %% ----------------------------------------------------------------------------
  482. %% RabbitMQ LDAP Plugin
  483. %%
  484. %% See http://www.rabbitmq.com/ldap.html for details.
  485. %%
  486. %% ----------------------------------------------------------------------------
  487. {rabbitmq_auth_backend_ldap,
  488. [%%
  489. %% Connecting to the LDAP server(s)
  490. %% ================================
  491. %%
  492. %% Specify servers to bind to. You *must* set this in order for the plugin
  493. %% to work properly.
  494. %%
  495. %% {servers, ["your-server-name-goes-here"]},
  496. %% Connect to the LDAP server using SSL
  497. %%
  498. %% {use_ssl, false},
  499. %% Specify the LDAP port to connect to
  500. %%
  501. %% {port, 389},
  502. %% LDAP connection timeout, in milliseconds or 'infinity'
  503. %%
  504. %% {timeout, infinity},
  505. %% Enable logging of LDAP queries.
  506. %% One of
  507. %% - false (no logging is performed)
  508. %% - true (verbose logging of the logic used by the plugin)
  509. %% - network (as true, but additionally logs LDAP network traffic)
  510. %%
  511. %% Defaults to false.
  512. %%
  513. %% {log, false},
  514. %%
  515. %% Authentication
  516. %% ==============
  517. %%
  518. %% Pattern to convert the username given through AMQP to a DN before
  519. %% binding
  520. %%
  521. %% {user_dn_pattern, "cn=${username},ou=People,dc=example,dc=com"},
  522. %% Alternatively, you can convert a username to a Distinguished
  523. %% Name via an LDAP lookup after binding. See the documentation for
  524. %% full details.
  525. %% When converting a username to a dn via a lookup, set these to
  526. %% the name of the attribute that represents the user name, and the
  527. %% base DN for the lookup query.
  528. %%
  529. %% {dn_lookup_attribute, "userPrincipalName"},
  530. %% {dn_lookup_base, "DC=gopivotal,DC=com"},
  531. %% Controls how to bind for authorisation queries and also to
  532. %% retrieve the details of users logging in without presenting a
  533. %% password (e.g., SASL EXTERNAL).
  534. %% One of
  535. %% - as_user (to bind as the authenticated user - requires a password)
  536. %% - anon (to bind anonymously)
  537. %% - {UserDN, Password} (to bind with a specified user name and password)
  538. %%
  539. %% Defaults to 'as_user'.
  540. %%
  541. %% {other_bind, as_user},
  542. %%
  543. %% Authorisation
  544. %% =============
  545. %%
  546. %% The LDAP plugin can perform a variety of queries against your
  547. %% LDAP server to determine questions of authorisation. See
  548. %% http://www.rabbitmq.com/ldap.html#authorisation for more
  549. %% information.
  550. %% Set the query to use when determining vhost access
  551. %%
  552. %% {vhost_access_query, {in_group,
  553. %% "ou=${vhost}-users,ou=vhosts,dc=example,dc=com"}},
  554. %% Set the query to use when determining resource (e.g., queue) access
  555. %%
  556. %% {resource_access_query, {constant, true}},
  557. %% Set queries to determine which tags a user has
  558. %%
  559. %% {tag_queries, []}
  560. ]}
  561. ].

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/558295
推荐阅读
相关标签
  

闽ICP备14008679号