特殊:Badtitle/NS100:SettingUpJabberServer:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
第1行: 第1行:
{{From|https://help.ubuntu.com/community/SettingUpJabberServer}}
{{From|https://help.ubuntu.com/community/SettingUpJabberServer}}
{{Languages|UbuntuHelp:SettingUpJabberServer}}
{{Languages|UbuntuHelp:SettingUpJabberServer}}
<<Include(Tag/Unsupported)>>
This is an easy howto to setup a Jabber server on Ubuntu Linux. For more info browse the official guide on [http://jabberd.jabberstudio.org/1.4/doc/adminguide].
This is an easy howto to setup a Jabber server on Ubuntu Linux. For more info browse the official guide on [http://jabberd.jabberstudio.org/1.4/doc/adminguide].
==== Why running your own Jabber Server? ====
==== Why running your own Jabber Server? ====
第125行: 第126行:
</nowiki></pre>
</nowiki></pre>
If these ports are "LISTEN"ing it's all right.
If these ports are "LISTEN"ing it's all right.
[[category:CategoryCleanup]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:11的最新版本

{{#ifexist: :SettingUpJabberServer/zh | | {{#ifexist: SettingUpJabberServer/zh | | {{#ifeq: {{#titleparts:SettingUpJabberServer|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:SettingUpJabberServer|1|-1|}} | zh | | }}

<<Include(Tag/Unsupported)>> This is an easy howto to setup a Jabber server on Ubuntu Linux. For more info browse the official guide on [1].

Why running your own Jabber Server?

Many people love IM (Instant Messaging) and many of these should run their own server. Jabber is an XML based cross platform chat and messenging server which is freely available. It runs on Linux, Solaris, and many other Unix variants. For a small office or a collection of offices it's a great way to allow people to chat without resorting to outside services such as MSN, Yahoo, Icq. The beauty of this distributed system is in its flexibility: anyone can set up a Jabber server and use it however they wish. It can be used in a closed "environment" or it can join the growing worldwide network.

Required packages

In Hoary the easy way to obtain a Jabber server is run

sudo apt-get install jabber

done. On server side, you should do common operations for system daemons:

# Stop the server
sudo /etc/init.d/jabber stop

# Start the server
sudo /etc/init.d/jabber start

# Restart the server
sudo /etc/init.d/jabber restart

If you need additional "transport" to other IM you should install the following:

jabber-aim - Provides AIM messenger transport for Jabber IM server
jabber-jit - Jabber ICQ Transport
jabber-msn - Provides the MSN transport for the Jabber IM server
jabber-yahoo - Provides Yahoo messenger transport for Jabber IM server

or check yourself what kind of packages are related to jabber:

apt-cache search jabber

Basic configuration

For a very basic configuration you should look at /etc/jabber/jabber.cfg file where you'll find something like that:

JABBER_HOSTNAME=localhost
JABBER_SPOOL=/var/lib/jabber

Where the JABBER_HOSTNAME is the running server hostname ("localhost" by default), and JABBER_SPOOL is the "spool" directory where temporary file are stored. These variables are then passed to jabberd in the -h switch. In small "environments" you should have a running DNS system and it is useful to setup your IM hostname. For example, if your hostname is "jabber.mydomain" the resulting jabber.cfg will be:

JABBER_HOSTNAME=jabber.mydomain

Advanced configuration

For advanced configuration you should look at /etc/jabber/jabber.xml file where are all the setting for your Jabber Server, well commented. Appart the hostname note, the default settings should be right for almost server implementations. Scripts:

  1. 1: Sample for Yahoo-Transport
<jabber>
    <service id="yahoo-linker">
        <connect>
            <ip></ip>
            <port></port>
            <secret></secret>
        </connect>
        <uplink/>
    </service>
  <pidfile>./yahoo-jabber.pid</pidfile>

  <service id="yahoo.example.com">

<load><yahoo_transport>/path/to/yahoo-transport.so</yahoo_transport></load>
    <config xmlns="jabber:config:yahoo">
      <vCard>
        <NAME>Yahoo Transport</NAME>
      </vCard>
      <server>scs.yahoo.com</server>
      <port>5050</port>
      <charmap>CP1252</charmap>
    </config>
  </service>
</jabber>

Controlling user accounts

If you want to control the registration process are needed some changes in the configuration file. You can disable registrations commenting out certain sections, for e.g. the <register> and the <mod_register> tags, which are in different parts of the file.

<register notify="yes">
  <instructions>
  Choose a username and password to register with this server.
  <instructions>
  <name/>
  <email/>
<register>

and

<mod_register>./jsm/jsm.so</mod_register>

Disabling registration, you need to create the user accounts manually.

Conference

With the conference service you have group chat rooms, either public or private. Fot that you need to install jabber-jud with the command sudo apt-get install jabber-jud. After that edit the jabber.xml configuration file and add something like that:

<browse>
  <conference type="private" jid="conference.localhost" name="Private Conferencing"/>
</browse>

to restrict access to the rooms to local account holders (example) and the following code:

<service id='conference.localhost'>
  <load><conference>/usr/lib/jabber/conference.so</conference></load>
    <conference xmlns="jabber:config:conference">
      <private/>
      <history>30</history>
      <vCard>
        <FN>Private Conferences</FN>
        <DESC>This service is for private conferencing rooms.</DESC>
        <URL>http://foo.bar/</URL>
      </vCard>
      <notice>
      <join> has joined</join>
      <leave> has left</leave>
      <rename> is now known as </rename>
      </notice>
    </conference>
</service>

Restart the server and log in again. You will be able to show Private Conferencing and create a conference room. You can then invite others to join in the conference room.

Tips

Connecting to the server with your client appear this message "There was an error authenticating with jabber server. Details: Unauthorized"? Many references say that this is due to SSL directive: you need to set your IP with <ssl port='5223'> and restart the server. To test the connection try this:

sudo netstat -an | grep -E '5222|5269'

If these ports are "LISTEN"ing it's all right.