Advertisement
sandy1510

Ejabberd config file

Jan 30th, 2012
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 11.56 KB | None | 0 0
  1. %%%
  2. %%%               ejabberd configuration file
  3. %%%
  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 included in
  8. %%% your copy of ejabberd, and is also available online at
  9. %%% http://www.process-one.net/en/ejabberd/docs/
  10.  
  11. %%% This configuration file contains Erlang terms.
  12. %%% In case you want to understand the syntax, here are the concepts:
  13. %%%
  14. %%%  - The character to comment a line is %
  15. %%%
  16. %%%  - Each term ends in a dot, for example:
  17. %%%      override_global.
  18. %%%
  19. %%%  - A tuple has a fixed definition, its elements are
  20. %%%    enclosed in {}, and separated with commas:
  21. %%%      {loglevel, 4}.
  22. %%%
  23. %%%  - A list can have as many elements as you want,
  24. %%%    and is enclosed in [], for example:
  25. %%%      [http_poll, web_admin, tls]
  26. %%%
  27. %%%  - A keyword of ejabberd is a word in lowercase.
  28. %%%    The strings are enclosed in "" and can have spaces, dots...
  29. %%%      {language, "en"}.
  30. %%%      {ldap_rootdn, "dc=example,dc=com"}.
  31. %%%
  32. %%%  - This term includes a tuple, a keyword, a list and two strings:
  33. %%%      {hosts, ["jabber.example.net", "im.example.com"]}.
  34. %%%
  35.  
  36.  
  37. %%%   =======================
  38. %%%   OVERRIDE STORED OPTIONS
  39.  
  40. %%
  41. %% Override the old values stored in the database.
  42. %%
  43.  
  44. %%
  45. %% Override global options (shared by all ejabberd nodes in a cluster).
  46. %%
  47. %%override_global.
  48.  
  49. %%
  50. %% Override local options (specific for this particular ejabberd node).
  51. %%
  52. %%override_local.
  53.  
  54. %%
  55. %% Remove the Access Control Lists before new ones are added.
  56. %%
  57. %%override_acls.
  58.  
  59.  
  60. %%%   =========
  61. %%%   DEBUGGING
  62.  
  63. %%
  64. %% loglevel: Verbosity of log files generated by ejabberd.
  65. %% 0: No ejabberd log at all (not recommended)
  66. %% 1: Critical
  67. %% 2: Error
  68. %% 3: Warning
  69. %% 4: Info
  70. %% 5: Debug
  71. %%
  72. {loglevel, 4}.
  73.  
  74. %%
  75. %% watchdog_admins: If an ejabberd process consumes too much memory,
  76. %% send live notifications to those Jabber accounts.
  77. %%
  78. %%{watchdog_admins, ["admin@rdJabberServer"]}.
  79.  
  80.  
  81. %%%   ================
  82. %%%   SERVED HOSTNAMES
  83.  
  84. %%
  85. %% hosts: Domains served by ejabberd.
  86. %% You can define one or several, for example:
  87. %% {hosts, ["example.net", "example.com", "example.org"]}.
  88. %%
  89. {hosts, ["rdJabberServer"]}.
  90.  
  91. %%
  92. %% route_subdomains: Delegate subdomains to other Jabber server.
  93. %% For example, if this ejabberd serves example.org and you want
  94. %% to allow communication with a Jabber server called im.example.org.
  95. %%
  96. %%{route_subdomains, s2s}.
  97.  
  98.  
  99. %%%   ===============
  100. %%%   LISTENING PORTS
  101.  
  102. %%
  103. %% listen: Which ports will ejabberd listen, which service handles it
  104. %% and what options to start it with.
  105. %%
  106. {listen,
  107.  [
  108.  
  109.   {5222, ejabberd_c2s, [
  110.             {certfile, "C:\\Program Files\\ejabberd-2.1.10\\conf\\server.pem"}, starttls,
  111.             {access, c2s},                 
  112.             {shaper, none},
  113.             {max_stanza_size, none}
  114.                ]},
  115.  
  116.   %%
  117.   %% To enable the old SSL connection method in port 5223:
  118.   %%
  119.   %%{5223, ejabberd_c2s, [
  120.   %%            {certfile, "C:\\Program Files\\ejabberd-2.1.10\\conf\\server.pem"}, tls,
  121.   %%            {access, c2s},
  122.   %%            {shaper, c2s_shaper},
  123.   %%            {max_stanza_size, 65536}
  124.   %%               ]},
  125.  
  126.   {5269, ejabberd_s2s_in, [
  127.                {shaper, none},
  128.                {max_stanza_size, none}
  129.               ]},
  130.  
  131.   %%
  132.   %% ejabberd_service: Interact with external components (transports...)
  133.   %%
  134.   %%{8888, ejabberd_service, [
  135.   %%                {access, all},
  136.   %%                {shaper_rule, fast},
  137.   %%                {ip, {127, 0, 0, 1}},
  138.   %%                {hosts, ["icq.example.org", "sms.example.org"],
  139.   %%                 [{password, "secret"}]
  140.   %%                }
  141.   %%               ]},
  142.  
  143.   {5280, ejabberd_http, [
  144.                          %%{request_handlers, [
  145.              %% {["web"], mod_http_fileserver}
  146.              %%]},
  147.              captcha,
  148.              http_bind,
  149.              http_poll,
  150.              web_admin
  151.             ]}
  152.  
  153.  ]}.
  154.  
  155. %%
  156. %% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
  157. %% Allowed values are: true or false.
  158. %% You must specify a certificate file.
  159. %%
  160. {s2s_use_starttls, true}.
  161.  
  162. %%
  163. %% s2s_certfile: Specify a certificate file.
  164. %%
  165. {s2s_certfile, "C:\\Program Files\\ejabberd-2.1.10\\conf\\server.pem"}.
  166.  
  167. %%
  168. %% domain_certfile: Specify a different certificate for each served hostname.
  169. %%
  170. %%{domain_certfile, "example.org", "C:\\Program Files\\ejabberd-2.1.10\\conf\\example_org.pem"}.
  171. %%{domain_certfile, "example.com", "C:\\Program Files\\ejabberd-2.1.10\\conf\\example_com.pem"}.
  172.  
  173. %%
  174. %% S2S whitelist or blacklist
  175. %%
  176. %% Default s2s policy for undefined hosts.
  177. %%
  178. %%{s2s_default_policy, allow}.
  179.  
  180. %%
  181. %% Allow or deny communication with specific servers.
  182. %%
  183. %%{{s2s_host, "goodhost.org"}, allow}.
  184. %%{{s2s_host, "badhost.org"}, deny}.
  185.  
  186.  
  187. %%%   ==============
  188. %%%   AUTHENTICATION
  189.  
  190. %%
  191. %% auth_method: Method used to authenticate the users.
  192. %% The default method is the internal.
  193. %% If you want to use a different method,
  194. %% comment this line and enable the correct ones.
  195. %%
  196. {auth_method, internal}.
  197.  
  198. %%
  199. %% Authentication using external script
  200. %% Make sure the script is executable by ejabberd.
  201. %%
  202. %%{auth_method, external}.
  203. %%{extauth_program, "\\path\\to\\authentication\\script"}.
  204.  
  205. %%
  206. %% Authentication using ODBC
  207. %% Remember to setup a database in the next section.
  208. %%
  209. %%{auth_method, odbc}.
  210.  
  211. %%
  212. %% Authentication using PAM
  213. %%
  214. %%{auth_method, pam}.
  215. %%{pam_service, "pamservicename"}.
  216.  
  217. %%
  218. %% Authentication using LDAP
  219. %%
  220. %%{auth_method, ldap}.
  221. %%
  222. %% List of LDAP servers:
  223. %%{ldap_servers, ["rdJabberServer"]}.    
  224. %%
  225. %% LDAP attribute that holds user ID:
  226. %%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
  227. %%
  228. %% Search base of LDAP directory:
  229. %%{ldap_base, "dc=example,dc=com"}.
  230. %%
  231. %% LDAP manager:
  232. %%{ldap_rootdn, "dc=example,dc=com"}.
  233. %%
  234. %% Password to LDAP manager:
  235. %%{ldap_password, "******"}.
  236.  
  237. %%
  238. %% Anonymous login support:
  239. %%   auth_method: anonymous
  240. %%   anonymous_protocol: sasl_anon | login_anon | both
  241. %%   allow_multiple_connections: true | false
  242. %%
  243. %%{host_config, "public.example.org", [{auth_method, anonymous},
  244. %%                                     {allow_multiple_connections, false},
  245. %%                                     {anonymous_protocol, sasl_anon}]}.
  246. %%
  247. %% To use both anonymous and internal authentication:
  248. %%
  249. %%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
  250.  
  251.  
  252. %%%   ==============
  253. %%%   DATABASE SETUP
  254.  
  255. %% ejabberd uses by default the internal Mnesia database,
  256. %% so you can avoid this section.
  257. %% This section provides configuration examples in case
  258. %% you want to use other database backends.
  259. %% Please consult the ejabberd Guide for details about database creation.
  260.  
  261. %%
  262. %% MySQL server:
  263. %%
  264. %%{odbc_server, {mysql, "server", "database", "username", "password"}}.
  265. %%
  266. %% If you want to specify the port:
  267. %%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
  268.  
  269. %%
  270. %% PostgreSQL server:
  271. %%
  272. %%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
  273. %%
  274. %% If you want to specify the port:
  275. %%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
  276. %%
  277. %% If you use PostgreSQL, have a large database, and need a
  278. %% faster but inexact replacement for "select count(*) from users"
  279. %%
  280. %%{pgsql_users_number_estimate, true}.
  281.  
  282. %%
  283. %% ODBC compatible or MSSQL server:
  284. %%
  285. %%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
  286.  
  287.  
  288. %%%   ===============
  289. %%%   TRAFFIC SHAPERS
  290.  
  291. %%
  292. %% The "normal" shaper limits traffic speed to 1.000 B/s
  293. %%
  294. {shaper, normal, {maxrate, 1000000000}}.
  295.  
  296. %%
  297. %% The "fast" shaper limits traffic speed to 50.000 B/s
  298. %%
  299. {shaper, fast, {maxrate, 50000000000000}}.
  300.  
  301.  
  302. %%%   ====================
  303. %%%   ACCESS CONTROL LISTS
  304.  
  305. %%
  306. %% The 'admin' ACL grants administrative privileges to Jabber accounts.
  307. %% You can put as many accounts as you want.
  308. %%
  309. {acl, admin, {user, "admin", "rdJabberServer"}}.
  310.  
  311. %%
  312. %% Blocked users
  313. %%
  314. %%{acl, blocked, {user, "baduser", "example.org"}}.
  315. %%{acl, blocked, {user, "test"}}.
  316.  
  317. %%
  318. %% Local users: don't modify this line.
  319. %%
  320. {acl, local, {user_regexp, ""}}.
  321.  
  322. %%
  323. %% More examples of ACLs
  324. %%
  325. %%{acl, jabberorg, {server, "jabber.org"}}.
  326. %%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
  327. %%{acl, test, {user_regexp, "^test"}}.
  328. %%{acl, test, {user_glob, "test*"}}.
  329.  
  330.  
  331. %%%   ============
  332. %%%   ACCESS RULES
  333.  
  334. %% Define the maximum number of time a single user is allowed to connect:
  335. {access, max_user_sessions, [{1000, all}]}.
  336.  
  337. %% This rule allows access only for local users:
  338. {access, local, [{allow, local}]}.
  339.  
  340. %% Only non-blocked users can use c2s connections:
  341. {access, c2s, [{deny, blocked},
  342.            {allow, all}]}.
  343.  
  344. %% For all users except admins used "normal" shaper
  345. {access, c2s_shaper,[{none, all}]}.
  346.  
  347. %% For all S2S connections used "fast" shaper
  348. {access, s2s_shaper, [{fast, all}]}.
  349.  
  350. %% Only admins can send announcement messages:
  351. {access, announce, [{allow, admin}]}.
  352.  
  353. %% Only admins can use configuration interface:
  354. {access, configure, [{allow, admin}]}.
  355.  
  356. %% Admins of this server are also admins of MUC service:
  357. {access, muc_admin, [{allow, admin}]}.
  358.  
  359. %% All users are allowed to use MUC service:
  360. {access, muc, [{allow, all}]}.
  361. {access, muc_create, [{allow, local}]}.
  362.  
  363. %% In-band registration
  364. {access, register, [{allow, all}]}.
  365.  
  366. %% Everybody can create pubsub nodes
  367. {access, pubsub_createnode, [{allow, local}]}.
  368.  
  369.  
  370. %%%   ================
  371. %%%   DEFAULT LANGUAGE
  372.  
  373. %%
  374. %% language: Default language used for server messages.
  375. %%
  376. {language, "en"}.
  377.  
  378. %%%   =======
  379. %%%   CAPTCHA
  380.  
  381. %%
  382. %% Full path to a script that generates the image.
  383. %%
  384. %%{captcha_cmd, "C:\\Program Files\\ejabberd-2.1.10\\priv/bin/captcha.sh"}.
  385.  
  386. %%
  387. %% Host part of the URL sent to the user.
  388. %%
  389. %%{captcha_host, "example.org:5280"}.
  390.  
  391.  
  392. %%%   =======
  393. %%%   MODULES
  394.  
  395. %%
  396. %% Modules enabled in all ejabberd virtual hosts.
  397. %%
  398. {modules,
  399.  [
  400.   {mod_adhoc,    []},
  401.   {mod_announce, [{access, announce}]}, % requires mod_adhoc
  402.   {mod_caps,     []},
  403.   {mod_configure,[]}, % requires mod_adhoc
  404.   {mod_disco,    []},
  405.   %%{mod_echo,   [{host, "echo.rdJabberServer"}]},
  406.   {mod_http_bind,[]},
  407.   %%{mod_http_fileserver, [
  408.   %%  {docroot, "C:\\Program Files\\ejabberd-2.1.10\\www"},
  409.   %%  {accesslog, "C:\\Program Files\\ejabberd-2.1.10\\www/webaccess.log"},
  410.   %%  {content_types, [{".htm", "text/html"}]},
  411.   %%  {directory_indices, ["index.html", "index.htm"]}
  412.   %%]},
  413.   {mod_irc,      []},
  414.   {mod_last,     []},
  415.   {mod_muc,      [
  416.           %%{host, "conference.@HOST@"},
  417.           {access, muc},
  418.           {access_create, muc_create},
  419.           {access_persistent, muc_create},
  420.           {access_admin, muc_admin}
  421.          ]},
  422.   %%{mod_muc_log,[]},
  423.   {mod_offline,  []},
  424.   {mod_privacy,  []},
  425.   {mod_private,  []},
  426.   %%{mod_proxy65,[]},
  427.   {mod_pubsub,   [ % requires mod_caps
  428.           {access_createnode, pubsub_createnode},
  429.           {ignore_pep_from_offline, true},
  430.           {last_item_cache, false},
  431.           {plugins, ["flat", "hometree", "pep"]}
  432.          ]},
  433.   {mod_register, [
  434.           %%
  435.           %% After successful registration, the user receives
  436.           %% a message with this subject and body.
  437.           %%
  438.           {welcome_message, {"Welcome!",
  439.                      "Welcome to this Jabber server."}},
  440.  
  441.           %%
  442.           %% When a user registers, send a notification to
  443.           %% these Jabber accounts.
  444.           %%
  445.           %%{registration_watchers, ["admin1@example.org"]},
  446.  
  447.           {access, register}
  448.          ]},
  449.   {mod_roster,   []},
  450.   %%{mod_service_log,[]},
  451.   {mod_shared_roster,[]},
  452.   %%{mod_stats,    []},
  453.   {mod_time,     []},
  454.   {mod_vcard,    []},
  455.   {mod_version,  []}
  456.  ]}.
  457.  
  458.  
  459. %%% $Id: ejabberd.cfg.example 1073 2007-12-17 11:03:22Z badlop $
  460.  
  461. %%% Local Variables:
  462. %%% mode: erlang
  463. %%% End:
  464. %%% vim: set filetype=erlang tabstop=8:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement