网上书店营销系统的软硬件安装与配置说明(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]/直接访问页面。