1. 安裝操做系統Debian 5.0 amd64nginx
a) /etc/resolv.conf 修改dnsajax
b) sql
c) apache
d) 安裝系統,設置ip,注意至少要有1024M的交換分區用於Oracleubuntu
e) 修改sources.list(手工修改用163的源),升級系統到最新版本服務器
f) deb http://mirrors.163.com/debian stable contrib main non-freesession
ubuntuoracle
deb http://mirrors.163.com/ubuntu/ hardy main restricted universe multiverseapp
deb http://mirrors.163.com/ubuntu/ hardy-security main restricted universe multiversessh
deb http://mirrors.163.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-backports main restricted universe multiverse
g) 升級操做系統
i. 更新源
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-cache search wqy
sudo apt-get install xfonts-wqy
h) 安裝ssh
apt-get install openssh-server
i) 安裝Oracle,apache,nginx使用的類庫
sudo apt-get install libc6-i386
sudo apt-get install bc
sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
sudo apt-get install zip rar
2. 安裝Oracle 10g XE
a) 安裝須要的包
libaio_0.3.104-1_i386.deb
oracle-xe-universal_10.2.0.1-1.1_i386.deb
sudo dpkg -i --force-architecture libaio_0.3.104-1_i386.deb
sudo dpkg -i --force-architecture oracle-xe-universal_10.2.0.1-1.1_i386.deb
b) 配置Oracle
sudo /etc/init.d/oracle-xe configure
c) 修改Oracle配置
sudo passwd oracle來建立密碼
su oracle:
source /etc/profile
d) 修改監聽
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(GLOBAL_DBNAME = XE)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
e) 監聽查看方法
lsnrctl reload
lsnrctl status
f) 設置Oracle各項參數
sqlplus sys/maxinfo@XE as sysdba
SQL>EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE)
shutdown immediate ;
startup mount ;
alter system enable restricted session ;
alter system set JOB_QUEUE_PROCESSES=0;
alter system set AQ_TM_PROCESSES=0;
alter database open ;
alter database character set internal_use ZHS16GBK ;
shutdown immediate ;
startup ;
i. http://168.168.168.59:8080/apex/
g) 修改/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin,下面的listener.ora tnsnames.ora文件中的ip爲服務器名稱
h) 建立Oracle用戶
create tablespace HR_TBSPACE datafile '/usr/lib/oracle/xe/oradata/HR_TBSPACE.dbf' size 1000m;
create user hrsystem identified by maxinfo default tablespace HR_TBSPACE temporary tablespace temp;
grant connect,resource to hrsystem;
3. 安裝JDK環境和Jetty,ajaxterm
a) 安裝JDK
chmod +x
sudo chown -Rf jetty ./jrmc
i. 安裝JDK到 /opt/jrmc目錄
ii. 修改/etc/profile,加入:
export JAVA_HOME=/opt/jrmc
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=/usr/lib/oracle
export PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin:$JAVA_HOME/bin
export ORACLE_SID=XE
source /etc/profile
b) 安裝Jetty
i. 複製jetty文件到jetty6目錄下解壓縮,
ii. 複製.jettyrc文件到jetty目錄
iii. 設置jetty自動啓動
1. 將jetty安裝目錄下的jetty.sh cp到/etc/init.d/目錄下
sudo cp bin/jetty.sh /etc/init.d/jetty6
2. 修改jetty6 增長 JAVA_HOME、JETTY_HOME
JAVA_HOME=/opt/jrmc
JETTY_HOME=/home/jetty/jetty6
3. 執行:
sudo update-rc.d jetty6 defaults
iv. 下載最新源碼:
sudo apt-get install subversion
mkdir workspace
svn co http://dev.bjmaxinfo.com/svn/hr-system/trunk/hr-system -r HEAD
v. 打包(複製.m2.tar.gz,chmod +x *.sh)
c)
4. 導入Oracle數據
a) 導入測試庫數據
imp hrsystem/maxinfo@133 file=d:\temp\hr_2010-04-02.dmp
b) 正式庫數據須要等
5. 啓動系統檢查設置
a) 重啓系統,檢查jetty和Oracle是否正常啓動
i. 檢查潤乾key是否被正確設置(context中的設置,key的設置,驅動的設置等)
6. 安裝apache,nginx,ajaxterm,denyhosts
sudo apt-get install denyhosts
7. dns配置文件
a) /etc/resolv.conf
b) Host文件 /etc/hosts
1. 首先啓動監聽服務
2. cd $ORACLE_HOME #進入到oracle的安裝目錄
3. dbstart #重啓服務器
4. lsnrctl start #重啓監聽器