个人工具

“UbuntuHelp:SettingUpJabberServer”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/SettingUpJabberServer}} {{Languages|php5}} This is an easy howto to setup a Jabber server on Ubuntu Linux. For more info browse the official guide ...)
 
第14行: 第14行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install jabber
 
sudo apt-get install jabber
</nowiki></code>
+
</nowiki></pre>
  
 
done.
 
done.
第29行: 第29行:
 
# Restart the server
 
# Restart the server
 
sudo /etc/init.d/jabber restart
 
sudo /etc/init.d/jabber restart
</nowiki></code>
+
</nowiki></pre>
  
 
If you need additional "transport" to other IM you should install the following:
 
If you need additional "transport" to other IM you should install the following:
第38行: 第38行:
 
jabber-msn - Provides the MSN transport for the Jabber IM server
 
jabber-msn - Provides the MSN transport for the Jabber IM server
 
jabber-yahoo - Provides Yahoo messenger transport for Jabber IM server
 
jabber-yahoo - Provides Yahoo messenger transport for Jabber IM server
</nowiki></code>
+
</nowiki></pre>
  
 
or check yourself what kind of packages are related to <code><nowiki>jabber</nowiki></code>:
 
or check yourself what kind of packages are related to <code><nowiki>jabber</nowiki></code>:
第44行: 第44行:
 
<pre><nowiki>
 
<pre><nowiki>
 
apt-cache search jabber
 
apt-cache search jabber
</nowiki></code>
+
</nowiki></pre>
  
 
==== Basic configuration ====
 
==== Basic configuration ====
第52行: 第52行:
 
JABBER_HOSTNAME=localhost
 
JABBER_HOSTNAME=localhost
 
JABBER_SPOOL=/var/lib/jabber
 
JABBER_SPOOL=/var/lib/jabber
</nowiki></code>
+
</nowiki></pre>
 
Where the <code><nowiki>JABBER_HOSTNAME</nowiki></code> is the running server hostname ("localhost" by default), and <code><nowiki>JABBER_SPOOL</nowiki></code> is the "spool" directory where temporary file are stored. These variables are then passed to jabberd in the <code><nowiki>-h</nowiki></code> switch.
 
Where the <code><nowiki>JABBER_HOSTNAME</nowiki></code> is the running server hostname ("localhost" by default), and <code><nowiki>JABBER_SPOOL</nowiki></code> is the "spool" directory where temporary file are stored. These variables are then passed to jabberd in the <code><nowiki>-h</nowiki></code> switch.
  
第59行: 第59行:
 
<pre><nowiki>
 
<pre><nowiki>
 
JABBER_HOSTNAME=jabber.mydomain
 
JABBER_HOSTNAME=jabber.mydomain
</nowiki></code>
+
</nowiki></pre>
  
 
==== Advanced configuration ====
 
==== Advanced configuration ====
第94行: 第94行:
 
   </service>
 
   </service>
 
</jabber>
 
</jabber>
</nowiki></code>
+
</nowiki></pre>
  
 
==== Controlling user accounts ====
 
==== Controlling user accounts ====
第108行: 第108行:
 
   <email/>
 
   <email/>
 
<register>
 
<register>
</nowiki></code>
+
</nowiki></pre>
  
 
and
 
and
第114行: 第114行:
 
<pre><nowiki>
 
<pre><nowiki>
 
<mod_register>./jsm/jsm.so</mod_register>
 
<mod_register>./jsm/jsm.so</mod_register>
</nowiki></code>
+
</nowiki></pre>
  
 
Disabling registration, you need to create the user accounts manually.
 
Disabling registration, you need to create the user accounts manually.
第126行: 第126行:
 
   <conference type="private" jid="conference.localhost" name="Private Conferencing"/>
 
   <conference type="private" jid="conference.localhost" name="Private Conferencing"/>
 
</browse>
 
</browse>
</nowiki></code>
+
</nowiki></pre>
  
 
to restrict access to the rooms to local account holders (example) and the following code:
 
to restrict access to the rooms to local account holders (example) and the following code:
第148行: 第148行:
 
     </conference>
 
     </conference>
 
</service>
 
</service>
</nowiki></code>
+
</nowiki></pre>
  
 
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.
 
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.
第160行: 第160行:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo netstat -an | grep -E '5222|5269'
 
sudo netstat -an | grep -E '5222|5269'
</nowiki></code>
+
</nowiki></pre>
  
 
If these ports are "LISTEN"ing it's all right.
 
If these ports are "LISTEN"ing it's all right.

2007年5月13日 (日) 12:35的版本

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 wanna 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.

CategoryDocumentation CategoryCleanup