準(zhǔn)備工作
1萍嬉、確認(rèn)oracle已經(jīng)安裝完畢,并可以使用sqlplus工具連接數(shù)據(jù)庫
2位他、更換yum源
卸載系統(tǒng)原來的yum
rpm -qa|grep yum
rpm -e --nodeps yum-*
切換到系統(tǒng)根目錄
mkdir -p /home/app
cd /home/app
wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget http://mirrors.163.com/centos/6.8/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm yum-3.2.29-73.el6.centos.noarch.rpm
cd /etc/pki/rpm-gpg/
wget http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
配置yum源
vim /etc/yum.repos.d/rhel-debuginfo.repo
輸入如下信息
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://tel.mirrors.163.com/centos/6/os/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://tel.mirrors.163.com/centos/6/os/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://tel.mirrors.163.com/centos/6/os/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://tel.mirrors.163.com/centos/6/os/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://tel.mirrors.163.com/centos/6/os/x86_64/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
保存之后執(zhí)行
yum clean all
yum makecache
配置防火墻
vim /etc/sysconfig/iptables
增加配置
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
重啟服務(wù)
service iptables restart
一 恃慧、安裝java環(huán)境
1、移除原來的open jdk
[root@localhost database]# rpm -qa|grep -i jdk
java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64
java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64
[root@localhost database]# rpm -e java-1.6.0-openjdk-1.6.0.38-1.13.10.4.el6.x86_64
[root@localhost database]# rpm -e java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64
2电湘、上傳jdk-6u45-linux-x64-rpm.bin到/home/app
查看一下
[root@localhost database]# cd /home/app
[root@localhost app]# ls
10201_database_linux_x86_64.cpio database jdk-6u45-linux-x64-rpm.bin
[root@localhost app]# chmod +x jdk-6u45-linux-x64-rpm.bin
[root@localhost app]# ./jdk-6u45-linux-x64-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: jdk-6u45-linux-amd64.rpm
inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm
inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Installing JavaDB
Preparing... ########################################### [100%]
1:sun-javadb-common ########################################### [ 17%]
2:sun-javadb-core ########################################### [ 33%]
3:sun-javadb-client ########################################### [ 50%]
4:sun-javadb-demo ########################################### [ 67%]
5:sun-javadb-docs ########################################### [ 83%]
6:sun-javadb-javadoc ########################################### [100%]
Done.
[root@localhost app]# rpm -ivh jdk-6u45-linux-amd64.rpm
Preparing... ########################################### [100%]
package jdk-2000:1.6.0_45-fcs.x86_64 is already installed
[root@localhost app]# cd /usr/java
[root@localhost java]# ls
default jdk1.6.0_45 latest
[root@localhost java]#
看下jdk路徑
[root@localhost java]# cd jdk1.6.0_45/
[root@localhost jdk1.6.0_45]# pwd
/usr/java/jdk1.6.0_45
設(shè)置環(huán)境變量
vim /etc/profile
查找export /export,并增加
export JAVA_HOME="/usr/java/jdk1.6.0_45"
export CLASSPATH="/usr/java/jdk1.6.0_45/lib:/usr/java/jdk1.6.0_45/jre/lib"
pathmunge /usr/java/jdk1.6.0_45/bin:/usr/java/jdk1.6.0_45/jre/bin
二、安裝php環(huán)境
1鹅经、安裝httpd以及相關(guān)組件
yum -y install httpd*
chkconfig httpd on
service httpd start
yum install php php-gd mod_ssl mod_perl php-mcrypt php-xml php-mbstring php-pear php-xmlrpc mem* php-pecl-memcache php-devel
chkconfig --add memcached
chkconfig memcached on
chmod 755 /etc/init.d/memcached
service memcached start
2寂呛、配置httpd
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.back
mkdir /home/www
vim /etc/httpd/conf/httpd.conf
修改配置:
DocumentRoot "/home/www"
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "/home/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Files ~ "^\.htaccess">
Order allow,deny
Deny from all
Satisfy All
</Files>
重啟一下
service httpd restart
cd /home/www
vim info.php
<?php phpinfo(); ?>
瀏覽器輸入http://192.168.1.232/info.php查看
3、配置oracle擴(kuò)展
上傳
oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm
到/home/app
下載地址
http://www.oracle.com/technetwork/cn/database/features/instant-client/index-097480.html
rpm -ivh oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm
cd /home/app
wget http://pecl.php.net/get/oci8-2.0.10.tgz
tar -xf oci8-2.0.10.tgz
cd oci8-2.0.10
phpize
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.4/client64/lib/
make
make install
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
[root@localhost oci8-2.0.10]# make install
Installing shared extensions: /usr/lib64/php/modules/
修改php配置文件
cp /etc/php.ini /etc/php.ini.back vim /etc/php.ini
編輯:
[OCI8]
extension=oci8.so
---/usr/lib64/php/modules/
修改選項
short_open_tag=On
error_reporting = E_ALL
upload_max_filesize = 30M
重啟
service httpd restart
查看下phpinfo
成功
三瘾晃、安裝tomcat環(huán)境
1贷痪、上傳文件apache-tomcat-7.0.70.tar.gz至/home/tomcat
解壓縮
tar -xzvf apache-tomcat-7.0.70.tar.gz
修改TOMCAT_HOME/bin/catalina.sh
位置cygwin=false前。
JAVA_OPTS="-server -Xms4g -Xmx4g -XX:PermSize=256M -XX:MaxPermSize=512m"
刪除webapps下的所有文件
cd webapps
rm -rf *
四蹦误、部署數(shù)據(jù)庫
1劫拢、創(chuàng)建數(shù)據(jù)庫
su oracle
sqlplus "/as sysdba"
startup
create tablespace ebusiness datafile '/home/oracle/ebusiness.dbf' size 1000m autoextend on next 100m;
create user ebusiness2016 identified by ebusiness2016 default tablespace ebusiness;
grant connect,resource,select any dictionary,unlimited tablespace,create any view,create materialized view,create public database link to ebusiness2016;
[root@localhost modules]# su oracle
[oracle@localhost modules]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 3月 2 20:54:01 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create tablespace ebusiness datafile '/home/oracle/ebusiness.dbf' size 1000m autoextend on next 100m;
Tablespace created.
SQL> create user ebusiness2016 identified by ebusiness2016 default tablespace ebusiness;
User created.
SQL> grant connect,resource,select any dictionary,unlimited tablespace,create any view,create materialized view to ebusiness2016;
Grant succeeded.
SQL>
導(dǎo)入sql.sql初始化
五、部署php程序
1强胰、上傳business_php.zip至/home/www
解壓
unzip business_php.zip
配置文件
application/config/config.php
$config['image_prefix'] = "http://公網(wǎng)ip:公網(wǎng)端口";
2舱沧、修改權(quán)限
chmod 777 /home/www/uploads
六、安裝redis
1哪廓、上傳redis-3.2.3.tar.gz 到 /home/app
tar -xzvf redis-3.2.3.tar.gz
cd redis-3.2.3
yum install gcc-c++
make MALLOC=libc
make install
配置redis
vim redis.conf
daemonize=yes
注釋掉bind 127.0.0.1
protected-mode no
拷貝redis.conf到etc目錄下
mkdir -p /etc/redis
cp redis.conf /etc/redis/redis.conf
啟動redis
redis-server /etc/redis/redis.conf
修改redis密碼
redis-cli
config set requirepass 123
[root@oracle redis-3.2.3]# vim redis.conf
[root@oracle redis-3.2.3]# mkdir -p /etc/redis
cp redis.conf /etc/redis/redis.conf[root@oracle redis-3.2.3]# cp redis.conf /etc/redis/redis.conf
[root@oracle redis-3.2.3]# cd /etc/redis
[root@oracle redis]# ls
redis.conf
[root@oracle redis]# vim redis.conf
[root@oracle redis]# redis-server /etc/redis/redis.conf
[root@oracle redis]# redis-cli
127.0.0.1:6379> set config requirepass 123
(error) ERR syntax error
127.0.0.1:6379> config set requirepass 123
OK
127.0.0.1:6379> exit
[root@oracle redis]#
七狗唉、部署java程序
1、上傳business.war至 TOMCAT_HOME/webapps
2涡真、切到目錄bin
運行:
sh startup.sh
打開網(wǎng)頁
http://ip:8080/business/druid/weburi.html
查看,如果正常肾筐,則出現(xiàn)