一:安装前必备
1.首先要下载Jdk,Tomcat,Oracle这三个文件。
2.为了方便别他人查看,与个人习惯,把这三个文件最好放在
1)Jdk放在/home下
---如:/home/jdk-1_5_0_09-linux-i586-rpm.bin (文件.bin:是执行文件)
2)Tomcat放在/usr/local下
---如:/usr/local/apache-tomcat-5.5.20.zip (文件.zip:是解压文件)
3)Oracle放在/home下
---如:/home/oracle-xe-univ-10.2.0.1-1.0.i386.rpm夹 (文件.rpm:是安装文件)
二: 开始安装
1. 安装Jdk
[root@bjaddev ~]# cd /home
[root@bjaddev home]# ./jdk-1_5_0_09-linux-i586-rpm.bin
[root@bjaddev local]# cd ~ //返回到根目录
[root@bjaddev ~]# vi .bash_profile //编辑.bash_profile文件,配置JAVA_HOME
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/usr/java/jdk1.5.0_09
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export PATH JAVA_HOME
unset USERNAME
[root@bjaddev ~]#source .bash_profile //重新编译.bash_profile文件以让修改生效
[root@bjaddev ~]# java –version //查看Jdk的版本号,如显示java version "1.5.0_09"则证明jdk安装成功
注:如果jdk-1_5_0_09-linux-i586-rpm.bin文件不能执行,则修改文件的执行权限
chmod 744 jdk-1_5_0_09-linux-i586-rpm.bin
2. 安装Tomcat
[root@bjaddev home]# cd /usr/local
[root@bjaddev local]# unzip apache-tomcat-5.5.20.zip
[root@bjaddev local]# cd ~ //返回到根目录
[root@bjaddev ~]# vi .bash_profile //编辑.bash_profile文件,配置CATALINA_HOME
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/usr/java/jdk1.5.0_09
CATALINA_HOME=/usr/local/apache-tomcat-5.5.20
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$CATALINA_HOME/bin
export PATH JAVA_HOME CATALINA_HOME
unset USERNAME
[root@bjaddev ~]#source .bash_profile //重新编译.bash_profile文件以让修改生效
[root@bjaddev ~]# startup.sh //启动Tomcat. shutdown.sh,关闭Tomcat
[root@bjaddev ~]# cd /usr/local/apache-tomcat-5.5.20/conf
[root@bjaddev conf]# vi server.xml //配置项目所在路径,以Tomcat能够找到项目并运行
在server.xml文件加入:
<Context path="/bjad" docBase="/home/bjad/DevRoot/wwwroot" debug="0" reloadable="true" crossContext="true"/>
[root@bjaddev ~]#shutdown.sh //重新启动Tomcat..以让修改server.xml文件生效
注:如果启动不了的话, 进到/usr/local/apache-tomcat-5.5.20目录下,修改bin文件夹的权限,即可. [root@bjaddev apache-tomcat-5.5.20]# chmod -R 744 bin
3. 安装Oracle
[root@bjaddev home]# cd /home
[root@bjaddev home]# rpm –ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm //安装oracle数据库
[root@bjaddev ~]# /etc/init.d/oracle-xe configure //配置oracle的端口号,与登陆oracle的用户与密码
[root@bjaddev ~]# cd /etc/init.d
[root@bjaddev init.d]# oracle-xe start //启动oracle数据库
[root@bjaddev ~]# ps –ef //查看oracle进程是否启动
[root@bjaddev ~]# vi .bash_profile //编辑.bash_profile文件,配置oracle数据库
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/usr/java/jdk1.5.0_09
CATALINA_HOME=/usr/local/apache-tomcat-5.5.20
ORACLE_SID=XE
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:$CATALINA_HOME/bin:$ORACLE_HOME/bin
export PATH JAVA_HOME CATALINA_HOME ORACLE_HOME
unset USERNAME
[root@bjaddev ~]# source .bash_profile //重新编译.bash_profile文件以让修改生效
[root@bjaddev ~]# cd /etc/skel
[root@bjaddev skel]# ll –al //因为skel下的文件是隐藏文件,所以要用到 –a
把这三个文件copy到/usr/lib/oracle/xe下,即配置oracle用户
[root@bjaddev skel]# cp -rf /etc/skel/.bash_logout /usr/lib/oracle/xe //把隐藏文件copy到/usr/lib/oracle/xe下
[root@bjaddev skel]# cp -rf /etc/skel/.bash_profile /usr/lib/oracle/xe
[root@bjaddev skel]# cp -rf /etc/skel/.bashrc /usr/lib/oracle/xe
[root@bjaddev ~]# cd /usr/lib/oracle/xe
[root@bjaddev xe]# vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_SID=XE
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH ORACLE_SID ORACLE_HOME
[root@bjaddev xe]#source .bash_profile //编译.bash_profile文件.以让修改生效
[root@bjaddev ~]# su – oracle //切换到oracle用户
[oracle@bjaddev ~]$ sqlplus //启动sqlplus
Enter user-name: system
Enter password: timeless
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production
SQL> select * from tab; //查看数据库中的表
SQL> create user bjad identified by bjad; //创建oracle登陆用户与密码
SQL> grant create session to bjad; //创建oracle用户的权限
SQL> grant resource to bjad; //创建oracle用户的权限
SQL> exit
[oracle@bjaddev ~]$ imp bjad/bjad file=bjad_dev_20070525.dmp full=y //导入已存在的oracle数据库
[oracle@bjaddev ~]$ sqlplus
Enter user-name: bjad
Enter password: bjad
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 – Production
SQL> select * from tab; //查看数据库中的表
Oracle安装与配置结束.