網上書店營銷系統的軟硬件安裝與配置說明(beta)
運行平台:
Intel-i686-40G-256M----Server;
Red Hat Linux
7.2(engima),PostgreSql7.2.1,apache1.3.22
基本軟件需要及獲得:
操作系統:Red Hat Linux7.2;
數據庫系統:PostgreSql7.2.1;
WEB服務器:apache1.3.22;
Jdk1.3.1,Linux Version(RPM包);
Java&JSP解析引擎:Caucho Resin 2.0.4;
PostgreSql--JDBC驅動程序:pgjdbc2.jar;
安裝步驟:
采用默認安裝好Red Hat Linux7.2;
系統環境設置:
export LANG=zh_CN
export LC_ALL=zh_CN
根據以下步驟安裝系統運行時環境:
1,安裝JDK1.3.1(Red Hat Linux安裝版的RPM包);
rpm –ivh jdk1.3.1.i386.rpm
export JAVA_HOME=/usr/Java/jdk
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$Java_HOME/jre/lib
2,安裝apache1.3.22( Current path=/usr/local )
tar –xzvf apache1.3.22.tar.gz
./configure –prefix=/usr/local/apache –enable-module=so
make
make install
3,安裝Resin2.0.4( Current path=/usr/local/resin )
tar –xvf resin2.0.4.tar
./configure –with-apache=/usr/local/apache
make
make install
4,安裝PostgreSql7.2.1(Red Hat Linux安裝版的RPM包)
rpm –ivh postgresql-libs-7.2.1-5.i386.rpm
rpm –ivh postgresql-7.2.1-5.i386.rpm
rpm –ivh postgresql-server-7.2.1-5.i386.rpm
rpm –ivh postgresql-devel-7.2.1-5.i386.rpm
rpm –ivh postgresql-jdbc-7.2.1-5.i386.rpm
mv pgjdbc2.jar $Java_HOME/lib
export CLASSPATH=$CLASSPATH:$Java_HOME/lib/pgjdbc2.jar
初始化數據庫:
mkdir /usr/local/pgsql/data
export PGDATA=/usr/local/pgsql/data
su postgres
initdb
postmaster –i &
createdb –e EUC-CN dbebook
psql dbebook
Create table users(id SERIAL,name varchar(16),passwd varchar(16),email varchar(60),address varchar(100),zipcode varchar(8),phone varchar(14),level varchar(12));
Create table books (id SERIAL,isbn varchar(15),title varchar(255),author varchar(50),summary varchar(500),price decimal(12),classid int,discount int,image bytea);
Create table bookclass (id SERIAL,class varchar(16),parentid int,depth int);
Create table orders (id SERIAL,shopcartid integer [],email varchar(100),ordertime timestamp(0),totalprice decimal(16),status varchar(10));
ALTER TABLE orders ALTER ordertime SET DEFAULT now();
Create table shopcarts (id SERIAL,bookid int,quantity int,unitprice decimal(12),commit boolean );
Create table Operators (id SERIAL,name varchar(10),passwd varchar(16),email varchar(50),dept varchar(10));
ALTER TABLE Operators ALTER dept SET DEFAULT 'normal';
ALTER TABLE shopcarts ALTER commit SET DEFAULT FALSE;
ALTER TABLE orders ALTER status SET DEFAULT 'notpayfor';
設置數據庫的網絡端口偵聽及用戶:
eMacs(or vi) $PGDATA/pg_hba.conf
5,安裝文檔及運行
拷貝WEB應用到/usr/local/apache/htdocs下;
重啟所有服務(apachectl, postmaster, httpd.sh);
6,通過http://[hostname]/直接訪問頁面。