如何纠正语法?

时间:2014-01-17 11:26:00

标签: erlang ejabberd

我已经使用mysql配置了ejabberd,但是在安装后由于语法错误我无法启动ejabberd服务器。

%% Modules enabled in all ejabberd virtual hosts.
%%
{modules,
 [
  %%{mod_adhoc_odbc,    []},
  %%{mod_announce_odbc, [{access, announce}]}, % requires mod_adhoc
  %%{mod_caps_odbc,     []},
  %%{mod_configure_odbc,[]}, % requires mod_adhoc
  %%{mod_admin_extra_odbc, []},
  %%{mod_disco_odbc,    []},
  %%{mod_echo,   [{host, "echo.localhost"}]},
  %%{mod_irc_odbc,      []},
  %% NOTE that mod_http_fileserver must also be enabled in the
  %% "request_handlers" clause of the "ejabberd_http" listener
  %% configuration (see the "LISTENING PORTS" section above).
  %%{mod_http_fileserver, [
  %%                       {docroot, "/var/www"},
  %%                       {accesslog, "/var/log/ejabberd/access.log"}
  %%                      ]},
  {mod_last_odbc,     []},
  %%{mod_muc_odbc,      [
                  %%{host, "conference.@HOST@"},
                  {access, muc},
                  {access_create, muc},
                  {access_persistent, muc},
                  {access_admin, muc_admin},
                  {max_users, 500}
                 ]},
  {mod_muc_log_odbc,[]},
  {mod_offline_odbc,  [{access_max_user_messages, max_user_offline_messages}]},
  {mod_privacy_odbc,  []},
  {mod_private_odbc,  []},
  {mod_offline_post_odbc, [
        {auth_token, "offline_post_auth_token"},
        {post_url, "http://localhost:5280/offline_post"}
    ]},
  {mod_available_post_odbc, [
        {auth_token, "mod_available_post"},
        {post_url, "http://localhost:5280/available_post"}
    ]},
  {mod_unavailable_post_odbc, [
        {auth_token, "unavailable_post_auth_token"},
        {post_url, "http://localhost:5280/unavailable_post"}
    ]},
  {mod_proxy65_odbc,  [
                  {access, local},
                  {shaper, c2s_shaper}
                 ]},
  {mod_pubsub_odbc,   [ % requires mod_caps
                  {access_createnode, pubsub_createnode},
                  {pep_sendlast_offline, false},
                  {last_item_cache, false},
                  %%{plugins, ["default", "pep"]}
                  {plugins, ["flat", "hometree", "pep"]}  % pep requires mod_caps
                ]},

      {mod_register_odbc, [
                  %%
                  %% After successful registration, the user receives
                  %% a message with this subject and body.
                  %%
                  {welcome_message, {"Welcome!",
                                     "Welcome to a Jabber service powered by Debian. "
                                     "For information about Jabber visit "
                                     "http://www.jabber.org"}},
                  %% Replace it with 'none' if you don't want to send such message:
                  %%{welcome_message, none},

                  %%
                  %% When a user registers, send a notification to
                  %% these Jabber accounts.
                  %%
                  %%{registration_watchers, ["admin1@example.org"]},

                  {access, register}
                 ]},
  {mod_roster_odbc,   []},
  {mod_service_log_odbc,[]},
  {mod_shared_roster_odbc,[]},
  {mod_stats_odbc,    []},
  {mod_time_odbc,     []},
  {mod_vcard_odbc,    []},
  {mod_version_odbc,  []}
 ]}.

%%

得到错误是,


=ERROR REPORT==== 2014-01-17 16:45:37 ===
E(<0.37.0>:ejabberd_config:187) : The following lines from your configuration file might be relevant to the error: 
626: 
627:          {access, register}
628:         ]},
629:   {mod_roster_odbc,   []},
630:   {mod_service_log_odbc,[]},
631:   {mod_shared_roster_odbc,[]},
632:   {mod_stats_odbc,    []},
633:   {mod_time_odbc,     []},
634:   {mod_vcard_odbc,    []},
635:   {mod_version_odbc,  []}
636:  ]}.
637: 
638: %%
639: %% Enable modules with custom options in a specific virtual host

=ERROR REPORT==== 2014-01-17 16:45:37 ===
E(<0.37.0>:ejabberd_config:106) : Problem loading ejabberd config file /etc/ejabberd/ejabberd.cfg approximately in the line 636: syntax error before: ']'

请帮我解决这个问题。谢谢你。

1 个答案:

答案 0 :(得分:2)

问题在于:

  %%{mod_muc_odbc,      [
                  %%{host, "conference.@HOST@"},
                  {access, muc},
                  {access_create, muc},
                  {access_persistent, muc},
                  {access_admin, muc_admin},
                  {max_users, 500}
                 ]},

您已对第一行进行了注释,但未对mod_muc_odbc配置的其余部分进行注释,从而导致括号不平衡。要么取消注释第一行,要么注释掉其余部分。