ejabberd和客户端的配置
时间:2009-02-10 来源:lll0905
ejabberd
web通讯的开源软件ejabberd,优点:扩展性好,可以集群,支持web客户端
服务端安装:
1.下载bin文件,执行就可以了.
2.从源码开始安装,附属文档比较全面.推荐!
安装过程看源码包里的安装文档就ok
客户端安装:
1.桌面程序有psi
2.web客户端有很多
服务端配置:
主配置文件: ejabberd.cfg
{loglevel, 5}.------------------------- debug log的级别
{hosts, ["apache.yizhong.com"]}.------- 域名
{listen, ----------------------------- 监听
[
{5222, ejabberd_c2s, [--------------- 5222 client to server 的端口
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}
]},
{5269, ejabberd_s2s_in, [
{shaper, s2s_shaper},
{max_stanza_size, 131072}
]},
{5280, ejabberd_http, [-------------- 管理端口,web界面
http_bind,
http_poll,
web_admin
]}
]}.
{auth_method, odbc}. ----------------- 登陆的认证方法,此为数据库
{odbc_server, {pgsql, "localhost", 5432, "ejabberd", "postgres", ""}}. ------- 用pgsql做认证
{pgsql_users_number_estimate, true}.-------- 优化pgsql的统计选项
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
{acl, admin, {user, "admin", "apache.yizhong.com"}}.
{acl, local, {user_regexp, ""}}.
{access, max_user_sessions, [{100, all}]}.
{access, local, [{allow, local}]}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{access, announce, [{allow, admin}]}.
{access, configure, [{allow, all}]}.
{access, muc_admin, [{allow, admin}]}.
{access, muc, [{allow, all}]}.
{access, register, [{allow, all}]}.
{access, pubsub_createnode, [{allow, all}]}.
{language, "en"}.
{modules,-----------------------------------虚拟主机加载的公共模块,还可以加载其他模块
[
{mod_adhoc, []},
{mod_caps, []},
{mod_disco, []},
{mod_http_bind,[]},
{mod_http_fileserver, [{docroot, "/opt/ejabberd-2.0.2_2/www"}]},
{mod_irc, []},
{mod_last, []},
{mod_muc, [
{access, muc},
{access_create, muc},
{access_persistent, muc},
{access_admin, muc_admin}
]},
{mod_offline, []},
{mod_privacy, []},
{mod_private, []},
{access_createnode, pubsub_createnode},
{plugins, ["default", "pep"]}
]},
{mod_register, [
{welcome_message, {"Welcome!",
"Welcome to this Jabber server."}},
{access, register}
]},
{mod_roster, []},
{mod_shared_roster,[]},
{mod_time, []},
{mod_vcard, []},
{mod_version, []}
]}.
配置pgsql连接:
{auth_method, odbc}. ----------------- 登陆的认证方法,此为数据库
{odbc_server, {pgsql, "localhost", 5432, "ejabberd", "postgres", ""}}. ------- 用pgsql做认证
{pgsql_users_number_estimate, true}.-------- 优化pgsql的统计选项
这3项必有
在源码包中有pg.sql文件,在psql客户端中执行这个文件
进入pgsql:
psql -U postgres template1
执行pg.sql文件建立数据库和表:
postgres#\i /----path---/pg.sql
之后,在postgresql中新建个数据库ejabberd
退出psql,进入ejabberd数据库:
psql -U postgres ejabberd
\dt
就能看到新建立的表了
注意: 连接数据库的几个要点,
pgsql --> 关键字
host --> "localhost"
端口 --> 5432 不用加引号
数据库名字 --> "ejabberd"
用户名 --> "postgres"
密码 --> "" 这里为空
还有其他的配置文件要看看,如conf文件夹里的odbcini, odbcinst.ini,里面也有用户名和密码等要点.注意要和ejabberd.cfg一致
web客户端和服务端的通讯:
用apache中转下,做个映射才可以.当然,apache要开proxy模块了;下面是apache的虚拟主机的配置:
<VirtualHost *:80>
ServerName ezsoft
DocumentRoot "d:/web/"
<Directory "d:/web/">
Options +MultiViews
</Directory>
AddDefaultCharset UTF-8
ProxyPass /http-bind/ http://192.168.3.196:5280/http-bind/-----------> 这里!
</VirtualHost>
web通讯的开源软件ejabberd,优点:扩展性好,可以集群,支持web客户端
服务端安装:
1.下载bin文件,执行就可以了.
2.从源码开始安装,附属文档比较全面.推荐!
安装过程看源码包里的安装文档就ok
客户端安装:
1.桌面程序有psi
2.web客户端有很多
服务端配置:
主配置文件: ejabberd.cfg
{loglevel, 5}.------------------------- debug log的级别
{hosts, ["apache.yizhong.com"]}.------- 域名
{listen, ----------------------------- 监听
[
{5222, ejabberd_c2s, [--------------- 5222 client to server 的端口
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}
]},
{5269, ejabberd_s2s_in, [
{shaper, s2s_shaper},
{max_stanza_size, 131072}
]},
{5280, ejabberd_http, [-------------- 管理端口,web界面
http_bind,
http_poll,
web_admin
]}
]}.
{auth_method, odbc}. ----------------- 登陆的认证方法,此为数据库
{odbc_server, {pgsql, "localhost", 5432, "ejabberd", "postgres", ""}}. ------- 用pgsql做认证
{pgsql_users_number_estimate, true}.-------- 优化pgsql的统计选项
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
{acl, admin, {user, "admin", "apache.yizhong.com"}}.
{acl, local, {user_regexp, ""}}.
{access, max_user_sessions, [{100, all}]}.
{access, local, [{allow, local}]}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{access, announce, [{allow, admin}]}.
{access, configure, [{allow, all}]}.
{access, muc_admin, [{allow, admin}]}.
{access, muc, [{allow, all}]}.
{access, register, [{allow, all}]}.
{access, pubsub_createnode, [{allow, all}]}.
{language, "en"}.
{modules,-----------------------------------虚拟主机加载的公共模块,还可以加载其他模块
[
{mod_adhoc, []},
{mod_caps, []},
{mod_disco, []},
{mod_http_bind,[]},
{mod_http_fileserver, [{docroot, "/opt/ejabberd-2.0.2_2/www"}]},
{mod_irc, []},
{mod_last, []},
{mod_muc, [
{access, muc},
{access_create, muc},
{access_persistent, muc},
{access_admin, muc_admin}
]},
{mod_offline, []},
{mod_privacy, []},
{mod_private, []},
{access_createnode, pubsub_createnode},
{plugins, ["default", "pep"]}
]},
{mod_register, [
{welcome_message, {"Welcome!",
"Welcome to this Jabber server."}},
{access, register}
]},
{mod_roster, []},
{mod_shared_roster,[]},
{mod_time, []},
{mod_vcard, []},
{mod_version, []}
]}.
配置pgsql连接:
{auth_method, odbc}. ----------------- 登陆的认证方法,此为数据库
{odbc_server, {pgsql, "localhost", 5432, "ejabberd", "postgres", ""}}. ------- 用pgsql做认证
{pgsql_users_number_estimate, true}.-------- 优化pgsql的统计选项
这3项必有
在源码包中有pg.sql文件,在psql客户端中执行这个文件
进入pgsql:
psql -U postgres template1
执行pg.sql文件建立数据库和表:
postgres#\i /----path---/pg.sql
之后,在postgresql中新建个数据库ejabberd
退出psql,进入ejabberd数据库:
psql -U postgres ejabberd
\dt
就能看到新建立的表了
注意: 连接数据库的几个要点,
pgsql --> 关键字
host --> "localhost"
端口 --> 5432 不用加引号
数据库名字 --> "ejabberd"
用户名 --> "postgres"
密码 --> "" 这里为空
还有其他的配置文件要看看,如conf文件夹里的odbcini, odbcinst.ini,里面也有用户名和密码等要点.注意要和ejabberd.cfg一致
web客户端和服务端的通讯:
用apache中转下,做个映射才可以.当然,apache要开proxy模块了;下面是apache的虚拟主机的配置:
<VirtualHost *:80>
ServerName ezsoft
DocumentRoot "d:/web/"
<Directory "d:/web/">
Options +MultiViews
</Directory>
AddDefaultCharset UTF-8
ProxyPass /http-bind/ http://192.168.3.196:5280/http-bind/-----------> 这里!
</VirtualHost>
相关阅读 更多 +