1. purpose of this article ● Install ORACLE8 Database server in redhat ● install apache and support wml ● Install PHP2. preparations before installation: redhat6.2install optical disk oracle8.161.tar.gz: run ApacheORACLE8 in Java
1. purpose of this article
● Install ORACLE8 Database server under redhat
● Install apache and support wml
● Install PHP
2. preparations before installation:
Redhat 6.2 Installation CD
Oracle8.161.tar.gz:
Http://freeware.online.sh.cn/mirrors/linux#/database/oracle's oracle8.161.tar.gz
Java Runtime Environment (JRE ):
Ftp: // 165.21.84.42/pub/j2sdk/1.3.0/xzc233fcslnx/j2sdk-1_3_0-linux-rpm.sh under
Apache 1.3.14:
Http://www.apache.org/dist/apache1.3.14.tar.gz
Php4.0.3 pl1:
Http://www.php.net/do_download.php? Download_file = php-4.0.3pl1.tar.gz & source_site = www.php.net
3. preparations before oracle installation
● Install JRE1.3.0
[Root @ wapdb/root] # log on as root
[Root @ wapdb/root] # chmod 755 j2re-1_3_0-linux-rpm.sh # change j2re-1_3_0-linux-rpm.sh
Permissions
[Root @ wapdb/root] #./j2re-1_3_0-linux-rpm.sh # run the j2re-1_3_0-linux-rpm.sh in the same level Directory
To obtain the RPM Package of JRE.
[Root @ wapdb/root] # rpm-I j2re-1_3_0-linux-rpm # install JRE1.3.0:
● Create an oracle database. Apache User group:
Run the following command:
[Root @ wapdb/root] # log on as root
[Root @ wapdb/root] # groupadd oracle # create an oracle Group
[Root @ wapdb/root] # useradd oracle-g oralce # Create a user oracle in the oracle Group
[Root @ wapdb/root] # useradd apache-g oralce # Create a user apache in the oracle Group
[Root @ wapdb/root] # passwd oracle # modify the oracle user password
Note: oracle Group and oracle users are required for oracle installation.
Note: After an oracle User is created, the linux system automatically creates the/home/oracle directory under the/home directory for oracle users to use. oracle users have all permissions for this directory.
[Root @ wapdb/root] # cd/home/oracle
[Root @ wapdb/root] # vi. bash_profile # Edit the. bash_profile file and enter the following content
# Setup ORACLE environment
NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16CGB231280"; export NLS_LANG
JAVA_HOME =/usr/java/jre1.3
BASH_ENV = $ HOME/. bashrc
ORACLE_HOME =/data/oracle/app/oracle/product/8.1.6
Export ORACLE_HOME
ORACLE_SID = wap
Export ORACLE_SID
# Set up the search paths:
PATH = $ PATH: $ HOME/bin: $ JAVA_HOME/bin: $ ORACLE_HOME/d
Bs
Export USERNAME BASH_ENV PATH ORACLE_HOME JAVA_HOME
4. install oracle8I
[Root @ wapdb/oracle] # exit # log out and log on again as an oracle user to make the set environment take effect
[Oracle @ wapdb/oracle] $
[Oracle @ wapdb/oracle] $ tar zxvf oracle81620.tar.gz # decompress the oracle compressed package to the current directory
[Oracle @ wapdb/oracle] $ startx # enable a terminal (xterm) after X-windows is started ),
(Graphic window) run runInstaller on the terminal
[Oracle @ wapdb/oracle] $ cd Oracle8iR2 # enter the decompressed Directory
[Oracle @ wapdb/Oracle8iR2] $./runInstaller # run the oracle installation program.
In this case, you can see the graphic OUI welcome screen running with jre. follow the prompts to continue the installation process (here we can choose a typical installation ):
Welcome:
Press next
File Locations:
Press next
UNIX Group Name:
Oracle, press next
Error: The system prompts you to run "/data/oracle/app/oracle/product/8.1.6/orainstRoot. sh" with the root permission.
CTRL + ALT + F2 to open a new console (Character window)
Log on as root
[Root @ wapdb/root] # cd/data/oracle/app/oracle/product/8.1.6
At this time, there is a file orainstRoot. sh in the/data/oracle/app/oracle/product/8.1.6 Directory, run it
[Root @ wapdb/8.1.6] # sh orainstRoot. sh
CTRL + ALT + F7, return to the installation page (graphic window)
Click Retry to continue the installation,
Available Products:
Select Oracle8i Enterprise Edition 8.1.6.1.0 and press next
Installation Types:
Select Typical (540 MB) and press next. a progress ruler is displayed in the upper-right corner of the screen.
Database Identification:
Global Database Name: enter wap (optional)
SID: keep wap
Press next
Database File Location:
In any Directory, this example is set to "/data/oracle/app/oracle/product/8.1.6/data", and press Next. then, the progress ruler in the upper-right corner of the screen continues to move forward.
The following is a Summary of the products you want to install.
Press Install to display the Install screen. wait... you can see the installation and other log file directories prompted at the bottom of the window for future query.
The Setup Privileges window is displayed.
Tip: run a script as root before the installation continues.
"/Data/oracle/app/oracle/product/8.1.6/root. sh ",
CTRL + ALT + F2, return to the first terminal window just running
Run the file as root,
[Root @ wapdb/8.1.6] # sh root. sh
Screen Display:
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Enter
The system starts to execute some actions. after the execution is completed, press CTRL + ALT + F7 to return to OUI and press OK.
Starting from Database Creation Progress, perform the following four steps
Creating and starting Oracle instance
Copying database files
Initializing database
Database creation completed
The preceding four processes are completed. the Oracle Database Configuration Assistant Alert window is displayed,
Tip: after the database is created, it will show you some basic information about the database.
Global databse name: wap
Database system identifier (SID): wap
SYS account password: change_on_install
SYSTEM account password: manager
Press OK
End of Installation: press Exit to Exit OUI and complete the Installation.
At this point, the database server has been installed, and the next step is to install the web/wap server.
5. install the ORACLE client
(This step is suitable for installing the database server and WEB server on different machines. if the same machine is used, directly execute step 2)
Repeat step 1
The steps for selecting "client installation" in step 1 installation are roughly the same.
Configure the tnsnames. ora File (you can run the netasst command on/$ ORACLE_HOME/bin/to start OUI to configure it ). The fastest way is to COPY tnsnames. ora on the database server to $ ORACLE_HOME/network/admin.
Log on as an ORACLE User
[Oracle @ wapserver/] $ cd $ ORACLE_HOME/network/admin
[Oracle @ wapserver admin] $ ftp xxx. xxx # use FTP to log on to the oracle Server and use ORACLE
And use oracle users.
Ftp> cd/data/oracle/app/oracle/product/8.1.6/network/admin
Ftp> get tnsnames. ora
Ftp> bye
6. configure apache_1.3.14
[Root @ wapdb/local] # tar zxvf apache1.3.14.tar.gz # decompress apache
[Root @ wapdb/local] # cd/usr/local/apache_1.3.14 # enter the apache decompression directory.
[Root @ wapdb/local] #./configure -- prefix =/usr/local/apache
5. install PHP4
[Root @ wapdb/local] # tar zxvf php-4.0.3pl1.tar.gz # decompress php
[Root @ wapdb/local] # cd php-4.0.3
[Root @ wapdb/php-4.0.3] #./configure -- with-apache = ../apache_1.3.14 \
-- With-oracle =/data/oracle/app/oracle/product/8.1.6 \
-- With-oci8 =/data/oracle/app/oracle/product/8.1.6 \
-- Enable-track-vars
[Root @ wapdb/php-4.0.3] # make # compile
[Root @ wapdb/php-4.0.3] # make install # installation
[Root @ wapdb/php-4.0.3] # cp php. ini-dist/usr/local/lib/php. ini # Copy the ini file to the lib Directory
6. install apache
[Root @ wapdb/php-4.0.3] # cd/usr/local/apache_1.3.14
[Root @ wapdb/apache_1.3.14] #./configure -- prefix =/usr/local/apache \
-- Activate-module = src/modules/php4/libphp4.a
[Root @ wapdb/apache_1.3.14] # make
[Root @ wapdb/apache_1.3.14] # make install
7. configure apache
[Root @ wapdb/apache_1.3.14] # cd/usr/local/apache/conf
[Root @ wapdb/conf] # vi httpd. conf
Modify the httpd. conf file
Remove comments from the following lines:
ServerName http ://....... The comment must be removed.
Listen XXX. XXX. XXX: 8888 (where xxx. xxx. xxx is the domain name or IP address)
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
Modify the following two rows:
User apache
Group oracle
[Root @ wapdb/conf] # vi mime. types
Modify the mime. types file and add WAP support. add the following lines:
Text/vnd. WAP. WML
Text/vnd. WAP. WMLscript WMLC
Image/vnd. WAP. WBMP WMLP
Application/vnd. WAP. WMLC
Application/vnd. WAP. WMLCSRIPTC WMLSC
After the system has been installed, test the environment:
8. start the database:
Run the following command on the database server:
[Oracle @ wap/bin] $ svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> startup
ORACLE instance started
9. start the listener
[Oracle @ wapdb/bin] $ lsnrctl
LSNRCTL> start
LSNRCTL> exit
At this time, the oracle database has been installed successfully and the database has been started and run. you can try it.
[Oracle @ wapdb/bin] $ sqlplus system/manager @ wap
The following information is displayed:
SQL * Plus: Release 8.1.6.0.0-Production on Fri Oct 26 20:20:56 2000
(C) Copyright 1999 Oracle Corporation. ALL rights reserved.
Connected:
Oracle8i Enterprise Edition Release 8.1.6.1.0-Production
With the Partitioning option
JServer Release 8.1.6.0.0-Production
SQL> show user
USER is "SYSTEM"
SQL>
SQL> exit
10. started Apache.
[Oracle @ wapdb/root] # cd/usr/local/apache/bin
[Oracle @ wapdb/root] # apachectl start
11. test PHP
Edit a test. php file in the htdocs directory.
Phpinfo ();
?>
You can view the PHP environment parameters through a browser. if oricle and orci8 support is found, PHP supports ORACLE and oci8.
12. test the connection between PHP and ORACLE.
// The file name is test. php.
$ Conn = ocilogon ("system", "manager", "test ");
If ($ conn)
Echo success;
Else
Echo fail;
?>
If the program returns a success sign, the connection is successful.
13. WML is supported during testing.
Edit test. wml in the htdocs Directory
Http://www.wapforum.org/DTD/wml_1.1.xml>
Hello word!
Use the WAP simulator on any other win9x host to browse this webpage. "hello word" should appear ".
Now the entire environment has been debugged. you can use PHP + ORACLE8i for dynamic html or wml development!