Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.26 KB | None | 0 0
  1. %%%
  2. %%% Debian ejabberd configuration file
  3. %%% This config must be in UTF-8 encoding
  4. %%%
  5. %%% The parameters used in this configuration file are explained in more detail
  6. %%% in the ejabberd Installation and Operation Guide.
  7. %%% Please consult the Guide in case of doubts, it is available at
  8. %%% /usr/share/doc/ejabberd/guide.html
  9.  
  10. %%% This configuration file contains Erlang terms.
  11. %%% In case you want to understand the syntax, here are the concepts:
  12. %%%
  13. %%% - The character to comment a line is %
  14. %%%
  15. %%% - Each term ends in a dot, for example:
  16. %%% override_global.
  17. %%%
  18. %%% - A tuple has a fixed definition, its elements are
  19. %%% enclosed in {}, and separated with commas:
  20. %%% {loglevel, 4}.
  21. %%%
  22. %%% - A list can have as many elements as you want,
  23. %%% and is enclosed in [], for example:
  24. %%% [http_poll, web_admin, tls]
  25. %%%
  26. %%% - A keyword of ejabberd is a word in lowercase.
  27. %%% The strings are enclosed in "" and can have spaces, dots...
  28. %%% {language, "en"}.
  29. %%% {ldap_rootdn, "dc=example,dc=com"}.
  30. %%%
  31. %%% - This term includes a tuple, a keyword, a list and two strings:
  32. %%% {hosts, ["jabber.example.net", "im.example.com"]}.
  33. %%%
  34.  
  35. %%% ===================================
  36. %%% OVERRIDE OPTIONS STORED IN DATABASE
  37.  
  38. %%
  39. %% Override global options (shared by all ejabberd nodes in a cluster).
  40. %%
  41. %%override_global.
  42.  
  43. %%
  44. %% Override local options (specific for this particular ejabberd node).
  45. %%
  46. %%override_local.
  47.  
  48. %%
  49. %% Remove the Access Control Lists before new ones are added.
  50. %%
  51. %%override_acls.
  52.  
  53.  
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. %% Options which are set by Debconf and managed by ucf
  56.  
  57. %% Admin user
  58. {acl, admin, {user, "", "localhost"}}.
  59.  
  60. %% Hostname
  61. {hosts, ["localhost", "private.localhost", "public.localhost"]}.
  62.  
  63. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  64.  
  65.  
  66. %%% =========
  67. %%% DEBUGGING
  68.  
  69. %%
  70. %% loglevel: Verbosity of log files generated by ejabberd.
  71. %% 0: No ejabberd log at all (not recommended)
  72. %% 1: Critical
  73. %% 2: Error
  74. %% 3: Warning
  75. %% 4: Info
  76. %% 5: Debug
  77. %%
  78. {loglevel, 4}.
  79.  
  80. %%
  81. %% watchdog_admins: If an ejabberd process consumes too much memory,
  82. %% send live notifications to those Jabber accounts.
  83. %%
  84. %%{watchdog_admins, ["bob@example.com"]}.
  85.  
  86.  
  87. %%% ================
  88. %%% SERVED HOSTNAMES
  89.  
  90. %%
  91. %% hosts: Domains served by ejabberd.
  92. %% You can define one or several, for example:
  93. %% {hosts, ["example.net", "example.com", "example.org"]}.
  94. %%
  95. %% (This option is defined by debconf earlier)
  96. %% {hosts, ["localhost"]}.
  97.  
  98. %%
  99. %% route_subdomains: Delegate subdomains to other Jabber server.
  100. %% For example, if this ejabberd serves example.org and you want
  101. %% to allow communication with a Jabber server called im.example.org.
  102. %%
  103. %%{route_subdomains, s2s}.
  104.  
  105.  
  106. %%% ===============
  107. %%% LISTENING PORTS
  108.  
  109. %%
  110. %% listen: Which ports will ejabberd listen, which service handles it
  111. %% and what options to start it with.
  112. %%
  113. {listen,
  114. [
  115. {5222, ejabberd_c2s, [
  116. {access, c2s},
  117. {shaper, c2s_shaper},
  118. {max_stanza_size, 2000000},
  119. %%zlib,
  120. starttls, {certfile, "/etc/ejabberd/ejabberd.pem"}
  121. ]},
  122.  
  123. %%
  124. %% To enable the old SSL connection method (deprecated) in port 5223:
  125. %%
  126. %%{5223, ejabberd_c2s, [
  127. %% {access, c2s},
  128. %% {shaper, c2s_shaper},
  129. %% {max_stanza_size, 2000000},
  130. %% zlib,
  131. %% tls, {certfile, "/etc/ejabberd/ejabberd.pem"}
  132. %% ]},
  133.  
  134. {5269, ejabberd_s2s_in, [
  135. {shaper, s2s_shaper},
  136. {max_stanza_size, 2000000}
  137. ]},
  138.  
  139. %% External MUC jabber-muc
  140. %%{5554, ejabberd_service, [
  141. %% {ip, {127, 0, 0, 1}},
  142. %% {access, all},
  143. %% {shaper_rule, fast},
  144. %% {host, "muc.localhost", [{password, "secret"}]}
  145. %% ]},
  146.  
  147. %% Jabber ICQ Transport
  148. %%{5555, ejabberd_service, [
  149. %% {ip, {127, 0, 0, 1}},
  150. %% {access, all},
  151. %% {shaper_rule, fast},
  152. %% {hosts, ["icq.localhost", "sms.localhost"],
  153. %% [{password, "secret"}]}
  154. %% ]},
  155.  
  156. %% AIM Transport
  157. %%{5556, ejabberd_service, [
  158. %% {ip, {127, 0, 0, 1}},
  159. %% {access, all},
  160. %% {shaper_rule, fast},
  161. %% {host, "aim.localhost", [{password, "secret"}]}
  162. %% ]},
  163.  
  164. %% MSN Transport
  165. %%{5557, ejabberd_service, [
  166. %% {ip, {127, 0, 0, 1}},
  167. %% {access, all},
  168. %% {shaper_rule, fast},
  169. %% {host, "msn.localhost", [{password, "secret"}]}
  170. %% ]},
  171.  
  172. %% Yahoo! Transport
  173. %%{5558, ejabberd_service, [
  174. %% {ip, {127, 0, 0, 1}},
  175. %% {access, all},
  176. %% {shaper_rule, fast},
  177. %% {host, "yahoo.localhost", [{password, "secret"}]}
  178. %% ]},
  179.  
  180. %% External JUD (internal is more powerful,
  181. %% but doesn't allow to register users from other servers)
  182. %%{5559, ejabberd_service, [
  183. %% {ip, {127, 0, 0, 1}},
  184. %% {access, all},
  185. %% {shaper_rule, fast},
  186. %% {host, "jud.localhost", [{password, "secret"}]}
  187. %% ]},
  188.  
  189. {5280, ejabberd_http, [
  190. %%{request_handlers,
  191. %% [
  192. %% {["pub", "archive"], mod_http_fileserver}
  193. %% ]},
  194. %%captcha,
  195. http_bind,
  196. http_poll,
  197. web_admin
  198. ]}
  199.  
  200. ]}.
  201.  
  202. %%
  203. %% max_fsm_queue: Enable limiting of lengths of "message queues"
  204. %% for outgoing connections. Roughly speaking, each message in such
  205. %% queues represents one XML stanza queued to be sent into
  206. %% an output stream it is serving.
  207. %% The default value is an atom 'undefined' which specifies no limiting.
  208. %%
  209. %% When specified globally, this option limits the message queue lengths
  210. %% for all ejabberd_c2s_in and ejabberd_service listeners,
  211. %% as well as for outgoing s2s connections.
  212. %%
  213. %% This option can also be specified as an option for ejabberd_c2s_in
  214. %% and ejabberd_service listeners, in wich case it will override
  215. %% the value of the global option.
  216. %%
  217. {max_fsm_queue, 1000}.
  218.  
  219. %%
  220. %% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
  221. %% Allowed values are: true or false.
  222. %% You must specify a certificate file.
  223. %%
  224. {s2s_use_starttls, true}.
  225.  
  226. %%
  227. %% s2s_certfile: Specify a certificate file.
  228. %%
  229. {s2s_certfile, "/etc/ejabberd/ejabberd.pem"}.
  230.  
  231. %%
  232. %% domain_certfile: Specify a different certificate for each served hostname.
  233. %%
  234. %%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
  235. %%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
  236.  
  237. %%
  238. %% S2S whitelist or blacklist
  239. %%
  240. %% Default s2s policy for undefined hosts.
  241. %%
  242. %%{s2s_default_policy, allow}.
  243.  
  244. %%
  245. %% Allow or deny communication with specific servers.
  246. %%
  247. %%{{s2s_host, "goodhost.org"}, allow}.
  248. %%{{s2s_host, "badhost.org"}, deny}.
  249.  
  250. %%
  251. %% The maximum allowed delay for retry to connect
  252. %% after a failed connection attempt to a remote server, in seconds.
  253. %% The default value is 300 seconds (5 minutes).
  254. %%
  255. %% The reconnection algorythm works like this: if connection fails,
  256. %% ejabberd makes an initial random delay between 1 and 15 seconds,
  257. %% then retries, and if this attempt fails, makes another delay,
  258. %% twice as long as previous. These attempts are performed either
  259. %% until a successful connection is made or until the next calculated
  260. %% delay is greated or equal than the value of s2s_max_retry_delay.
  261. %%
  262. %%{s2s_max_retry_delay, 300}.
  263.  
  264. %%
  265. %% Outgoing S2S options
  266. %%
  267. %% Preferred address families (which to try first) and connect timeout
  268. %% in milliseconds.
  269. %%
  270. %%{outgoing_s2s_options, [ipv4, ipv6], 10000}.
  271.  
  272.  
  273. %%% ==============
  274. %%% AUTHENTICATION
  275.  
  276. %%
  277. %% auth_method: Method used to authenticate the users.
  278. %% The default method is the internal.
  279. %% If you want to use a different method,
  280. %% comment this line and enable the correct ones.
  281. %%
  282. {auth_method, internal}.
  283.  
  284. %%
  285. %% Authentication using external script
  286. %% Make sure the script is executable by ejabberd.
  287. %%
  288. %%{auth_method, external}.
  289. %%{extauth_program, "/path/to/authentication/script"}.
  290.  
  291. %%
  292. %% Authentication using ODBC
  293. %% Remember to setup a database in the next section.
  294. %%
  295. %%{auth_method, odbc}.
  296.  
  297. %%
  298. %% Authentication using PAM
  299. %%
  300. %%{auth_method, pam}.
  301. %%{pam_service, "pamservicename"}.
  302.  
  303. %%
  304. %% Authentication using LDAP
  305. %%
  306. %%{auth_method, ldap}.
  307. %%
  308. %% List of LDAP servers:
  309. %%{ldap_servers, ["localhost"]}.
  310. %%
  311. %% Encryption of connection to LDAP servers (LDAPS):
  312. %%{ldap_encrypt, none}.
  313. %%{ldap_encrypt, tls}.
  314. %%
  315. %% Port connect to LDAP server:
  316. %%{ldap_port, 389}.
  317. %%{ldap_port, 636}.
  318. %%
  319. %% LDAP manager:
  320. %%{ldap_rootdn, "dc=example,dc=com"}.
  321. %%
  322. %% Password to LDAP manager:
  323. %%{ldap_password, "******"}.
  324. %%
  325. %% Search base of LDAP directory:
  326. %%{ldap_base, "dc=example,dc=com"}.
  327. %%
  328. %% LDAP attribute that holds user ID:
  329. %%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
  330. %%
  331. %% LDAP filter:
  332. %%{ldap_filter, "(objectClass=shadowAccount)"}.
  333.  
  334. %%
  335. %% Anonymous login support:
  336. %% auth_method: anonymous
  337. %% anonymous_protocol: sasl_anon | login_anon | both
  338. %% allow_multiple_connections: true | false
  339. %%
  340. %%{host_config, "public.example.org", [{auth_method, anonymous},
  341. %% {allow_multiple_connections, false},
  342. %% {anonymous_protocol, sasl_anon}]}.
  343. %%
  344. %% To use both anonymous and internal authentication:
  345. %%
  346. %%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
  347.  
  348.  
  349. %%% ==============
  350. %%% DATABASE SETUP
  351.  
  352. %% ejabberd uses by default the internal Mnesia database,
  353. %% so you can avoid this section.
  354. %% This section provides configuration examples in case
  355. %% you want to use other database backends.
  356. %% Please consult the ejabberd Guide for details about database creation.
  357.  
  358. %% NOTE that ejabberd in Debian supports "out of the box"
  359. %% only mnesia (default) and ODBC storage backends.
  360. %% Working with MySQL and PostgreSQL DB backends requires
  361. %% building and installation of the corresponding Erlang modules,
  362. %% not distributed as a part of ejabberd.
  363. %% Refer to /usr/share/doc/ejabberd/README.Debian for details.
  364.  
  365. %%
  366. %% MySQL server:
  367. %%
  368. %%{odbc_server, {mysql, "server", "database", "username", "password"}}.
  369. %%
  370. %% If you want to specify the port:
  371. %%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
  372.  
  373. %%
  374. %% PostgreSQL server:
  375. %%
  376. %%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
  377. %%
  378. %% If you want to specify the port:
  379. %%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
  380. %%
  381. %% If you use PostgreSQL, have a large database, and need a
  382. %% faster but inexact replacement for "select count(*) from users"
  383. %%
  384. %%{pgsql_users_number_estimate, true}.
  385.  
  386. %%
  387. %% ODBC compatible or MSSQL server:
  388. %%
  389. %%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
  390.  
  391. %%
  392. %% Number of connections to open to the database for each virtual host
  393. %%
  394. %%{odbc_pool_size, 10}.
  395.  
  396. %%
  397. %% Interval to make a dummy SQL request to keep alive the connections
  398. %% to the database. Specify in seconds: for example 28800 means 8 hours
  399. %%
  400. %%{odbc_keepalive_interval, undefined}.
  401.  
  402.  
  403. %%% ===============
  404. %%% TRAFFIC SHAPERS
  405.  
  406. %%
  407. %% The "normal" shaper limits traffic speed to 1.000 B/s
  408. %%
  409. {shaper, normal, {maxrate, 500000}}.
  410.  
  411. %%
  412. %% The "fast" shaper limits traffic speed to 50.000 B/s
  413. %%
  414. {shaper, fast, {maxrate, 500000}}.
  415.  
  416.  
  417. %%% ====================
  418. %%% ACCESS CONTROL LISTS
  419.  
  420. %%
  421. %% The 'admin' ACL grants administrative privileges to Jabber accounts.
  422. %% You can put as many accounts as you want.
  423. %%
  424. %%{acl, admin, {user, "aleksey", "localhost"}}.
  425. %%{acl, admin, {user, "ermine", "example.org"}}.
  426.  
  427. %%
  428. %% Blocked users
  429. %%
  430. %%{acl, blocked, {user, "baduser", "example.org"}}.
  431. %%{acl, blocked, {user, "test"}}.
  432.  
  433. %%
  434. %% Local users: don't modify this line.
  435. %%
  436. {acl, local, {user_regexp, ""}}.
  437.  
  438. %%
  439. %% More examples of ACLs
  440. %%
  441. %%{acl, jabberorg, {server, "jabber.org"}}.
  442. %%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
  443. %%{acl, test, {user_regexp, "^test"}}.
  444. %%{acl, test, {user_glob, "test*"}}.
  445.  
  446. %%
  447. %% Define specific ACLs in a virtual host.
  448. %%
  449. %%{host_config, "localhost",
  450. %% [
  451. %% {acl, admin, {user, "bob-local", "localhost"}}
  452. %% ]
  453. %%}.
  454.  
  455.  
  456. %%% ============
  457. %%% ACCESS RULES
  458.  
  459. %% Define the maximum number of time a single user is allowed to connect:
  460. {access, max_user_sessions, [{10000, all}]}.
  461.  
  462. %% Maximum number of offline messages that users can have:
  463. {access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
  464.  
  465. %% This rule allows access only for local users:
  466. {access, local, [{allow, local}]}.
  467.  
  468. %% Only non-blocked users can use c2s connections:
  469. {access, c2s, [{deny, blocked},
  470. {allow, all}]}.
  471.  
  472. %% For all users except admins used "normal" shaper
  473. {access, c2s_shaper, [{none, admin},
  474. {normal, all}]}.
  475.  
  476. %% For all S2S connections used "fast" shaper
  477. {access, s2s_shaper, [{fast, all}]}.
  478.  
  479. %% Only admins can send announcement messages:
  480. {access, announce, [{allow, admin}]}.
  481.  
  482. %% Only admins can use configuration interface:
  483. {access, configure, [{allow, admin}]}.
  484.  
  485. %% Admins of this server are also admins of MUC service:
  486. {access, muc_admin, [{allow, admin}]}.
  487.  
  488. %% All users are allowed to use MUC service:
  489. {access, muc, [{allow, all}]}.
  490.  
  491. %% No username can be registered via in-band registration:
  492. %% To enable in-band registration, replace 'deny' with 'allow'
  493. % (note that if you remove mod_register from modules list then users will not
  494. % be able to change their password as well as register).
  495. % This setting is default because it's more safe.
  496. {access, register, [{deny, all}]}.
  497.  
  498. %% By default frequency of account registrations from the same IP
  499. %% is limited to 1 account every 10 minutes. To disable put: infinity
  500. %%{registration_timeout, 600}.
  501.  
  502. %% Everybody can create pubsub nodes
  503. {access, pubsub_createnode, [{allow, all}]}.
  504.  
  505. %%
  506. %% Define specific Access rules in a virtual host.
  507. %%
  508. %%{host_config, "localhost",
  509. %% [
  510. %% {access, c2s, [{allow, admin}, {deny, all}]},
  511. %% {access, register, [{deny, all}]}
  512. %% ]
  513. %%}.
  514.  
  515.  
  516. %%% ================
  517. %%% DEFAULT LANGUAGE
  518.  
  519. %%
  520. %% language: Default language used for server messages.
  521. %%
  522. {language, "en"}.
  523.  
  524. %%
  525. %% Set a different default language in a virtual host.
  526. %%
  527. %%{host_config, "localhost",
  528. %% [{language, "ru"}]
  529. %%}.
  530.  
  531.  
  532. %%% =======
  533. %%% CAPTCHA
  534.  
  535. %%
  536. %% Full path to a script that generates the image.
  537. %% Note that this script must be made executable
  538. %% for the user ejabberd:ejabberd.
  539. %%
  540. %%{captcha_cmd, "/usr/lib/ejabberd/priv/bin/captcha.sh"}.
  541.  
  542. %%
  543. %% Host part of the URL sent to the user.
  544. %% The port specified must be configured as the "ejabberd_http"
  545. %% listener which must have the "captcha" directive included
  546. %% in its configuration (see the "LISTENING PORTS" section above).
  547. %%
  548. %%{captcha_host, "localhost:5280"}.
  549.  
  550.  
  551. %%% =======
  552. %%% MODULES
  553.  
  554. %%
  555. %% Modules enabled in all ejabberd virtual hosts.
  556. %%
  557. {modules,
  558. [
  559. {mod_adhoc, []},
  560. {mod_announce, [{access, announce}]}, % requires mod_adhoc
  561. {mod_caps, []},
  562. {mod_configure,[]}, % requires mod_adhoc
  563. {mod_admin_extra, []},
  564. {mod_disco, []},
  565. %%{mod_echo, [{host, "echo.localhost"}]},
  566. {mod_irc, []},
  567. %% NOTE that mod_http_fileserver must also be enabled in the
  568. %% "request_handlers" clause of the "ejabberd_http" listener
  569. %% configuration (see the "LISTENING PORTS" section above).
  570. %%{mod_http_fileserver, [
  571. %% {docroot, "/var/www"},
  572. %% {accesslog, "/var/log/ejabberd/access.log"}
  573. %% ]},
  574. {mod_last, []},
  575. {mod_muc, [
  576. %%{host, "conference.@HOST@"},
  577. {access, muc},
  578. {access_create, muc},
  579. {access_persistent, muc},
  580. {access_admin, muc_admin},
  581. {max_users, 500}
  582. ]},
  583. %%{mod_muc_log,[]},
  584. %%{mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
  585. {mod_privacy, []},
  586. {mod_private, []},
  587. {mod_proxy65, [
  588. {access, local},
  589. {shaper, c2s_shaper}
  590. ]},
  591. {mod_pubsub, [ % requires mod_caps
  592. {access_createnode, pubsub_createnode},
  593. {pep_sendlast_offline, false},
  594. {last_item_cache, false},
  595. %%{plugins, ["default", "pep"]}
  596. {plugins, ["flat", "hometree", "pep"]} % pep requires mod_caps
  597. ]},
  598. {mod_register, [
  599. %%
  600. %% After successful registration, the user receives
  601. %% a message with this subject and body.
  602. %%
  603. {welcome_message, {"Welcome!",
  604. "Welcome to a Jabber service powered by Debian. "
  605. "For information about Jabber visit "
  606. "http://www.jabber.org"}},
  607. %% Replace it with 'none' if you don't want to send such message:
  608. %%{welcome_message, none},
  609.  
  610. %%
  611. %% When a user registers, send a notification to
  612. %% these Jabber accounts.
  613. %%
  614. %%{registration_watchers, ["admin1@example.org"]},
  615.  
  616. {access, register}
  617. ]},
  618. {mod_roster, []},
  619. %%{mod_service_log,[]},
  620. %%{mod_shared_roster,[]},
  621. {mod_stats, []},
  622. {mod_time, []},
  623. {mod_vcard, []},
  624. {mod_version, []}
  625. ]}.
  626.  
  627. %%
  628. %% Enable modules with custom options in a specific virtual host
  629. %%
  630. %%{host_config, "localhost",
  631. %% [{{add, modules},
  632. %% [
  633. %% {mod_echo, [{host, "mirror.localhost"}]}
  634. %% ]
  635. %% }
  636. %% ]}.
  637.  
  638.  
  639. %%% $Id: ejabberd.cfg.example 2497 2009-08-17 20:27:28Z cromain $
  640.  
  641. %%% Local Variables:
  642. %%% mode: erlang
  643. %%% End:
  644. %%% vim: set filetype=erlang tabstop=8:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement