Open-XChange安装小记 : 进公司干的第二件事情

阅读更多
 

Open-Xchange安装日志

 

Pre-install

 

安装apt

 

wget  http://ftp.freshrpms.net/pub/freshrpms/redhat/9/apt-0.5.5cnc6-frl.i386.rpm

rpm  -ihv  apt-0.5.5cnc6-frl.i386.rpm

apt-get  update

 

vi /etc/apt/sources.list

在该文件中添加以下五行:

 

rpm             http://mirrors.sunsite.dk/jpackage 1.5/generic free

rpm-src         http://mirrors.sunsite.dk/jpackage 1.5/generic free non-free

rpm             http://mirrors.sunsite.dk/jpackage 1.5/redhat-9 free

rpm-src         http://mirrors.sunsite.dk/jpackage 1.5/redhat-9 free

rpm             http://apt.sw.be redhat/9/en/i386 dag

 

返回命令行提示符.

 

apt-get  update

apt-get install postgresql postgresql-server postgresql-libs

 

#apt-get install httpd httpd-manual

#:因为在原有linux服务器上已经安装了Apache http server2.2 故无需执行

 

apt-get install xerces-j2

apt-get install jdom

apt-get install postgresql-jdbc

apt-get install mod_jk-ap20

 

#此命令为下载安装ApacheTomcat的连接器

#除非linux上的Apache安装在默认路径/usr/local/apache2

#否则,在此安装的连接器是不起作用的.

#后面mod_jk须自行手动下载、编译、安装、配置

 

apt-get install perl-Convert-ASN1

apt-get install perl-ldap

 

#perl模块下载时也自动下载的所需的模块包括:

# perl-IO-Socket-SSL

# perl-Net-SSLeay

# perl-XML-NamespaceSupport

# perl-XML-SAX

 

apt-get install perl-Authen-SASL

#命令提示找不到相应的模块,可通过CPAN安装,如下:

 

perl –MCPAN –e shell

cpan>install Authen::SASL

 

http://sietse.net/exoops/modules/OpenXchange/?distr=rh9下载

openldap-clients-2.0.27-8.i386.rpm

openldap-servers-2.0.27-8.i386.rpm

/home/xkx/ox目录下。

cd /home/xkx/ox

rpm -Uvh openldap-servers-2.0.27-8.i386.rpm openldap-clients-2.0.27-8.i386.rpm

service ldap start

 

Sun官方网站下载

j2sdk-1_4_2_10-linux-i586.bin

jaf-1_0_2-upd2.zip

javamail-1_4-ea.zip

存放到/home/xkx/ox目录下

 

安装JDK

cd /home/xkx/ox

chmod 755 j2sdk-1_4_2_10-linux-i586.bin

 

/etc/profile,/etc/profile.d/java.sh,/root/.bashrc下分别加入如下四行:

JAVA_HOME="/home/xkx/ox/j2sdk1.4.2_10"

JAVA_BIN="/home/xkx/ox/j2sdk1.4.2_10/bin"

PATH=$JAVA_HOME/bin:$PATH

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

#设置了环境变量后,可在命令提示符下检查:

echo $JAVA_HOME

java  -version

 

解压jaf-1_0_2-upd2.zipjavamail-1_4-ea.zip,分别把其中的mail.jaractivation.jar拷贝到

/usr/share/java目录下

 

apt-get install ant

 

Apache官方网站下载

jakarta-tomcat-5.0.28.tar.gz

jakarta-tomcat-5.0.28-deployer.tar.gz

/home/xkx目录下

 

tar –xvzf  jakarta-tomcat-5.0.28.tar.gz

cd  akarta-tomcat-5.0.28/bin

./startup.sh

 

jakarta-tomcat-5.0.28-deployer.tar.gz解压后取出servlet-api.jar,并拷贝到/usr/share/java下。

 

 

Configure

 

1 Postgresql

 

service postgresql start

编辑文件/var/lib/pgsql/data/postgresql.conf,确保有下面这样一行:

tcpip_socket = true

 

编辑文件/var/lib/pgsql/data/pg_hba.conf,确保有下面这样的两行:

local   all         all                                             trust

host    all         all         127.0.0.1         255.255.255.255      trust

 

service postgresql restart

useradd ox

su – postgres

createuser -A -D -P openxchange

键入密码:123456

createdb openxchange

exit

 

2、安装OX

 

http://mirror.open-xchange.org/ox/EN/community/download.htm下载

open-xchange-0.8.0-6.tar.gz

/home/xkx/ox

 

tar –xvzf open-xchange-0.8.0-6.tar.gz

cd open-xchange-0.8.0-6

export OX_INSTALL=/usr/local/ox

 

./configure \

--prefix=$OX_INSTALL \

--with-mailjar=/usr/share/java/mail.jar \

--with-activationjar=/usr/share/java/activation.jar \

--with-jdomjar=/usr/share/java/jdom-1.0.jar \

--with-xercesjar=/usr/share/java/xerces-j2-2.6.2.jar \

--with-jsdkjar=/usr/share/java/servlet-api.jar \

--with-jdbcjar=/usr/share/pgsql/pg73jdbc3.jar \

--enable-webdav \

--with-htdocsdir=/home/htdocs \

--with-cgibindir=/home/cgi-bin \

--with-dbname=openxchange \

--with-dbuser=openxchange \

--with-dbpass=123456 \

--with-dbhost=localhost \

--with-runuid=ox \

--with-rungid=ox

 

make

make install

 

在浏览器中输入http://192.168.0.185/cgi-bin/login.pl看是否能看到登录的画面。

 

3、配置Servlet

 

cd  /home/xkx/jakarta-tomcat-5.0.28/webapps

mkdir servlet

mkdir servlet/WEB-INF

mkdir servlet/WEB-INF/classes

mkdir servlet/WEB-INF/lib

cd servlet/WEB-INF/

cp $OX_INSTALL/share/servlets/*.class classes/

cp $OX_INSTALL/lib/* lib/

cp lib/umin.war  .

 

http://sietse.net/exoops/modules/OpenXchange/?distr=rh9下载web.xml

并把所有中的open-xchange改为ox

之后把文件放在/home/xkx/jakarta-tomcat-5.0.28/webapps/servlet/WEB-INF目录下

 

重新启动tomcat,即:

cd  /home/xkx/jakarta-tomcat-5.0.28/bin

./shutdown.sh

./startup.sh

 

在浏览器中输入:http://192.168.0.185:8080/servlet/intranet 可以看到“The Open-XChange(tm) Server is not running-Groupware  Please inform the Administrator!

 

在文件/home/xkx/jakarta-tomcat-5.0.28/conf/tomcat-users.xml中添加一行:

 

 

4、整合ApacheTomcat

 

cp /usr/share/doc/mod_jk-ap20-1.2.5/workers.properties.sample /etc/httpd/conf/workers.properties

 

/etc/httpd/conf.d/下创建文件mod_jk.conf,内容如下:

 

JkWorkersFile   /home/conf/workers.properties

JkLogFile       /home/logs/mod_jk.log

JkLogLevel      error

JkMount /servlet/* ajp13

JkMount /umin/* ajp13

JkMount /*.jsp ajp13

JkMount /examples/* ajp13

JkMount /servlet/webdav.contacts* ajp13

JkMount /servlet/webdav.ical* ajp13

JkMount /servlet/weddav.documents* ajp13

JkMount /servlet/webdav.calendar* ajp13

JkMount /servlet/webdav.tasks* ajp13

JkMount /servlet/webdav.contacts* ajp13

JkMount /servlets-examples/* ajp13

JkMount /jsp-examples/* ajp13

#JkMount /servlet/intranet/* ajp13

 

Apache官方网站下载jakarta-tomcat-connectors-1.2.15-src.tar.gz

/home/xkx目录下

 

tar –xvzf jakarta-tomcat-connectors-1.2.15-src.tar.gz

cd   /home/xkx/jakarta-tomcat-connectors-1.2.15-src/jk/native

./configure \

--with-apxs=/home/bin/apxs

--with-java-home=/home/xkx/ox/j2sdk1.4.2_10

make

make install

#之后会发现/home/modules下多了一个文件mod_jk.so

 

/home/conf/httpd.conf中加入:

 

LoadModule jk_module modules/mod_jk.so

Include /etc/httpd/conf.d/mod_jk.conf

 

修改文件/home/conf/workers.properties

 

workers.tomcat_home=/home/xkx/jakarta-tomcat-5.0.28

workers.java_home=/home/xkx/ox/j2sdk1.4.2_10

 

重新启动Tomcat

 

在浏览器中重新输入http://192.168.0.185/servlet/intranet

如能看到和8080端口一样的内容则整合成功

 

5、为数据库Postgresql创建表

 

psql -dopenxchange -h localhost -Uopenxchange -W -f $OX_INSTALL/share/init_database.sql

psql -dopenxchange -h localhost -Uopenxchange -W

INSERT INTO sys_gen_rights_template values
('now','admin','now','','default_template','y','y','y','y',
'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y',
'y','y','y','y','y','y','y','y','y','y','y','y','y','y','y',
'y','y','y','y','y','y','y','y','y','y','y','y','y');

\q

 

#总共47y

 

 

6、是Tomcat开机自动运行

/etc/rc.d/init.d下创建文件tomcat,内容如下:

 

RETVAL=$?

CATALINA_HOME="/home/xkx/jakarta-tomcat-5.0.28"

 

case "$1" in

start)

if [ -f $CATALINA_HOME/bin/startup.sh ];

then

echo $"Starting Tomcat"

/bin/su - root -c $CATALINA_HOME/bin/startup.sh

fi

;;

stop)

if [ -f $CATALINA_HOME/bin/shutdown.sh ];

then

echo $"Stopping Tomcat"

/bin/su - root -c $CATALINA_HOME/bin/shutdown.sh

fi

;;

*)

echo $"Usage: $0 {start|stop}"

exit 1

;;

Esac

 

 

7、配置LDAP

 

编辑/etc/openldap/slapd.conf文件。使其内容从63行起如下:

 

include         /usr/local/ox/share/openxchange.schema

 

suffix "dc=example,dc=org"

rootdn "cn=Manager,dc=example,dc=org"

#注意上面两行的“,”与字母间千万不能有空格!!!以下类似。

rootpw secret

 

你可能感兴趣的:(Tomcat,Servlet,PostgreSQL,Perl,Linux)