Redhat+Oracle8+PHP4+Apache+营帐系统安装

(以下安装都在移动PC上)

----------------------------------------------------------------------------------------------
需要事先准备的软件:
1.RedHat7.2光盘两张
2.oracle8.1.7 for linux
3.jdk118_v3-glibc-2.1.3.tar.bz2
4.php-4.0.6.tar.gz
5.apache_1.3.20.tar.gz
----------------------------------------------------------------------------------------------

一.安装RedHat7.2(一小时内搞定)

1.一路点next(选择custom安装,sofware development和kernal development要选,这样会为将来安装一些软件
减少不必要的麻烦,最好选择everything,选择nofirewall,注意要配置IP,DNS).
安装完后:
# df -k
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda10 497829 52802 419325 12% /
/dev/hda6 22279700 121100 21026824 1% /array
/dev/hda1 54416 3485 48122 7% /boot
/dev/hda7 3028080 20 2874240 1% /oracle
/dev/hda8 2016016 1082924 830680 57% /usr
/dev/hda11 248895 19827 216218 9% /var
/dev/hda9 1011928 20 960504 1% /www

2.修改参数,保证xwindow好使:
# vi /etc/lilo.conf
增加vga=791
# lilo
# cd /etc/X11/
# cp XF86Config-4 XF86Config-4.wnc
# vi XF86Config-4
编辑以下section:
-----------------------------------------
Section "Device"
# no known options
Identifier "SiS 630"
Driver "sis"
VendorName "SiS 630"
BoardName "SiS 630"

#BusID
EndSection

Section "Device"
# no known options
Identifier "Linux Frame Buffer"
Driver "fbdev"
VendorName "SiS 630"
BoardName "SiS 630"

#BusID
EndSection

Section "Screen"
Identifier "Screen0"
Device "Linux Frame Buffer"
Monitor "Monitor0"
DefaultDepth 16

Subsection "Display"
Depth 16
Modes "1024x768"
EndSubsection
EndSection
-------------------------------------------
给XFree86建链接
# ln -snf /usr/X11R6/bin/XFree86 X
# reboot
# startx
这时候就可以进入Xwindow系统了...

3.修改xinetd参数文件,保证网络好使:
# cd /etc/xinetd.d
# vi telnet
注释掉这一行
disable = yes
# vi wu-ftpd
注释掉这一行
disable = yes
然后重起xinetd
# cd /etc/rc.d/init.d/
# ./xinetd stop
# ./xinetd start
# ping 192.168.216.151

4.如果需要配置系统用setup命令来设置
# setup

5.以下为安装redhat7.1时升级的东东,有参考意义:(Must update kernel package and GCC package)
----------------------------------------------------------------------------------------------
更新除内核外其它包:
# cp /mnt/cdrom/RedHat/RPMS/*.rpm /usr/src/RPMS/
# rpm -Fvh *.rpm
arts-2.1.2-1.i386.rpm krb5-server-1.2.2-5.i386.rpm samba-common-2.0.10-2.i386.rpm
binutils-2.10.0.18-1.i386.rpm krb5-workstation-1.2.2-5.i386.rpm samba-swat-2.0.10-2.i386.rpm
cpp-2.96-85.i386.rpm libstdc++-2.96-85.i386.rpm SysVinit-2.78-17.i386.rpm
devfsd-2.4.3-12.i386.rpm libstdc++-devel-2.96-85.i386.rpm up2date-2.5.4-1.i386.rpm
elm-2.5.5-1.i386.rpm losetup-2.11b-3.i386.rpm up2date-gnome-2.5.4-1.i386.rpm
gcc-2.96-85.i386.rpm LPRng-3.7.4-23.i386.rpm util-linux-2.10s-13.7.i386.rpm
gcc-c++-2.96-85.i386.rpm man-1.5i2-0.7x.i386.rpm wireless-tools-21-1.i386.rpm
gcc-chill-2.96-85.i386.rpm mgetty-1.1.25-5.i386.rpm Xconfigurator-4.9.29-1.i386.rpm
gcc-g77-2.96-85.i386.rpm mgetty-sendfax-1.1.25-5.i386.rpm XFree86-3DLabs-3.3.6-38.i386.rpm
gcc-java-2.96-85.i386.rpm mgetty-viewfax-1.1.25-5.i386.rpm XFree86-8514-3.3.6-38.i386.rpm
gcc-objc-2.96-85.i386.rpm mgetty-voice-1.1.25-5.i386.rpm XFree86-AGX-3.3.6-38.i386.rpm
gftp-2.0.8-1.i386.rpm minicom-1.83.1-8.i386.rpm XFree86-FBDev-3.3.6-38.i386.rpm
gnupg-1.0.6-1.i386.rpm mount-2.11b-3.i386.rpm XFree86-Mach32-3.3.6-38.i386.rpm
imap-2000c-10.i386.rpm mouseconfig-4.22-1.i386.rpm XFree86-Mach64-3.3.6-38.i386.rpm
imap-devel-2000c-10.i386.rpm netscape-common-4.77-1.i386.rpm XFree86-Mach8-3.3.6-38.i386.rpm
kdelibs-2.1.2-1.i386.rpm netscape-communicator-4.77-1.i386.rpm XFree86-Mono-3.3.6-38.i386.rpm
kdelibs-devel-2.1.2-1.i386.rpm netscape-navigator-4.77-1.i386.rpm XFree86-P9000-3.3.6-38.i386.rpm
kdelibs-sound-2.1.2-1.i386.rpm nss_ldap-149-4.i386.rpm XFree86-S3-3.3.6-38.i386.rpm
kdelibs-sound-devel-2.1.2-1.i386.rpm openssl095a-0.9.5a-9.i386.rpm XFree86-S3V-3.3.6-38.i386.rpm
kernel-2.4.3-12.i386.rpm openssl-0.9.6-9.i386.rpm XFree86-SVGA-3.3.6-38.i386.rpm
kernel-BOOT-2.4.3-12.i386.rpm openssl-devel-0.9.6-9.i386.rpm XFree86-VGA16-3.3.6-38.i386.rpm
kernel-doc-2.4.3-12.i386.rpm openssl-perl-0.9.6-9.i386.rpm XFree86-W32-3.3.6-38.i386.rpm
kernel-headers-2.4.3-12.i386.rpm openssl-python-0.9.6-9.i386.rpm xinetd-2.3.0-1.71.i386.rpm
kernel-source-2.4.3-12.i386.rpm procmail-3.21-0.71.i386.rpm xloadimage-4.1-20.i386.rpm
krb5-devel-1.2.2-5.i386.rpm samba-2.0.10-2.i386.rpm ypbind-1.7-8.i386.rpm
krb5-libs-1.2.2-5.i386.rpm samba-client-2.0.10-2.i386.rpm
Preparing... ########################################### [100%]
1:SysVinit ########################################### [ 2%]
2:cpp ########################################### [ 5%]
3:devfsd ########################################### [ 8%]
4:elm ########################################### [ 10%]
5:gcc ########################################### [ 13%]
6:gcc-g77 ########################################### [ 16%]
7:gcc-objc ########################################### [ 18%]
8:gftp ########################################### [ 21%]
9:gnupg ########################################### [ 24%]
10:krb5-libs ########################################### [ 27%]
11:LPRng ########################################### [ 29%]
12:krb5-devel ########################################### [ 32%]
13:libstdc++ ########################################### [ 35%]
14:arts ########################################### [ 37%]
15:libstdc++-devel ########################################### [ 40%]
16:gcc-c++ ########################################### [ 43%]
17:losetup ########################################### [ 45%]
18:man ########################################### [ 48%]
19:mount ########################################### [ 51%]
20:mouseconfig ########################################### [ 54%]
21:Xconfigurator ########################################### [ 56%]
22:netscape-common ########################################### [ 59%]
23:netscape-communicator ########################################### [ 62%]
24:openssl ########################################### [ 64%]
25:kdelibs ########################################### [ 67%]
26:kdelibs-devel ########################################### [ 70%]
27:kdelibs-sound ########################################### [ 72%]
28:kdelibs-sound-devel ########################################### [ 75%]
29:nss_ldap ########################################### [ 78%]
30:openssl-devel ########################################### [ 81%]
31:procmail ########################################### [ 83%]
32:up2date ########################################### [ 86%]
33:up2date-gnome ########################################### [ 89%]
34:util-linux ########################################### [ 91%]
35:xinetd ########################################### [ 94%]
36:xloadimage ########################################### [ 97%]
37:ypbind ########################################### [100%]

更新内核kernel:
# mv kernel*.rpm kernel
linux-2.4
Update:
ftp://updates.redhat.com/7.1/en/os/i386/kernel-2.4.3-12.i386.rpm
ftp://updates.redhat.com/7.1/en/os/i386/kernel-headers-2.4.3-12.i386.rpm
ftp://updates.redhat.com/7.1/en/os/i386/kernel-source-2.4.3-12.i386.rpm

0.check now version
# rpm -q kernel kernel-headers kernel-ibcs kernel-pcmcia-cs kernel-source
kernel-2.4.2-2
kernel-headers-2.4.2-2
package kernel-ibcs is not installed
package kernel-pcmcia-cs is not installed
kernel-source-2.4.2-2

1.check md5sum code
# rpm -K --nopgp *rpm
kernel-2.4.3-12.i386.rpm: md5 (GPG) OK (MISSING KEYS: GPG#DB42A60E)
kernel-BOOT-2.4.3-12.i386.rpm: md5 (GPG) OK (MISSING KEYS: GPG#DB42A60E)
kernel-doc-2.4.3-12.i386.rpm: md5 (GPG) OK (MISSING KEYS: GPG#DB42A60E)
kernel-headers-2.4.3-12.i386.rpm: md5 (GPG) OK (MISSING KEYS: GPG#DB42A60E)
kernel-source-2.4.3-12.i386.rpm: md5 (GPG) OK (MISSING KEYS: GPG#DB42A60E)

2.update rpm package
# rpm -Uvh kernel-headers-2.0.36-1.i386.rpm kernel-source-2.0.36-1.i386.rpm
kernel-headers ##################################################
kernel-source ##################################################
# rpm -ivh kernel-2.0.36-1.i386.rpm
kernel ##################################################
# rpm -Uvh kernel-2.4.3-12.i386.rpm
# rpm -Uvh kernel-doc-2.4.3-12.i386.rpm
# rpm -Uvh kernel-source-2.4.3-12.i386.rpm
# rpm -Uvh kernel-headers-2.4.3-12.i386.rpm

3./boot 下已经是kernel-2.4.3-12.i386了

4.set lilo
# vi /etc/lilo.conf
image=/boot/vmlinuz-2.4.3-12
label=linux
read-only
root=/dev/hda5
# /sbin/lilo -v

5.reboot

6.clean old version kernel
# rpm -q kernel kernel-headers kernel-ibcs kernel-pcmcia-cs kernel-source
kernel-2.4.2-2
kernel-2.4.3-12
kernel-headers-2.4.3-12
package kernel-ibcs is not installed
package kernel-pcmcia-cs is not installed
kernel-source-2.4.3-12
test to delete:
# rpm -e --test kernel-2.4.2-2
real delete
# rpm -e kernel-2.4.2-2
----------------------------------------------------------------------------------------------

二.安装oracle8.1.7

1.安装6.2兼容包(以compat打头的软件包,在RedHat7.2的光盘/RedHat/RPMS下面,有两张光盘)
把这些包binary方式ftp到/usr/src下
或者:
# cd /usr/src
# cp /mnt/cdrom/RedHat/RPMS/compat* ./
# umount /mnt/cdrom
# mount /mnt/cdrom /dev/cdrom
在第二张盘:(前3个最好按顺序,且一定要安装上,不然安装oracle时会出错的,如果出现错误那就升级redhat)
compat-glibc-6.2-2.1.3.2.i386.rpm
compat-libs-6.2-3.i386.rpm
compat-egcs-6.2-1.1.2.16.i386.rpm
compat-egcs-c++-6.2-1.1.2.16.i386.rpm
compat-egcs-g77-6.2-1.1.2.16.i386.rpm
compat-egcs-objc-6.2-1.1.2.16.i386.rpm
在第一张盘:
compat-libstdc++-6.2-2.9.0.16.i386.rpm
# rpm -K --nopgp *rpm (check md5sum code)
# su - root
# cd /usr/src
# rpm -ivh *rpm
# rpm -qa | grep compat-
compat-egcs-6.2-1.1.2.16
compat-egcs-g77-6.2-1.1.2.16
compat-libstdc++-6.2-2.9.0.14
compat-glibc-6.2-2.1.3.2
compat-libs-6.2-3
compat-egcs-objc-6.2-1.1.2.16
compat-egcs-c++-6.2-1.1.2.16

2.加入JDK(下载jdk118_v3-glibc-2.1.3.tar.bz2并binary方式ftp到/usr/src下)
# tar xvIf jdk118_v3-glibc-2.1.3.tar.bz2
# mv jdk118_v3 /usr/local
# ln -s /usr/local/jdk118_v3 /usr/local/java
下载oracle安装文件:
# cp /mnt/cdrom/linux81701.tar /usr/src
# tar xvf linux81701.tar

3.增加用户和组
# groupadd oinstall
# groupadd dba
# groupadd oper
# useradd oracle -g oinstall -G dba,oper
# passwd oracle
# mkdir /oracle
# chown oracle.dba /oracle
# chmod 775 /oracle
# vi /etc/passwd
把oracle用户的/home/oracle改为/oracle

4.以oracle用户登陆
# startx
# mv /home/oracle/.bash_profile /oracle
# vi /oracle/.bash_profile
增加:
----------------------------------------------------------------------------------------
# Oracle Env
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=/oracle/product/8.1.7; export ORACLE_HOME
ORACLE_SID=ora; export ORACLE_SID
PATH=$PATH:/oracle/product/8.1.7/bin; export PATH
CLASSPATH=.:/oracle/product/8.1.7/jdbc/lib/classes111.zip; export CLASSPATH
LD_LIBRARY_PATH=/oracle/product/8.1.7/lib; export LD_LIBRARY_PATH
ORA_NLS33=/oracle/product/8.1.7/ocommon/nls/admin/data; export ORA_NLS33
NLS_LANG="simplified chinese"; export NLS_LANG

# Set Linux kernel and GCC
export LD_ASSUME_KERNEL=2.2.5 #强制用低版本内核启动Java虚拟机
export LDEMULATION=elf_i386_glibc21 #强制使用glibc21
export GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc-lib/
# (上面三个东西只在安装的时候才用,oracle安装成功后就注释掉,不然apache和php的安装可能会有影响)
------------------------------------------------------------------------------------------
然后退出所有终端,重新登录确保环境变量生效,用env检查所有变量,最方便地是重新启动系统。
# source .bash_profile
# env | grep ORACLE

5.安装Oracle
# cd Disk1
# ./runInstaller
在Unix组名提示时,填入oinstall,然后按next,会弹出让你在另一个终端窗口运行orainstRoot.sh的提示,
在另一终端登录作为root,做下面的
# su
# cd /oracle/product/8.1.7/
# ./orainstRoot.sh
Creating Oracle Inventory pointer file (/etc/oraInst.loc)
Changing groupname of /oracle/oraInventory to oinstall.

JDK HOME中接受默认/usr/local/java, 给oracle global database 取名。

---------------
注意:安装到97%时出现ins_ctx.mk文件无法拷入......"的问题时,先不要点击任何按钮,将文件env_ctx.mk
复制到$ORACLE_HOME/ctx/lib,再击retry按钮即可.(其实直接点击ignore好像也没有什么大的影响)
# cp env_ctx.mk $ORACLE_HOME/ctx/lib(如果env_ctx.mk已经修改好)
---------------
在安装到最后Linking Oracle8i Enterprise Edition 8.1.7.0.1 , 97%时,会有一错误提示:
Error in invoking target install of makefile /oracle/product/8.1.7/ctx/lib/ins_ctx.mk
则需要在另一终端窗口下运行glibc修补文件glibc-2_1_3-stubs_tar.gz, 在另一终端下登录作为oracle,然后
# cd /oracle/product/8.1.7
# tar xvfz /usr/src/glibc-2_1_3-stubs_tar.gz
# ./setup_stubs.sh
出现如下的提示:
Setting up patch files...done.
Patching makefiles as necessary:
checking file '/oracle/product/8.1.7/rdbms/demo/demo_rdbms.mk'...patched.
checking file '/oracle/product/8.1.7/rdbms/demo/ociucb.mk'...patched.
checking file '/oracle/product/8.1.7/rdbms/lib/ins_rdbms.mk'...OK.
checking file '/oracle/product/8.1.7/rdbms/lib/env_rdbms.mk'...patched.
checking file '/oracle/product/8.1.7/network/lib/ins_net_client.mk'...OK.
checking file '/oracle/product/8.1.7/network/lib/env_network.mk'...patched.
checking file '/oracle/product/8.1.7/network/lib/ins_cman.mk'...OK.
checking file '/oracle/product/8.1.7/network/lib/ins_names.mk'...OK.
checking file '/oracle/product/8.1.7/network/lib/ins_oemagent.mk'...OK.
checking file '/oracle/product/8.1.7/network/lib/env_oemagent.mk'...patched.
checking file '/oracle/product/8.1.7/network/lib/ins_net_server.mk'...OK.
checking file '/oracle/product/8.1.7/network/lib/ins_nau.mk'...OK.
checking file '/oracle/product/8.1.7/plsql/lib/env_plsql.mk'...patched.
checking file '/oracle/product/8.1.7/plsql/lib/ins_plsql.mk'...OK.
checking file '/oracle/product/8.1.7/plsql/demo/demo_plsql.mk'...patched.
checking file '/oracle/product/8.1.7/precomp/lib/ins_precomp.mk'...OK.
checking file '/oracle/product/8.1.7/precomp/lib/env_precomp.mk'...patched.
checking file '/oracle/product/8.1.7/ldap/lib/env_ldap.mk'...patched.
checking file '/oracle/product/8.1.7/ldap/lib/ins_ldap.mk'...OK.
checking file '/oracle/product/8.1.7/ldap/demo/demo_ldap.mk'...patched.
checking file '/oracle/product/8.1.7/sqlplus/lib/env_sqlplus.mk'...patched.
checking file '/oracle/product/8.1.7/sqlplus/lib/ins_sqlplus.mk'...OK.
checking file '/oracle/product/8.1.7/ord/im/lib/env_ordim.mk'...patched.
checking file '/oracle/product/8.1.7/ord/img/demo/demo_ordimg.mk'...patched.
checking file '/oracle/product/8.1.7/ord/ts/demo/oci/src/demo_ordts.mk'...OK.
checking file '/oracle/product/8.1.7/ord/ts/demo/proc/src/demo_ordts.mk'...patched.
checking file '/oracle/product/8.1.7/ord/ts/lib/env_ordts.mk'...patched.
checking file '/oracle/product/8.1.7/md/demo/examples/demo_sdo.mk'...patched.
checking file '/oracle/product/8.1.7/md/demo/unix/motif/src/demo_motif.mk'...OK.
checking file '/oracle/product/8.1.7/md/demo/unix/motif/src/db_src/demo_dbsrc.mk'...OK.
checking file '/oracle/product/8.1.7/md/demo/unix/motif/src/main_src/demo_mainsrc.mk'...OK.
checking file '/oracle/product/8.1.7/otrace/demo/atmoci.mk'...patched.
checking file '/oracle/product/8.1.7/otrace/lib/env_otrace.mk'...patched.
checking file '/oracle/product/8.1.7/otrace/lib/ins_otrace.mk'...OK.
checking file '/oracle/product/8.1.7/ctx/lib/env_ctx.mk'...patched.
checking file '/oracle/product/8.1.7/ctx/lib/ins_ctx.mk'...OK.
Rebuilding client shared library...done.
Relinking executables:
running 'ins_rdbms.mk'...done.
running 'ins_net_client.mk'...done.
running 'ins_cman.mk'...done.
running 'ins_names.mk'...done.
running 'ins_oemagent.mk'...done.
running 'ins_net_server.mk'...done.
running 'ins_nau.mk'...done.
running 'ins_plsql.mk'...done.
running 'ins_precomp.mk'...done.
running 'ins_ldap.mk'...done.
running 'ins_sqlplus.mk'...done.
running 'ins_otrace.mk'...done.
running 'ins_ctx.mk'...done.

还没有完,然后再做下面的
# cd /oracle/product/8.1.7/ctx/lib
# vi env_ctx.mk
更改1374行 (vi文件,然后打入1374 G直接跳到该行)
CTXHX_LINKLINE=$(LINK) $(CTXLIB)ctxhx.$(OBJ_EXT) $(INSO_LINK) $(USRLIBS)
在最后加上 -ldl 变成
CTXHX_LINKLINE=$(LINK) $(CTXLIB)ctxhx.$(OBJ_EXT) $(INSO_LINK) $(USRLIBS) -ldl
再回到安装界面击retry.

弹出窗口要运行root.sh,提示如下:
A configuration script needs to be run as root before installation can proceed. Please
leave this windows up, go run /oracle/product/8.1.7/root.sh as root from another window,
then come back here and click OK to continue.
这个root.sh script有两处错误,我们先正确它们再运行。
更改/oracle/product/8.1.7/root.sh的第102行
RMF=/bin/rm -f 成为 RMF="/bin/rm -f"
更改第156行
RUID=`/usr/bin/id|$AWK -F( '{print $2}'|$AWK -F) '{print $1}`
成为
RUID=`/usr/bin/id|$AWK -F( '{print $2}'|$AWK -F) '{print $1}'`

登录作为root,运行它,下面是运行时的信息。
# su
IMPORTANT NOTE: Please delete any log and trace files previously
created by the Oracle Enterprise Manager Intelligent
Agent. These files may be found in the directories
you use for storing other Net8 log and trace files.
If such files exist, the OEM IA may not restart.
Running Oracle8 root.sh script...
nThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/product/8.1.7
ORACLE_SID= ora
Enter the full pathname of the local bin directory: [/usr/local/bin]:
nCreating /etc/oratab file...
Entry will be added to the /etc/oratab file by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
./root.sh: /oracle/product/8.1.7/network/trace/dbsnmp*.trc: No such file or directory
./root.sh: /oracle/product/8.1.7/network/trace/oratcl*.trc: No such file or directory
./root.sh: /oracle/product/8.1.7/network/log/dbsnmp*.log: No such file or directory
./root.sh: /oracle/product/8.1.7/network/log/nmiconf.log: No such file or directory
./root.sh: /oracle/product/8.1.7/bin/dbsnmp0: No such file or directory
./root.sh: /oracle/product/8.1.7/bin/oemevent0: No such file or directory
./root.sh: /oracle/product/8.1.7/bin/oratclsh0: No such file or directory
./root.sh: /oracle/product/8.1.7/network/agent/library/pkgIndex.tcl: No such file or
directory
./root.sh: /oracle/product/8.1.7/network/admin/snmp_ro.ora: No such file or directory
./root.sh: /snmp_ro.ora: No such file or directory
然后再回到安装界面击OK。

在Net8 Configuration Assistant窗口下选中 Perform typical configuration.最后创建数据库,
初始化数据库,最后,安装成功,并给出两个帐号的默认密码如下:
Database creation completed
Database information:
global database name: 你选择的名称
database system identifier(SID): ora
SYS account password: change_on_install
SYSTEM account password: manager
-----------------------------------------------
看看下面的Listener.ora和TNSNames.ora文件,如果没有,
可以考虑去别的oracle服务器下载一个过来修改一下 :-)
# cd $ORACLE_HOME/network/admin
# cd $ORACLE_HOME/bin/
# ./netasst
------------------------------------------------

6.安装后自动化工作
如何手动启动/关闭数据库?
svrmgrl
connect internal
startup (如果是关闭用 shutdown )
quit

如何在重启后自动启动oracle?
首先,你必须在/etc/oratab中加入下面的行
ora:/oracle/product/8.1.7:Y (也就是把原本的N改为Y)
然后放下面的行到/etc/rc.d/init.d/oracle8i
# !/bin/sh
# chkconfig: 345 51 49
# description: starts the oracle dabase deamons
#
ORA_HOME=/oracle/product/8.1.7
ORA_OWNER=oracle
case "$1" in
'start')
echo -n "Starting Oracle8i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle8i
echo
;;
'stop')
echo -n "Shutting down Oracle8i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle8i
echo
;;
'restart')
echo -n "Restarting Oracle8i: "
$0 stop
$0 start
echo
;;
*)
echo "Usage: oracle8i { start | stop | restart }"
exit 1
esac
exit 0

然后设定权限和启动级别
# chmod 700 /etc/rc.d/init.d/oracle8i
# whoami
root
# cd /etc/rc.d/init.d/
# chkconfig --add oracle8i
# chkconfig --list oracle8i
oracle8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off
现在测试命令/etc/rc.d/init.d/oracle8i stop/start看能否工作。

如果你想从另一台PC通过GUI存取Oracle服务器,你需要启动TNS listener.
#lsnrctl start

如何手动移走Oracle?
关闭Oracle server,做下面的
# cd /oracle
# rm -fr ./product
# rm -f /etc/oratab /etc/oraInst.loc
----------------------------------------------------------------------------------------------

三.安装Apache和PHP(最好以oracle用户安装)

完成了数据库服务器的安装,下一步进行web服务器的安装。
http://httpd.apache.org/dist/httpd/apache_1.3.20.tar.gz
http://www.php.net/do_download.php?download_file=php-4.0.6.tar.gz&source_site=www.php.net

安装之前先把oracle的环境变量.bash_profile以下几行注释掉
------------------------------------
# Set Linux kernel and GCC
export LD_ASSUME_KERNEL=2.2.5 #强制用低版本内核启动Java虚拟机
export LDEMULATION=elf_i386_glibc21 #强制使用glibc21
export GCC_EXEC_PREFIX=/usr/i386-glibc21-linux/lib/gcc-lib/
-----------------------------------
# source .bash_profile

1.配置Apache
# cd /oracle/www
# tar zxvf apache_1.3.20.tar.gz (解压apache)
# cd apache_1.3.20
# ./configure --prefix=/www/apache (安装到相应目录)

2.安装PHP4
# cd /oracle/www
# tar zxvf php-4.0.6.tar.gz (解压php)
# cd php-4.0.6
注意,最好把mysql的注释掉(/oracle/product/8.1.7就是$ORACLE_HOME,如果事先oracle成功安装,这个可以不写)
# ./configure --prefix=/oracle/www/apache/php --with-apache=../apache_1.3.20
--with-oracle=/oracle/product/8.1.7 --with-oci8=/oracle/product/8.1.7
--without-mysql --enable-track-vars
# make (编译)
# make install (安装)

3.安装Apache
# cd /oracle/www/apache_1.3.20
# ./configure --prefix=/oracle/www/apache --activate-module=src/modules/php4/libphp4.a
(# make clean)
# make
# make install

4.配置Apache
# cd /oracle/www/php-4.0.6/
# cp php.ini-dist /oracle/www/apache/php/lib/php.ini (拷贝php.ini文件到lib目录)
# cd /oracle/www/apache/conf
# vi httpd.conf
修改httpd.conf文件,以下几行去掉注释:
ServerName http://。。。。。。。 (这个一定要去掉注释)
Listen XXX.XXX.XXX:8888 (其中xxx.xxx.xxx为域名,或者IP地址)
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
或者
增加:AddType application/x-httpd-php .php
增加:AddType application/x-httpd-php-source .phps
修改:Port 80 合适的端口号
修改:ServerName 本机的名字

5.启动Apache了
# cd /oracle/www/apache/bin
# sh /oracle/.bash_profile (带入oracle环境变量)
# ./apachectl start

6.测试PHP
htdocs目录下编辑一个test.php

phpinfo();
?>
通过浏览器浏览该网页,可以看到PHP的环境参数,如果找到有oricle和orci8的支持,说
明PHP已经支持ORACLE和OCI8。

7.测试PHP与ORACLE的连接

//文件名为test.php.
$conn=ocilogon("system","manager","test");
if($conn)
echo success;
else
echo fail;
?>
如果该程序返回成功标志,则表明连接成功。

Apache的关闭和启动:
# /oracle/www/apache/bin/apachectl stop
# /oracle/www/apache/bin/apachectl start
----------------------------------------------------------------------------------------------

四.综合营帐系统安装与启动

上传中国联通综合营业帐务前台系统文件neubusiness.*.tar.gz至安装好的服务器的WWW的根目录;
去192.168.216.231(oracle/******)上/export/home/oracle/www/目录下把neubusiness这个目录tar成一个文件:
# cd /export/home/oracle/www
# tar cvf neubusiness.tar neubusiness.20020627.tar
# gzip neubusiness.20020627.tar (把该文件bin方式ftp到要安装营帐系统的服务器上,如/oracle/www)

-----------------------------
# ftp 192.168.216.231
# bin
# hash
# get neubusiness.20020627.ta
# !
-----------------------------

进入要安装综合营帐根目录:
# cd /oracle/www

将中国联通综合营业帐务前台系统文件解压:
# gzip -dc neubusiness.*.tar.gz | tar xvf -

编译密码加密/解密程序:
# cd /oracle/www/neubusiness/function
# gcc -o trans_password trans_password.c -lm
# gcc -o encrypt_password encrypt_password.c -lm

将密码加密/解密程序的属主改为超级用户:
# su
# chown root trans_password

配置参数文件,指定系统运行所需的参数:
# vi /oracle/www/neubusiness/business/.inifile
oracle_sid:ora (ORACLE实例名)
php_include_path:/oracle/www/neubusiness/function (解压后生成的neubusiness/function目录的路径)
document_root:/oracle/www/neubusiness/business (解压后生成的neubusiness/business目录的路径)
oracle_user:unitele (用于连接数据库的用户名)
oracle_pass:L3?(Qd.H6[#[#[# (加密口令,用/oracle/www/neubusiness/function/trans_password加密)
system_name:营业受理|客户管理|帐户管理|受理缴费|异常处理|统计查询|话费管理|权限管理系统|功能

将参数文件的属主改成超级用户:
# chown root .inifile

修改PHP配置文件:
# vi /oracle/www/apache/php/lib/php.ini
include_path = ".:/oracle/www/neubusiness/function" (这个一定要改)
max_execution_time = 10800
display_errors = On (测试为On,若正式运行可以置为Off)
upload_tmp_dir = /oracle/www/somewhere (若有上传文件)
upload_max_filesize = 16M (若有上传文件)

修改Apache配置文件:
# vi /oracle/www/apache/conf/httpd.conf
DocumentRoot "/oracle/www/neubusiness/business"

DirectoryIndex default.php index.html help_index.htm

重启Apache:
# cd /oracle/www/apache/bin
# apachectl configtest
# apachectl stop
# apachectl start

打开客户端浏览器输入地址:
http://ServerName:port/ (如:http://192.168.216.154:8080/)
这时可以看到弹出的输入用户名密码的窗口,以center/center2000进入权限管理系统

注意:
1.如果进入页面后提示"使用.inifile配置连接数据库失败"(见./function/authenticate.php),则检查
./business/.inifile 文件里面的配置是否正确,如果有误就先备份再进行修改.

2.如果进入页面出现"系统名称没有注册"提示(见./business/top.php),它是执行下面这条语句没有结果造成的,
放入toad执行一下看是否有结果:
($system_name是./business/.inifile文件中system_name串,$login_name就是登陆页面的用户名)

select System_id,System_name,Remark from bm_mainmenu_t
where System_id >= 20 and System_name in ($system_name)
and System_id in
(select distinct System_id from bm_function_t
where Function_id in
(select b.Function_id from bm_person_name_t a,bm_rolepower_t b
where a.City_code = b.City_code
and a.Role_id = b.Role_id and a.Account = '$login_name'
union
select Function_id from bm_userpower_t
where Account = '$login_name' and Function_sign = 1
minus
select Function_id from bm_userpower_t
where Account = '$login_name' and Function_sign = 0
)
)
根据这条语句对bm_mainmenu_t,bm_function_t等几个表里的数据进行正确配置即可.

3.如果点击左边页面链接后,右边框架里出现的仍是主页面,则查询一下bm_function_t.page_link字段是否有值,
没有的话在这里配置页面链接地址(./business/下的相对路径).
select * from bm_function_t where page_link is not null ;

4.其它,呵呵..很多..

--------------------------------------------------------------------------------------------------


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10881/viewspace-178031/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10881/viewspace-178031/

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2022 CSDN 皮肤主题:编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值