- 论坛徽章:
- 0
|
0、系统准备
打开音量
启动telnet
vi /etc/xinetd.d/telnet --- no
修改启动顺序
vi /etc/grub.conf
修改语言
vi /etc/sysconfig/i18n --- zh_CN
修改运行级
vi /etc/inittab #3
修改sudoers
chmod 777 /etc/sudoers
vi /etc/sudoers
去掉 %wheel ALL=(ALL) NOPASSWD: ALL前#
chmod 440 /etc/sudoers
vi /etc/group
在wheel后加入,oracle,apache,config
1、安装jdk
a.rpm -i jdk-6u1-linux-i586.rpm
b.设置环境变量 vi /etc/profile 增加
JAVA_HOME=/usr/java/jdk1.6.0_01
JRE_HOME=$JAVA_HOME/jre
export JAVA_HOME
export JRE_HOME
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
CLASSPATCH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar #:/usr/java/jdbc
export CLASSPATCH
TOMCAT_HOME=/usr/local/tomcat
TOMCAT_BASE=/usr/local/tomcat
TOMCAT_TMPDIR=/usr/local/tomcat/temp
export TOMCAT_HOME
export TOMCAT_BASE
export TOMCAT_TMPDIR
alias tomstart='/usr/local/tomcat/bin/startup.sh'
alias tomstop='/usr/local/tomcat/bin/shutdown.sh'
alias apastart='service httpd start'
alias apastop='service httpd stop'
alias aparestart='service httpd restart'
alias oratest='echo "select * from test;" | sudo -u oracle /oracle/product/10.2.0/db_1/bin/sqlplus
[email=galilei/111111@galilei']galilei/111111@galilei'[/email]
alias orastop='echo "shutdown immediate" | sudo -u oracle /oracle/product/10.2.0/db_1/bin/sqlplus
[email=sys/111111@galilei]sys/111111@galilei[/email]
as sysdba'
alias orastart='echo "startup" | sudo -u oracle /oracle/product/10.2.0/db_1/bin/sqlplus sys/111111 as sysdba'
alias or='echo "INSERT INTO \"GALILEI\".\"TEST\" (\"A\" ,\"B\" ) VALUES ('外文' ,'for' );" | /oracle/product/10.2.0/db_1/bin/sqlplus
[email=galilei/111111@galilei']galilei/111111@galilei'[/email]
c.改变原文件
mv /usr/bin/java /usr/bin/java1
mv /usr/bin/javac /usr/bin/javac2
d.检测jdk环境
java -version
javvac
3、tomcat
a.拷贝tomcat目录
cp -R apache-tomcat-6.0.13/ /usr/local/tomcat
b.检测tomcat
/usr/local/tomcat/bin/startup.sh
http://191.1.45.8:8080/
/usr/local/tomcat/bin/shutdown.sh
c.编译mod_jk.so
cd tomcat-connectors-1.2.23-src/
cd native
./configure --with-apxs=/usr/sbin/apxs
make
make install
d.设置apache与tomcat联系
vi /usr/local/tomcat/conf/workers.properties 添加
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/java/jdk1.6.0_01
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
vi /etc/httpd/conf/httpd.conf +/DirectoryIndex 添加
index.jsp
vi /etc/httpd/conf/httpd.conf +/AddDefaultCharset 修改
AddDefaultCharset GB2312
vi /etc/httpd/conf/httpd.conf +/LanguagePriority 修改
LanguagePriority zh-CN
vi /etc/httpd/conf/httpd.conf +/LimitExcept
去掉该去的注释
最后位置添加
LoadModule jk_module modules/mod_jk.so
JkWorkersFile "/usr/local/tomcat/conf/workers.properties"
JkMount /servlet/* ajp13
JkMount /*.jsp ajp13
cd /home/config/
ln -s /home/config/ public_html
chmod 777 public_html/
chown config:config public_html/
chmod 777 /usr/local/tomcat/conf/workers.properties
chmod 777 /usr/lib/httpd/modules/mod_jk.so
e.完成
此时网页发布在tomcat下,图片发布在apache下,修改:
mkdir /var/www/html/galilei
cd /usr/local/tomcat/webapps
mv ROOT ROOT2
ln -s /var/www/html ROOT
cp -R /usr/local/tomcat/webapps/ROOT2/WEB-INF /usr/local/tomcat/webapps/ROOT/WEB-INF
chmod -R 777 /var/www/html/galilei
chmod -R 777 //usr/local/tomcat/webapps/ROOT
chown -R apache:apache /var/www/html/galilei
chown -R apache:apache /usr/local/tomcat/webapps/ROOT
f.测试
4、oracle
a.启动vncserver
b.安装前准备:
unzip -r database.zip database/
chmod -R 777 database/
chmod -R 777 client/
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /oracle
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle
chmod a+wr /tmp
xhost +
vi /etc/profile 加入
TEMP=/tmp
TMPDIR=/tmp
export TEMP TMPDIR
ORACLE_BASE=/oracle
ORACLE_SID=galilei
ORACLE_HOME=/oracle/product/10.2.0/db_1
export ORACLE_BASE ORACLE_SID ORACLE_HOME
NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
export NLS_LANG
修改PATH=.....:/oracle/product/10.2.0/db_1/bin
vi /etc/sysctl.conf
# For Oracle10g
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
c.安装
cd /database
./runInstaller
oracle目录 /oracle
d.使用脚本创建数据库
e.创建表空间
CREATE TABLESPACE "GALILEI" LOGGING DATAFILE '/oracle/oradata/GALILEI/GALILEI.dbf' SIZE 5000M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
f.创建用户
CREATE USER "GALILEI" PROFILE "DEFAULT" IDENTIFIED BY "111111" DEFAULT TABLESPACE "GALILEI" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
GRANT CREATE SEQUENCE TO "GALILEI";
GRANT "CONNECT" TO "GALILEI";
GRANT "DBA" TO "GALILEI";
GRANT "RESOURCE" TO "GALILEI";
g.创建测试数据表
CREATE TABLE "GALILEI"."TEST" ("A" VARCHAR2(10) NOT NULL, "B" VARCHAR2(10) NOT NULL) TABLESPACE "GALILEI";
INSERT INTO "GALILEI"."TEST" ("A" ,"B" ) VALUES ('外文' ,'for' );
commit;
5、jsp连接oracle
a.
mkdir /var/www/html/WEB-INF
mkdir /var/www/html/WEB-INF/lib
chown -R 777 /var/www/html/WEB-INF
cp classes12.jar /usr/java/jdk1.6.0_01/lib/.
cp classes12.jar /var/www/html/WEB-INF/lib/.
b.测试jsp&oracle连接
conn.close();
stmt.close();
rs.close();
%>
PS1:安装oracle的步骤可再参考相关文档
PS2:
![]()
文件:
tomcat-connectors-1.2.23-src.tar.gz
大小:
1335KB
下载:
下载
环境变量的设置是最简单办法。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/42996/showart_337749.html |
|