tar xzvfapache-ant-1.7.0-bin.tar.gz –C /opt
note:download from http://archive.apache.org/dist/ant/binaries/, you must check apache-ant-1.7.0/lib, it must not be null,for some source codeis lack of lib files.
8. Install postgresql
8.1 Download file:http://www.postgresql.org/download/
8.2 Create user and group:
groupadd -g 88 postgres
useradd -u88 -g 88 -d /usr/local/pgsql –mpostgres
passwd postgres
chmod 755/usr/local/pgsql/
8.3unzip and complile
# su - postgres
$ tar xvfz postgresql-8.2.7.tar.gz
$ cd postgresql-8.2.7
$ ./configure –prefix=/usr/local/pgsql
$ make
At this time,meet an error,solution as below:
yum install gcc gcc-c++ autoconf automake
the second error,solution as below
yum install readline-devel
the thirderror,solution as below
yum install zlib-devel
$ make install
8.4 Create db dataand initialize db:
# mkdir /usr/local/pgsql/data
# chown postgres /usr/local/pgsql/data
# su - postgres
$ initdb -D /usr/local/pgsql/data
$ cd /usr/local/pgsql/data
8.5 Configure listenaddress and port.
$ vi postgresql.conf listen_addresses = '*' port = 5432 password_encryption = on
8.5 Configureconnection hosts trusted.
vim data/pg_hba.conf
$ vi pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 trust host all all 192.168.5.0/24 trust
8.6 Configurestartup options:
# cd postgresql-8.2.7
# cp contrib/start-scripts/linux /etc//init.d/postgres
# chmod 755 /etc/init.d/postgres
# /etc/rc.d/init.d/postgres start
Create the path for the entire environment
Add codes as below to /etc/profile
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.5.0_15
export JRE_HOME=$JAVA_HOME/jre
export TOMCAT_BASE=/opt/tomcat6
export JAVA_OPTS="-Djava.awt.headless=true-server -Xms768m -Xmx768m -XX:MaxPermSize=128m -XX:PermSize=128m-XX:MaxNewSize=128m -XX:NewSize=128m -Xincgc"
export TOMCAT_HOME=/opt/tomcat6
export CATALINA_HOME=/opt/tomcat6
export ANT_HOME=/opt/ant-1.7.0
export CLASSPATH=/opt/tomcat6
export HTTPD_HOME=/usr/local/apache2
export PGSQ_HOME=/usr/local/pgsql
export PATH=$JAVA_HOME/bin:$TOMCAT_HOME/bin:$HTTPD_HOME/bin:$PGSQ_HOME/bin:$PATH
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin Integrateapache and tomcat with mod_proxy
1.Modify apache’s configuration file:
vim /usr/local/apache2/conf/httpd.conf
include conf/extra/httpd-vhosts.conf (to get rid of “#”)
NameVitualHost127.0.0.1:80