在MandrakeLinux 10, 10.1 上安裝Apache,PHP,Oracle 9,MySQL

在MandrakeLinux 10, 10.1 上安裝Apache,PHP,Oracle 9,MySQL

1. One step procedure (uses less disk space and is faster):

zcat ship_9204_linux_disk1.cpio.gz | cpio -idmv

zcat ship_9204_linux_disk2.cpio.gz | cpio -idmv

zcat ship_9204_linux_disk3.cpio.gz | cpio -idmv

2. Create Oracle account

groupadd dba # group of users to be granted with SYSDBA system privilege

groupadd oinstall # group owner of Oracle files

useradd -c “Oracle software owner” -g oinstall -G dba oracle

passwd oracle

3. Create Oracle directories

mkdir /opt/oracle

mkdir /opt/oracle/product

mkdir /opt/oracle/product/9.2.0

chown -R oracle.oinstall /opt/oracle

mkdir /var/opt/oracle

chown oracle.dba /var/opt/oracle

chmod 755 /var/opt/oracle

4. Modify /home/oracle/.bash_profile

# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9 and

# for Red Hat Enterprise Linux Advanced Server 3 (RHEL AS 3) !!

# Use the “Linuxthreads with floating stacks” implementation instead of NPTL:

export LD_ASSUME_KERNEL=2.4.1

# Oracle Environment

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=/opt/oracle/product/9.2.0

export ORACLE_SID=test

export ORACLE_TERM=xterm

# export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $ORACLE_HOME/network/admin

export NLS_LANG=AMERICAN;

export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

export LD_LIBRARY_PATH

# Set shell search paths

export PATH=$PATH:$ORACLE_HOME/bin

I successfully installed Oracle9iR2 without setting the following CLASSPATH environment variable:

# CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

# CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib

# export CLASSPATH

5. Install Apache

tar -zxf httpd-2.0.52.tar.gz

cd httpd-2.0.52

./confgiure –prefix=/home/apache –enable-module=so –enable-moduel=most –enable-shared=max

make

make install

ln -s /home/apache/bin/apachectl /etc/rc.d/init.d/apache

6. Install MySQL

useradd mysql

passwd mysql

tar -zxf mysql-4.1.7.tar.gz

cd mysql-4.1.7

./configure –prefix=/home/mysql –enable-local-infile –with-charset=big5 –with-extra-charsets=gb2312,utf8 –with-collation=big5_chinese_ci

make

make install

chown -R mysql:mysql /home/mysql

cp /home/mysql/share/mysql/my-huge.cnf /etc/my.cnf

ln -s /home/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysql

su mysql

/home/mysql/bin/mysql_install_db

/home/mysql/share/mysql/mysql.server start

7. Install ICONV

tar -zxf libiconv-1.9.1.tar.gz

cd libiconv-1.9.1

./configure –prefix=/usr/local/lib/iconv

make

make install

8. Install CURL

tar -zxf curl-7.12.2.tar.gz

cd curl-7.12.2

./configure –prefix=/usr/local/lib/curl

make

make install

9. Install PHP

9-1 Adjust oracle variable

cp ociheaders.tar $ORACLE_HOME/rdbms/demo/

cd $ORACLE_HOME/rdbms/demo

tar -xf ociheaders.tar

nm $ORACLE_HOME/lib/libclntsh.so | grep OCINlsCharSetNameToId

>001d915e T OCINlsCharSetNameToId

vi /opt/oracle/product/9.2.0.1/rdbms/demo/oci.h

#define define OCI_NLS_CHARSET_ID 19

9-2 Configure PHP

tar -zxf php-4.3.9.tar.gz

cd php-4.3.9

./configure –prefix=/home/php –with-apxs2=/home/apache/bin/apxs –with-oracle=$ORACLE_HOME –with-oci8=$ORACLE_HOME –with-mysql=/home/mysql –with-xml –with-iconv=/usr/local/lib/iconv –with-curl=/usr/local/lib/curl –with-ftp –enable-ftp –enable-sigchild

make

make install

cp php.ini-dist /home/php/lib/php.ini

Post Tags :

阿維

阿維雜記本的偷懶維護者