greening install

greening dsa install

centos 6/7
|__ java 1.7
|__ tomcat 7
|   \__ tomcat/webapps
|       |__ dsa實體1
|       |__ dsa實體2
|       \__ ...
以下部分可與上方分開
\__ postgresql 9.2
    |__ contrib
    |   |__ uuid-ossp
    |   |__ adminpack
    |   \__ xml2
    \__ db : dsa_server

dsa有兩種,掛了那一個service就會變成那種

  1. greening(帳號)
    • 使用greening資料庫
  2. ischool(學校)
    • 使用ischool資料庫

步驟:

  1. 安裝java及tomcat
  2. 安裝postgresql
  3. 初始化資料庫
  4. 部署dsa實體

    • svn 帳號 (等下會用到)
    • java code

      #安裝svn
      yum install svn
      
      #切換至tomcat目錄
      cd /usr/share/tomcat/webapps
      
      #svn把版本庫拉下來
      svn co http://update.ischool.com.tw/svn/is4/greening2-production
      可能出現
      Authentication realm: <http://update.ischool.com.tw:80> Subversion repository
      Password for 'root': <<< 按Enter
      Authentication realm: <http://update.ischool.com.tw:80> Subversion repository
      Username: 輸入svn帳號
      Password for '帳號': 輸入svn密碼
      
      #移動資料夾
      mv greening2-production/ dsa/
      
      #建立資料夾並改變擁有者及權限
      mkdir dsa/WEB-INF/deploy
      chown -R tomcat.tomcat dsa/WEB-INF/deploy/
      chmod +x dsa/WEB-INF/deploy/
      
      cd dsa/WEB-INF/conf/
      cp server.xml.template server.xml
      vim server.xml
      
    • server.xml
      <?xml version="1.0" encoding="utf-8"?>
      <ApplicationServer Type="SharedService" Name="[注a]">
            <Property Name="ServerConnection">
                    <ServerConnection>
                            <Driver>org.postgresql.Driver</Driver>
                            <URL>jdbc:postgresql://xxx/dsa_server[注b]</URL>
                            <UserName>[注c]</UserName>
                            <Password>[注d]</Password>
                    </ServerConnection>
            </Property>
      </ApplicationServer>
      
      • 注a:dsa server name
      • 注b:db連線的url
      • 注c:db連線的username
      • 注d:db連線的password
    • 資料庫中server表的一筆資料
      欄位name為[注a]
      欄位configuration調整部分為以下
      <Property Name="UpdateCenter">
         <UpdateCenter>
             <AppDeploy UserName="update">[注1]</AppDeploy>
             <Components UserName="update">[注2]</Components>
         </UpdateCenter>
      </Property>
      <Property Name="LoadBalanceSetup">
         <LoadBalanceSetup>
             <ServerManagerURL>[注3]</ServerManagerURL>
         </LoadBalanceSetup>
      </Property>
      
      依種類設定
  5. 測試

    • 開啟web,如無tomcat系統錯誤即完成