1. Prepare the software packages (libidn, udns, and gsasl) to be installed and download them from the following addresses:
Wget ftp://ftp.gnu.org/gnu/gsasl/libgsasl-1.6.1.tar.gz
Wget http://www.corpit.ru/mjt/udns/udns-0.2.tar.gz
Wget http://ftp.gnu.org/gnu/libidn/libidn-1.9.tar.gz
1. The operating system is Redhat Enterprise Linux 5 and the minimal installation is selected. Our goal is not to use the existing libraries in the system, all of which are compiled by ourselves. The purpose of this is to build a system independent jabberd.
2. You have prepared the installation package:
Cyrus-sasl-2.1.23.tar.gz
Jabberd-2.2.11.tar.bz2
Libidn-1.19.tar.gz
Openssl-1.0.0a.tar.gz
Expat-2.0.1.tar.gz
Libgcrypt-1.4.6.tar.bz2
Mysql-5.0.91-linux-i686-glibc23.tar.gz
Udns_0.0.9.tar.gz
Zlib-1.2.5.tar.gz
Libgsasl-1.4.4.tar.gz
3. Create a directory:
Mkdir-P/usr/local/easyjabberd/APP
4. Install MySQL first:
We downloaded the compiled Binary Package of MySQL, which can be directly decompressed.
(1), tar zxvf mysql-5.0.91-linux-i686-glibc23.tar.gz
(2), CP-r mysql-5.0.91-linux-i686-glibc23/usr/local/easyjabberd/APP/MySQL
5. Install expat for XML parsing.
(1), tar zxvf expat-2.0.1.tar.gz
(2),./configure -- prefix =/usr/local/easyjabberd/APP/expat
(3), make
(4), make install
6. Install libidn
(1), tar zxvf libidn-1.19.tar.gz
(2),./configure -- prefix =/usr/local/easyjabberd/APP/libidn
(3), make
(4), make install
7. Install udns
The configure of udns does not provide -- prefix. After compilation, manually copy the required files to the/usr/local/easyjabberd/APP/udns directory.
(1), mkdir-P/usr/local/easyjabberd/APP/udns/include
(2), mkdir-P/usr/local/easyjabberd/APP/udns/lib
(3),./configure
(4), make
(5), CP udns. h/usr/local/easyjabberd/APP/udns/include/
(6), CP libudns. A/usr/local/easyjabberd/APP/udns/lib/
8. Install OpenSSL
(1), tar zxvf openssl-1.0.0a.tar.gz
(2), Cd openssl-1.0.0a
(3),./config -- prefix =/usr/local/easyjabberd/APP/
(4), make
(4), make install
9. Install Cyrus SASL
(1), tar zxvf cyrus-sasl-2.1.23.tar.gz
(2), Cd cyrus-sasl-2.1.23
(3 ),. /configure -- prefix =/usr/local/easyjabberd/APP/-- With-OpenSSL =/usr/local/easyjabberd/APP/cppflags = "-I/usr/local/easyjabberd/ APP/include/-I/usr/local/easyjabberd
/APP/include/OpenSSL "ldflags ="-l/usr/local/easyjabberd/APP/lib"
(4), make
(5), make install
10. Install zlib
(1), tar zxvf zlib-1.2.5.tar.gz
(2), Cd zlib-1.2.5
(3),./configure -- prefix =/usr/local/easyjabberd/APP/
(4), make
(5), make install
11. Install jabberd2
(1) jabberd-2.2.11.tar.bz2, tar jxvf
(2), Cd jabberd-2.2.11
(3 ),. /configure -- prefix =/usr/local/easyjabberd/jabberd2 -- enable-mysql =/usr/local/easyjabberd/MySQL/cflags = "-I/usr/local/easyjabberd/APP /include-I/usr/local/easyjabberd/APP/include/OpenSSL "ldflags ="-l/usr/local/easyjabberd/APP/lib-wl, -R/usr/local/easyjabberd/APP/lib"
-- With-extra-include-Path =/usr/local/easyjabberd/APP/include -- With-extra-library-Path =/usr/local/easyjabberd/APP/lib -- -sasl = Cyrus -- enable-Mio = epoll
(4), make
(5) debugging error. Comment out row SX/sasl_cyrus.c.
(6), make
(7), make install
Now, if everything goes well, the jabberd2 server has been compiled and installed.
======================= The above content is completely reproduced from fytzzh blog: http://blog.chinaunix.net/uid-345900-id-2131348.html
Ii. Problems Encountered during compilation:
1) The udns package cannot be found.
The configure of udns does not provide -- prefix. After compilation, manually copy the required files to the/usr/local/easyjabberd/APP/udns directory.
(1), mkdir-P/usr/local/easyjabberd/APP/udns/include
(2), mkdir-P/usr/local/easyjabberd/APP/udns/lib
(3),./configure
(4), make
(5), CP udns. h/usr/local/easyjabberd/APP/udns/include/
(6), CP libudns. A/usr/local/easyjabberd/APP/udns/lib/
After following this step, the error udslib cannot be found will still be prompted during jabberd compilation. Copy udns. h and libudns. A to the app/include directory, respectively.
2) Compile the cyrus-sasl-2.1.23 prompts the following error:
# Elif with no expression
The compiler version is 4.0 and does not recognize # Elif XXX. The solution is to add defined after # Elif:
# Elif defined have_alloca
# Include <stdlib. h>
3) Compile the cyrus-sasl-2.1.23 prompts the following error:
Digestmd5.c: In function 'digestmd5 _ client_mech_step ':
Digestmd5.c: 4000: Warning: pointer targets in assignment differ in signedness
Make [2]: *** [digestmd5.lo] Error 1
Make [2]: Leaving directory '/home/Eugene/cyrus-sasl2_2.1.23.dfsg1/INS ins'
Make [1]: *** [All-recursive] Error 1
Make [1]: Leaving directory '/home/Eugene/ENE'
Make: *** [all] Error 2
If it is found that it has been installed, uninstall the original one:
[Push @ pushtest cyrus-sasl-2.1.23] $ rpm-Qa | grep cyrus-sasl
Cyrus-sasl-plain-2.1.23-13.el6.x86_64
Cyrus-sasl-lib-2.1.23-13.el6.x86_64
Cyrus-sasl-2.1.23-13.el6.x86_64
Cyrus-sasl-devel-2.1.23-13.el6.x86_64
# Rpm-e -- allmatches -- nodeps cyrus-sasl-Plain
# Rpm-e -- allmatches -- nodeps cyrus-sasl-lib
# Rpm-e -- allmatches -- nodeps cyrus-sasl-Plain
# Rpm-e -- allmatches -- nodeps cyrus-sasl-devel
4) An error is prompted during jabberd Compilation:
/Bin/sh .. /libtool -- tag = Cc -- mode = compile gcc-dhave_config_h-I. -I .. -I/home/push/wuliang/Program/jabberd2/APP/include-I/home/push/wuliang/Program/jabberd2/APP/include-I/home/push/wuliang /Program/jabberd2/APP/include/OpenSSL-funsigned-Char-MT
Sasl_cyrus.lo-MD-MP-MF. deps/sasl_cyrus.tpo-c-o sasl_cyrus.lo sasl_cyrus.c
Libtool: compile: gcc-dhave_config_h-I. -I .. -I/home/push/wuliang/Program/jabberd2/APP/include-I/home/push/wuliang/Program/jabberd2/APP/include-I/home/push/wuliang /Program/jabberd2/APP/include/OpenSSL-funsigned-Char-MT sasl_cyrus.lo-MD-MP-MF. deps/sasl_cyrus.tpo
-C sasl_cyrus.c-FPIC-dpic-o. libs/sasl_cyrus.o
Sasl_cyrus.c: 23: 2: Error: # error Cyrus SASL implementation is not supported! It is wrongly ded here only for the brave ones, that do know what they are doing. You need to remove this line to compile it.
Sasl_cyrus.c: In function '_ sx_sasl_decode ':
Sasl_cyrus.c: 723: Warning: Passing argument 3 of 'sasl _ decode64' from incompatible pointer type
/Home/push/wuliang/Program/jabberd2/APP/include/SASL/saslutil. h: 27: Note: Expected 'Char * 'But argument is of Type 'Char **'
Sasl_cyrus.c: In function '_ sx_sasl_encode ':
Sasl_cyrus.c: 729: Warning: Passing argument 3 of 'sasl _ encode64' from incompatible pointer type
/Home/push/wuliang/Program/jabberd2/APP/include/SASL/saslutil. h: 40: Note: Expected 'Char * 'But argument is of Type 'Char **'
Make: *** [sasl_cyrus.lo] Error 1
[Push @ pushtest SX] $
Delete the compilation macro of sasl_cyrus.c: 23:
# Error Cyrus SASL implementation is not supported! It is wrongly ded here only for the brave ones, that do know what they are doing. You need to remove this line to compile it.