一、 软件列表
软件 版本
os Red Hat Linux
jdk jdk-1_5_0_05-linux-i586-rpm.bin
jboss JBoss 4.0.3RC1
openssl openssl-0.9.8d
apr apr-0.9.12
apr-util apr-util-0.9.12
apache apache2.0.54
tomcat-connectors tomcat-connectors-1.2.23-src
freetype freetype-2.3.4
gd gd-2.0.33
jpeg jpegsrc.v6b
libpng libpng-1.2.18
libxml libxml2-2.6.11
zlib zlib-1.2.3
php php5.2.3
sendmail sendmail-8.12.8-4.i386.rpm
sendmail-cf sendmail-cf-8.12.8-4.i386.rpm
sendmail-doc sendmail-doc-8.12.8-4.i386.rpm
postgresql postgresql-8.1.3
二、软件安装
1、安装jdk
[root@www2 redadmin]# cd /usr/local/carlink
[root@www2 redadmin]# chmod +x jdk-1_5_0_05-linux-i586-rpm.bin
[root@www2 redadmin]# ./jdk-1_5_0_05-linux-i586-rpm.bin
[root@www2 redadmin]# cd /usr/java/
[root@www2 redadmin]# ln -s /usr/java/jdk1.5.0_05 /usr/local/java
[root@www2 redadmin]# vi /etc/profile
JAVA_HOME=/usr/local/carlink/java
CLASSPATH=/usr/local/carlink/java/lib/dt.jar:/usr/local/java/lib/tools.jar
PATH=/usr/local/carlink/java/bin:$PATH
export PATH JAVA_HOME CLASSPATH
[root@www2 redadmin]# source /etc/profile
2、安装jboss
[root@www2 redadmin]# cd /usr/local/carlink
[root@www2 redadmin]# tar xvfz jboss-4.0.3RC1.tar.gz
[root@www2 redadmin]# mv jboss-4.0.3RC1 jboss4
[root@www2 redadmin]# vi /etc/profile
JAVA_HOME=/usr/local/carlink/java
CLASSPATH=/usr/local/carlink/java/lib/dt.jar:/usr/local/carlink/java/lib/tools.jar
PATH=/usr/local/carlink/java/bin:$PATH
JBOSS_HOME=/usr/local/carlink/jboss4
export PATH JAVA_HOME CLASSPATH JBOSS_HOME
[root@www2 redadmin]# source /etc/profile
3、安装apr
[root@www2 redadmin]# tar xvfz apr-0.9.12.tar.gz
[root@www2 redadmin]# cd apr-0.9.12
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/apr
[root@www2 redadmin]# make && make install
4、安装apr-util
[root@www2 redadmin]# tar xvfz apr-util-0.9.12.tar.gz
[root@www2 redadmin]# cd apr-util-0.9.12
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/apr-util
--with-apr=/usr/local/modules/apr
[root@www2 redadmin]# make && make install
5、安装openssl
[root@www2 redadmin]# tar xvfz openssl-0.9.8d.tar.gz
[root@www2 redadmin]# cd opensll-0.9.8d
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/openssl
[root@www2 redadmin]# make && make install
6、安装apache
[root@www2 redadmin]# tar xzvf httpd-2.0.59.tar.gz
[root@www2 redadmin]# cd httpd-2.0.59
[root@www2 redadmin]# ./configure --prefix=/usr/local/carlink/apache
--enable-proxy=share --enable-proxy-ajp=share
--enable-rewrite=share --enable-dav=share --enable-so
--enable-ssl=static --with-apr=/usr/local/modules/apr/
--with-apr-util=/usr/local/modules/apa-util/
--with-ssl=/usr/local/modules/openssl/
--enable-mods-shared=all
[root@www2 redadmin]# make && make install
7、安装zlib
[root@www2 redadmin]# tar xzvf zlib-1.2.3.tar.gz
[root@www2 redadmin]# cd zlib-1.2.3
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/zlib
[root@www2 redadmin]# make && make install
8、安装freetype
[root@www2 redadmin]# tar xzvf freetype-2.3.4.tar.gz
[root@www2 redadmin]# cd freetype-2.3.4
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/freetype
[root@www2 redadmin]# make && make install
9、安装libpng
[root@www2 redadmin]# tar xzvf libpng-1.2.18.tar.gz
[root@www2 redadmin]# cd libpng-1.2.18
[root@www2 redadmin]# cp scripts/makefile.std makefile
[root@www2 redadmin]# make install
10、安装jpeg
[root@www2 redadmin]# mkdir /usr/local/modules/jpeg6
[root@www2 redadmin]# mkdir /usr/local/modules/jpeg6/bin
[root@www2 redadmin]# mkdir /usr/local/modules/jpeg6/lib
[root@www2 redadmin]# mkdir /usr/local/modules/jpeg6/include
[root@www2 redadmin]# mkdir /usr/local/modules/jpeg6/man
[root@www2 redadmin]# mkdir /usr/local/modules/jpeg6/man/man1
[root@www2 redadmin]# tar xzvf jpegsrc.v6b.tar.gz
[root@www2 redadmin]# cd jpeg6
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/jpeg6
--enable-shared --enable-static
[root@www2 redadmin]# make
[root@www2 redadmin]# make install
11、安装gd
[root@www2 redadmin]# tar xzvf gd-2.0.33.tar.gz
[root@www2 redadmin]# ./configure --prefix=/usr/local/modules/gd
--with-jpeg=/usr/local/modules/jpeg6
--with-png=/usr/local/modules/libpng
--with-zlib=/usr/local/modules/zlib
--with-freetype=/usr/local/modules/freetype
[root@www2 redadmin]# make
[root@www2 redadmin]# make install
12、安装libxml
[root@www2 redadmin]# tar xzvf libxml2-2.6.11.tar.gz
[root@www2 redadmin]# cd libxml2-2.6.11
[root@www2 redadmin]# ./configure
[root@www2 redadmin]# make
[root@www3 redadmin]# make install
13、安装postgresql
[root@www2 redadmin]# cd /usr/local/carlink
[root@www2 redadmin]# tar xvfz postgresql-8.0.3.tar.gz
[root@www2 redadmin]# cd postgresql-8.0.3
[root@www2 redadmin]# ./configure --prefix=/usr/local/carlink/postgresql && make && make install
[root@www2 redadmin]# useradd postgres -p postgres -d /usr/local/postgresql
[root@www2 redadmin]# chown postgres /usr/local/postgresql
[root@www2 redadmin]# mkdir /usr/local/carlink/postgresql/data
[root@www2 redadmin]# chown postgres /usr/local/carlink/postgresql/data
[root@www2 redadmin]# su postgres
[root@www2 redadmin]# /usr/local/carlink/postgresql/bin/initdb -D /usr/local/carlink/postgresql/data
[root@www2 redadmin]# vi /usr/local/carlink/postgresql/data/pg_hba.conf
# IPv4 local connections:
host all all 172.19.119.0/12 trust
[root@www2 redadmin]# vi /usr/local/postgresql/data/postgresql.conf
listen_addresses = '*' # what IP interface(s) to listen on;
# defaults to localhost, '*' = any
14、安装php
[root@www2 redadmin]# tar xzvf php-5.2.3.tar.gz
[root@www2 redadmin]# cd php-5.2.3
[root@www2 redadmin]# ./configure --prefix=/usr/local/carlink/php
--with-apxs2=/usr/local/carlink/apache/bin/apxs
--with-pgsql-dir=/usr/local/carlink/postgresql
--with-xml --with-png=/usr/local/modules/libpng
--with-jpeg-dir=/usr/local/modules/jpeg6
--with-zlib=/usr/local/modules/zlib
--with-freetype=/usr/local/modules/freetype
--with-gd=/usr/local/modules/gd
--enable-track-vars --enable-mbstring=all
[root@www2 redadmin]# make
[root@www2 redadmin]# make install
[root@www2 redadmin]# cp php.ini-dist /usr/local/carlink/php/lib/php.ini
15、安装tomcat-connectors
[root@www2 redadmin]# tar xzvf tomcat-connectors-1.2.23-src.tar.gz
[root@www2 redadmin]# cd tomcat-connectors-1.2.23-src
[root@www2 redadmin]# chmod 755 buildconf.sh
[root@www2 redadmin]# ./buildconf.sh
[root@www2 redadmin]# ./configure --with-apxs=/usr/local/apache/bin/apxs
[root@www2 redadmin]# make
[root@www2 redadmin]# make install
[root@www2 redadmin]# cd native/apache-2.0/
[root@www2 redadmin]# cp mod_jk.so /usr/local/carlink/apache/modules/
三、系统配置
[root@www2 redadmin]# vi /usr/local/apache/conf/httpd.conf
在文件最末尾加上如下语句
# Load mod_jk
LoadModule jk_module modules/mod_jk.so
# Configure mod_jk
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /*.jsp loadbalancer
JkMount /servlet/* loadbalancer
JkMount /application/* loadbalancer
[root@www2 redadmin]# vi /usr/local/carlink/apache/conf/workers.properties
#ln Unix, we use forward slashes:
ps=/
# list the workers by name
worker.list=tomcat1
# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=8009
worker.tomcat1.host=127.0.0.1
worker.tomcat1.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=100
# ------------------------
# Load Balancer worker
# ------------------------
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1
[root@www2 redadmin]# vi $JBOSS_HOME/server/newmsupport/deploy/jbossweb-tomcat/server.xml
<!-- A AJP 1.3 Connector on port 8009 -->
<Connector port="8009" address="${jboss.bind.address}"
emptySessionPath="true" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3"/>
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="tomcat1">
[root@www2 redadmin]# mkdir /usr/local/carlink/apache/conf/ssl.key
[root@www2 redadmin]# mkdir /usr/local/carlink/apache/conf/ssl.crt
[root@www2 redadmin]# openssl req -new -out server.csr
Generating a 1024 bit RSA private key
.........................................++++++
......++++++
writing new private key to 'privkey.pem'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:zh
State or Province Name (full name) [Berkshire]:shaanxi
Locality Name (eg, city) [Newbury]:xi'an
Organization Name (eg, company) [My Company Ltd]:softroad
Organizational Unit Name (eg, section) []:softroad
Common Name (eg, your name or your server's hostname) []:jiang
Email Address []:jbakwd@163.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@www2 redadmin]# openssl rsa -in privkey.pem -out server.key
Enter pass phrase for privkey.pem:
writing RSA key
[root@www2 redadmin]# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
Signature ok
subject=/C=zh/ST=shaanxi/L=xi'an/O=softroad/
OU=softroad/CN=jiang/emailAddress=jbakwd@163.com
Getting Private key
[root@www2 redadmin]# cp server.crt /usr/local/carlink/apache/conf/ssl.crt/
[root@www2 redadmin]# cp server.key /usr/local/carlink/apache/conf/ssl.key/
[root@www2 redadmin]#
vi /usr/local/carlink/apache/conf/ssl.conf
Listen 443
DocumentRoot "/usr/local/carlink/stad"
SSLCertificateFile /usr/local/carlink/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/carlink/apache/conf/ssl.key/server.key
[root@www2 redadmin]# /usr/local/carlink/apache/bin/apachectl startssl
[root@www2 redadmin]# /usr/local/carlink/apache/bin/apachectl stop