Advertisement
Guest User

Untitled

a guest
Oct 1st, 2011
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.90 KB | None | 0 0
  1. %%%
  2. %%% ejabberd configuration file
  3. %%%
  4. %%%'
  5.  
  6. %%% The parameters used in this configuration file are explained in more detail
  7. %%% in the ejabberd Installation and Operation Guide.
  8. %%% Please consult the Guide in case of doubts, it is included with
  9. %%% your copy of ejabberd, and is also available online at
  10. %%% http://www.process-one.net/en/ejabberd/docs/
  11.  
  12. %%% This configuration file contains Erlang terms.
  13. %%% In case you want to understand the syntax, here are the concepts:
  14. %%%
  15. %%% - The character to comment a line is %
  16. %%%
  17. %%% - Each term ends in a dot, for example:
  18. %%% override_global.
  19. %%%
  20. %%% - A tuple has a fixed definition, its elements are
  21. %%% enclosed in {}, and separated with commas:
  22. %%% {loglevel, 4}.
  23. %%%
  24. %%% - A list can have as many elements as you want,
  25. %%% and is enclosed in [], for example:
  26. %%% [http_poll, web_admin, tls]
  27. %%%
  28. %%% - A keyword of ejabberd is a word in lowercase.
  29. %%% Strings are enclosed in "" and can contain spaces, dots, ...
  30. %%% {language, "en"}.
  31. %%% {ldap_rootdn, "dc=example,dc=com"}.
  32. %%%
  33. %%% - This term includes a tuple, a keyword, a list, and two strings:
  34. %%% {hosts, ["jabber.example.net", "im.example.com"]}.
  35. %%%
  36.  
  37.  
  38. %%%. =======================
  39. %%%' OVERRIDE STORED OPTIONS
  40.  
  41. %%
  42. %% Override the old values stored in the database.
  43. %%
  44.  
  45. %%
  46. %% Override global options (shared by all ejabberd nodes in a cluster).
  47. %%
  48. %%override_global.
  49.  
  50. %%
  51. %% Override local options (specific for this particular ejabberd node).
  52. %%
  53. %%override_local.
  54.  
  55. %%
  56. %% Remove the Access Control Lists before new ones are added.
  57. %%
  58. %%override_acls.
  59.  
  60.  
  61. %%%. =========
  62. %%%' DEBUGGING
  63.  
  64. %%
  65. %% loglevel: Verbosity of log files generated by ejabberd.
  66. %% 0: No ejabberd log at all (not recommended)
  67. %% 1: Critical
  68. %% 2: Error
  69. %% 3: Warning
  70. %% 4: Info
  71. %% 5: Debug
  72. %%
  73. {loglevel, 4}.
  74.  
  75. %%
  76. %% watchdog_admins: Only useful for developers: if an ejabberd process
  77. %% consumes a lot of memory, send live notifications to these XMPP
  78. %% accounts.
  79. %%
  80. %%{watchdog_admins, ["[email protected]"]}.
  81.  
  82.  
  83. %%%. ================
  84. %%%' SERVED HOSTNAMES
  85.  
  86. %%
  87. %% hosts: Domains served by ejabberd.
  88. %% You can define one or several, for example:
  89. %% {hosts, ["example.net", "example.com", "example.org"]}.
  90. %%
  91. {hosts, ["localhost", "sccups.com"]}.
  92.  
  93. %%
  94. %% route_subdomains: Delegate subdomains to other XMPP servers.
  95. %% For example, if this ejabberd serves example.org and you want
  96. %% to allow communication with an XMPP server called im.example.org.
  97. %%
  98. %%{route_subdomains, s2s}.
  99.  
  100.  
  101. %%%. ===============
  102. %%%' LISTENING PORTS
  103.  
  104. %%
  105. %% listen: The ports ejabberd will listen on, which service each is handled
  106. %% by and what options to start it with.
  107. %%
  108. {listen,
  109. [
  110.  
  111. {5222, ejabberd_c2s, [
  112.  
  113. %%
  114. %% If TLS is compiled in and you installed a SSL
  115. %% certificate, specify the full path to the
  116. %% file and uncomment this line:
  117. %%
  118. %%{certfile, "/etc/ejabberd/ejabberd.pem"}, starttls,
  119.  
  120. {access, c2s},
  121. {shaper, c2s_shaper},
  122. {max_stanza_size, 65536}
  123. ]},
  124.  
  125. %%
  126. %% To enable the old SSL connection method on port 5223:
  127. %%
  128. %%{5223, ejabberd_c2s, [
  129. %% {access, c2s},
  130. %% {shaper, c2s_shaper},
  131. %% {certfile, "/etc/ejabberd/ejabberd.pem"}, tls,
  132. %% {max_stanza_size, 65536}
  133. %% ]},
  134.  
  135. {5269, ejabberd_s2s_in, [
  136. {shaper, s2s_shaper},
  137. {max_stanza_size, 131072}
  138. ]},
  139.  
  140. %%
  141. %% ejabberd_service: Interact with external components (transports, ...)
  142. %%
  143. %%{8888, ejabberd_service, [
  144. %% {access, all},
  145. %% {shaper_rule, fast},
  146. %% {ip, {127, 0, 0, 1}},
  147. %% {hosts, ["icq.example.org", "sms.example.org"],
  148. %% [{password, "secret"}]
  149. %% }
  150. %% ]},
  151.  
  152. %%
  153. %% ejabberd_stun: Handles STUN Binding requests
  154. %%
  155. %%{{3478, udp}, ejabberd_stun, []},
  156.  
  157. {5280, ejabberd_http, [
  158. %%{request_handlers,
  159. %% [
  160. %% {["pub", "archive"], mod_http_fileserver}
  161. %% ]},
  162. captcha,
  163. http_bind,
  164. http_poll,
  165. %%register,
  166. web_admin
  167. ]}
  168.  
  169. ]}.
  170.  
  171. %%
  172. %% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
  173. %% Allowed values are: false optional required required_trusted
  174. %% You must specify a certificate file.
  175. %%
  176. %%{s2s_use_starttls, optional}.
  177.  
  178. %%
  179. %% s2s_certfile: Specify a certificate file.
  180. %%
  181. %%{s2s_certfile, "/etc/ejabberd/ejabberd.pem"}.
  182.  
  183. %%
  184. %% domain_certfile: Specify a different certificate for each served hostname.
  185. %%
  186. %%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
  187. %%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
  188.  
  189. %%
  190. %% S2S whitelist or blacklist
  191. %%
  192. %% Default s2s policy for undefined hosts.
  193. %%
  194. %%{s2s_default_policy, allow}.
  195.  
  196. %%
  197. %% Allow or deny communication with specific servers.
  198. %%
  199. %%{{s2s_host, "goodhost.org"}, allow}.
  200. %%{{s2s_host, "badhost.org"}, deny}.
  201.  
  202. %%
  203. %% Outgoing S2S options
  204. %%
  205. %% Preferred address families (which to try first) and connect timeout
  206. %% in milliseconds.
  207. %%
  208. %%{outgoing_s2s_options, [ipv4, ipv6], 10000}.
  209.  
  210.  
  211. %%%. ==============
  212. %%%' AUTHENTICATION
  213.  
  214. %%
  215. %% auth_method: Method used to authenticate the users.
  216. %% The default method is the internal.
  217. %% If you want to use a different method,
  218. %% comment this line and enable the correct ones.
  219. %%
  220. %%{auth_method, internal}.
  221.  
  222. %%
  223. %% Authentication using external script
  224. %% Make sure the script is executable by ejabberd.
  225. %%
  226. {auth_method, external}.
  227. {extauth_program, "/etc/ejabberd/sccupsMysql.php"}.
  228.  
  229. %%
  230. %% Authentication using ODBC
  231. %% Remember to setup a database in the next section.
  232. %%
  233. %%{auth_method, odbc}.
  234.  
  235. %%
  236. %% Authentication using PAM
  237. %%
  238. %%{auth_method, pam}.
  239. %%{pam_service, "ejabberd"}.
  240.  
  241. %%
  242. %% Authentication using LDAP
  243. %%
  244. %%{auth_method, ldap}.
  245. %%
  246. %% List of LDAP servers:
  247. %%{ldap_servers, ["localhost"]}.
  248. %%
  249. %% Encryption of connection to LDAP servers:
  250. %%{ldap_encrypt, none}.
  251. %%{ldap_encrypt, tls}.
  252. %%
  253. %% Port to connect to on LDAP servers:
  254. %%{ldap_port, 389}.
  255. %%{ldap_port, 636}.
  256. %%
  257. %% LDAP manager:
  258. %%{ldap_rootdn, "dc=example,dc=com"}.
  259. %%
  260. %% Password of LDAP manager:
  261. %%{ldap_password, "******"}.
  262. %%
  263. %% Search base of LDAP directory:
  264. %%{ldap_base, "dc=example,dc=com"}.
  265. %%
  266. %% LDAP attribute that holds user ID:
  267. %%{ldap_uids, [{"mail", "%[email protected]"}]}.
  268. %%
  269. %% LDAP filter:
  270. %%{ldap_filter, "(objectClass=shadowAccount)"}.
  271.  
  272. %%
  273. %% Anonymous login support:
  274. %% auth_method: anonymous
  275. %% anonymous_protocol: sasl_anon | login_anon | both
  276. %% allow_multiple_connections: true | false
  277. %%
  278. %%{host_config, "public.example.org", [{auth_method, anonymous},
  279. %% {allow_multiple_connections, false},
  280. %% {anonymous_protocol, sasl_anon}]}.
  281. %%
  282. %% To use both anonymous and internal authentication:
  283. %%
  284. %%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
  285.  
  286.  
  287. %%%. ==============
  288. %%%' DATABASE SETUP
  289.  
  290. %% ejabberd by default uses the internal Mnesia database,
  291. %% so you do not necessarily need this section.
  292. %% This section provides configuration examples in case
  293. %% you want to use other database backends.
  294. %% Please consult the ejabberd Guide for details on database creation.
  295.  
  296. %%
  297. %% MySQL server:
  298. %%
  299. %%{odbc_server, {mysql, "server", "database", "username", "password"}}.
  300. %%
  301. %% If you want to specify the port:
  302. %%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
  303.  
  304. %%
  305. %% PostgreSQL server:
  306. %%
  307. %%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
  308. %%
  309. %% If you want to specify the port:
  310. %%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
  311. %%
  312. %% If you use PostgreSQL, have a large database, and need a
  313. %% faster but inexact replacement for "select count(*) from users"
  314. %%
  315. %%{pgsql_users_number_estimate, true}.
  316.  
  317. %%
  318. %% ODBC compatible or MSSQL server:
  319. %%
  320. %%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
  321.  
  322. %%
  323. %% Number of connections to open to the database for each virtual host
  324. %%
  325. %%{odbc_pool_size, 10}.
  326.  
  327. %%
  328. %% Interval to make a dummy SQL request to keep the connections to the
  329. %% database alive. Specify in seconds: for example 28800 means 8 hours
  330. %%
  331. %%{odbc_keepalive_interval, undefined}.
  332.  
  333.  
  334. %%%. ===============
  335. %%%' TRAFFIC SHAPERS
  336.  
  337. %%
  338. %% The "normal" shaper limits traffic speed to 1000 B/s
  339. %%
  340. {shaper, normal, {maxrate, 1000}}.
  341.  
  342. %%
  343. %% The "fast" shaper limits traffic speed to 50000 B/s
  344. %%
  345. {shaper, fast, {maxrate, 50000}}.
  346.  
  347. %%
  348. %% This option specifies the maximum number of elements in the queue
  349. %% of the FSM. Refer to the documentation for details.
  350. %%
  351. {max_fsm_queue, 1000}.
  352.  
  353.  
  354. %%%. ====================
  355. %%%' ACCESS CONTROL LISTS
  356.  
  357. %%
  358. %% The 'admin' ACL grants administrative privileges to XMPP accounts.
  359. %% You can put here as many accounts as you want.
  360. %%
  361. %%{acl, admin, {user, "admin", "localhost"}}.
  362. %%{acl, admin, {user, "admin", "sccups.com"}}.
  363.  
  364. %%
  365. %% Blocked users
  366. %%
  367. %%{acl, blocked, {user, "baduser", "example.org"}}.
  368. %%{acl, blocked, {user, "test"}}.
  369.  
  370. %%
  371. %% Local users: don't modify this line.
  372. %%
  373. {acl, local, {user_regexp, ""}}.
  374.  
  375. %%
  376. %% More examples of ACLs
  377. %%
  378. %%{acl, jabberorg, {server, "jabber.org"}}.
  379. %%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
  380. %%{acl, test, {user_regexp, "^test"}}.
  381. %%{acl, test, {user_glob, "test*"}}.
  382.  
  383. %%
  384. %% Define specific ACLs in a virtual host.
  385. %%
  386. %%{host_config, "localhost",
  387. %% [
  388. %% {acl, admin, {user, "bob-local", "localhost"}}
  389. %% ]
  390. %%}.
  391.  
  392.  
  393. %%%. ============
  394. %%%' ACCESS RULES
  395.  
  396. %% Maximum number of simultaneous sessions allowed for a single user:
  397. {access, max_user_sessions, [{10, all}]}.
  398.  
  399. %% Maximum number of offline messages that users can have:
  400. {access, max_user_offline_messages, [{5000, admin}, {0, all}]}.
  401.  
  402. %% This rule allows access only for local users:
  403. %%{access, local, [{allow, local}]}.
  404.  
  405. %% Only non-blocked users can use c2s connections:
  406. {access, c2s, [{deny, blocked},
  407. {allow, all}]}.
  408.  
  409. %% For C2S connections, all users except admins use the "normal" shaper
  410. {access, c2s_shaper, [{none, admin},
  411. {normal, all}]}.
  412.  
  413. %% All S2S connections use the "fast" shaper
  414. {access, s2s_shaper, [{fast, all}]}.
  415.  
  416. %% Only admins can send announcement messages:
  417. {access, announce, [{allow, admin}]}.
  418.  
  419. %% Only admins can use the configuration interface:
  420. {access, configure, [{allow, admin}]}.
  421.  
  422. %% Admins of this server are also admins of the MUC service:
  423. {access, muc_admin, [{allow, admin}]}.
  424.  
  425. %% Only accounts of the local ejabberd server can create rooms:
  426. {access, muc_create, [{allow, local}]}.
  427.  
  428. %% All users are allowed to use the MUC service:
  429. {access, muc, [{allow, all}]}.
  430.  
  431. %% Only accounts on the local ejabberd server can create Pubsub nodes:
  432. {access, pubsub_createnode, [{allow, local}]}.
  433.  
  434. %% In-band registration allows registration of any possible username.
  435. %% To disable in-band registration, replace 'allow' with 'deny'.
  436. {access, register, [{allow, all}]}.
  437.  
  438. %% By default the frequency of account registrations from the same IP
  439. %% is limited to 1 account every 10 minutes. To disable, specify: infinity
  440. %%{registration_timeout, 600}.
  441.  
  442. %%
  443. %% Define specific Access Rules in a virtual host.
  444. %%
  445. %%{host_config, "localhost",
  446. %% [
  447. %% {access, c2s, [{allow, admin}, {deny, all}]},
  448. %% {access, register, [{deny, all}]}
  449. %% ]
  450. %%}.
  451.  
  452.  
  453. %%%. ================
  454. %%%' DEFAULT LANGUAGE
  455.  
  456. %%
  457. %% language: Default language used for server messages.
  458. %%
  459. {language, "en"}.
  460.  
  461. %%
  462. %% Set a different default language in a virtual host.
  463. %%
  464. %%{host_config, "localhost",
  465. %% [{language, "ru"}]
  466. %%}.
  467.  
  468.  
  469. %%%. =======
  470. %%%' CAPTCHA
  471.  
  472. %%
  473. %% Full path to a script that generates the image.
  474. %%
  475. %%{captcha_cmd, "/usr/lib64/ejabberd/priv/bin/captcha.sh"}.
  476.  
  477. %%
  478. %% Host for the URL and port where ejabberd listens for CAPTCHA requests.
  479. %%
  480. %%{captcha_host, "example.org:5280"}.
  481.  
  482. %%
  483. %% Limit CAPTCHA calls per minute for JID/IP to avoid DoS.
  484. %%
  485. %%{captcha_limit, 5}.
  486.  
  487. %%%. =======
  488. %%%' MODULES
  489.  
  490. %%
  491. %% Modules enabled in all ejabberd virtual hosts.
  492. %%
  493. {modules,
  494. [
  495. {mod_adhoc, []},
  496. {mod_announce, [{access, announce}]}, % recommends mod_adhoc
  497. {mod_blocking,[]}, % requires mod_privacy
  498. {mod_caps, []},
  499. {mod_configure,[]}, % requires mod_adhoc
  500. {mod_disco, []},
  501. %%{mod_echo, [{host, "echo.localhost"}]},
  502. {mod_irc, []},
  503. {mod_http_bind, []},
  504. %%{mod_http_fileserver, [
  505. %% {docroot, "/var/www"},
  506. %% {accesslog, "/var/log/ejabberd/access.log"}
  507. %% ]},
  508. {mod_last, []},
  509. {mod_muc, [
  510. %%{host, "conference.@HOST@"},
  511. {access, muc},
  512. {access_create, muc_create},
  513. {access_persistent, muc_create},
  514. {access_admin, muc_admin}
  515. ]},
  516. %%{mod_muc_log,[]},
  517. {mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
  518. {mod_ping, []},
  519. %%{mod_pres_counter,[{count, 5}, {interval, 60}]},
  520. {mod_privacy, []},
  521. {mod_private, []},
  522. %%{mod_proxy65,[]},
  523. {mod_pubsub, [
  524. {access_createnode, pubsub_createnode},
  525. {ignore_pep_from_offline, true}, % reduces resource comsumption, but XEP incompliant
  526. %%{ignore_pep_from_offline, false}, % XEP compliant, but increases resource comsumption
  527. {last_item_cache, false},
  528. {plugins, ["flat", "hometree", "pep"]} % pep requires mod_caps
  529. ]},
  530. {mod_register, [
  531. %%
  532. %% Protect In-Band account registrations with CAPTCHA.
  533. %%
  534. %%{captcha_protected, true},
  535.  
  536. %%
  537. %% Set the minimum informational entropy for passwords.
  538. %%
  539. %%{password_strength, 32},
  540.  
  541. %%
  542. %% After successful registration, the user receives
  543. %% a message with this subject and body.
  544. %%
  545. {welcome_message, {"Welcome!",
  546. "Hi.\nWelcome to this XMPP server."}},
  547.  
  548. %%
  549. %% When a user registers, send a notification to
  550. %% these XMPP accounts.
  551. %%
  552. %%{registration_watchers, ["[email protected]"]},
  553.  
  554. %%
  555. %% Only clients in the server machine can register accounts
  556. %%
  557. {ip_access, [{allow, "127.0.0.0/8"},
  558. {deny, "0.0.0.0/0"}]},
  559.  
  560. %%
  561. %% Local c2s or remote s2s users cannot register accounts
  562. %%
  563. %%{access_from, deny},
  564.  
  565. {access, register}
  566. ]},
  567. %%{mod_register_web, [
  568. %%
  569. %% When a user registers, send a notification to
  570. %% these XMPP accounts.
  571. %%
  572. %%{registration_watchers, ["[email protected]"]}
  573. %% ]},
  574. {mod_roster, []},
  575. %%{mod_service_log,[]},
  576. {mod_shared_roster,[]},
  577. {mod_stats, []},
  578. {mod_time, []},
  579. {mod_vcard, []},
  580. {mod_version, []}
  581. ]}.
  582.  
  583. %%
  584. %% Enable modules with custom options in a specific virtual host
  585. %%
  586. %%{host_config, "localhost",
  587. %% [{{add, modules},
  588. %% [
  589. %% {mod_echo, [{host, "mirror.localhost"}]}
  590. %% ]
  591. %% }
  592. %% ]}.
  593.  
  594.  
  595. %%%.
  596. %%%'
  597.  
  598. %%% $Id$
  599.  
  600. %%% Local Variables:
  601. %%% mode: erlang
  602. %%% End:
  603. %%% vim: set filetype=erlang tabstop=8 foldmarker=%%%',%%%. foldmethod=marker:
  604.  
  605.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement