AIX 5.3環(huán)境下搭建ArcIMS92+Apache2.0.63+Tomcat5.5.25全工略 前言 在Windows下配置ArcIMS91、92都非常簡單,一般從網(wǎng)上下載Apache2.0.*、Tomcat5.5.25、JDK1.5就可以非常順利的安裝成功,不會遇到什么問題。 但是在AIX環(huán)境下,因為初次使用該操作系統(tǒng),雖然熟悉些Linux命令,但是畢竟這兩種環(huán)境還是存在很多的不同。 因為項目需要,不得不在AIX環(huán)境下安裝ArcIMS92,在全部安裝成功前,走了很多的彎路,也解決了很多的問題,在此做一下總結(jié),希望對各位能有所幫助。 JDK1.5的安裝 在AIX環(huán)境下已經(jīng)安裝了,一般目錄為 /usr/java5,在此不多涉及,一般通過網(wǎng)上的方法就能安裝成功。 在Linux下,可以參考以下方式: # chmod u+x ./j2sdk-1_4_2_04-linux-i586.bin # ./j2sdk-1_4_2_04-linux-i586.bin 在按提示輸入yes后,jdk被解壓到./j2sdk1.5.2_04目錄下。為與下面2中JDK安裝路徑一致,我們進行下列操作,在/usr/java5下建立安裝路徑,并將文件考到該路徑下: # mkdir /usr/java5 # cp -fr ./j2sdk1.4.2_04 /usr/java5 修改所有用戶的環(huán)境變量 # vi /etc/profile 在該文件最后加入: export JAVA_HOME=/usr/java5 export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin 一定要在CLASSPATH路徑中加入$CLASSPATH: Tomcat5.5.25的安裝 #gzip –d apache-tomcat-5.5.25.tar.gz #tar –xvf apache-tomcat-5.5.25.tar #mv apache-tomcat-5.5.25 tomcat55 設(shè)置路徑: #vi /etc/profile 在該文件的最后加入: export TOMCAT_HOME=/usr/ tomcat5 退出后執(zhí)行 #./etc/profile 或者退出重新登錄使環(huán)境變量生效 修改Tomcat管理員密碼 然后在$TOMCAT_HOME/conf/tomcat-users.xml修改成如下形式: <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <role rolename="admin"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/> <user username="admin" password="admin" roles="admin,manager"/> </tomcat-users> 這樣在啟動Tomcat是,就可以在首頁的Tomcat Manager中用admin/admin登錄,查看各發(fā)布程序的狀態(tài)了。 到此為止,如果在Linux下,Tomcat的安裝就算大功告成了,但是在AIX5.3下卻不是這樣,錯誤出在Tomcat不能解析Servlet,最簡單的就是自身帶的Servlets-examples不能運行。需要將幾個包考到Tomcat/common/lib下。 進入Tomcat的webapps/jsp-examples/WEB-INF/classes,將下列文件打包: #jar cvf compressionFilters.jar compressionFilters #jar cvf filters.jar filters 然后將這兩個jar拷貝到Tomcat/common/lib。 再重啟tomcat就可以了。 另外,還可以在這里修改tomcat的虛擬內(nèi)存: $TOMCAT_HOME/bin/catalina.sh的前面,增加如下設(shè)置: JAVA_OPTS='-Xms【初始化內(nèi)存大小】 -Xmx【可以使用的最大內(nèi)存】' 需要把這個兩個參數(shù)值調(diào)大。例如: JAVA_OPTS='-Xms256m -Xmx512m' 表示初始化內(nèi)存為256MB,可以使用的最大內(nèi)存為512MB。 Apache2.0.63的安裝 Apache的安裝不算麻煩,一般裝完就能用,但是最為復(fù)雜的是與tomcat的jk安裝,從網(wǎng)上找了很多很多的資料,但是基本沒有找到能配置成功的。最后,又看了apache的介紹文檔,終于找到了解決辦法: 在AIX下一般沒有Linux的編譯工具,需要自己安裝: gcc g++ for aix5.3 install guide 1 bos.adt fileset is required check: lslpp -l| grep bos.adt if there is nothing output, install bos.adt( it's in first install cd, installp/ppc/bos.adt ),use command "smit install_latest" to install. 2 download and install rpms from http://www-03.ibm.com/servers/aix/products/aixos/linux/download.html install rpm, you jutst need type: rpm -ivh *.rpm (the rpms you want install) you may reuire these: autoconf213-2.13-1.aix5.1.noarch.rpm autoconf-2.59-1.aix5.1.noarch.rpm automake-1.8.5-1.aix5.1.noarch.rpm gcc-4.0.0-1.aix5.3.ppc.rpm gcc-cplusplus-4.0.0-1.aix5.3.ppc.rpm gdb-6.0-1.aix5.1.ppc.rpm indent-2.2.7-2.aix4.3.ppc.rpm libgcc-4.0.0-1.aix5.3.ppc.rpm libstdcplusplus-4.0.0-1.aix5.3.ppc.rpm libstdcplusplus-devel-4.0.0-1.aix5.3.ppc.rpm libtool-1.5.8-2.aix5.1.ppc.rpm m4-1.4.1-1.aix5.1.ppc.rpm make-3.80-1.aix5.1.ppc.rpm vim-common-6.3-1.aix5.1.ppc.rpm vim-enhanced-6.3-1.aix5.1.ppc.rpm vim-minimal-6.3-1.aix5.1.ppc.rpm Apache的安裝: #gzip –d httpd-2.0.63.tar.gz #tar -zxvf httpd-2.0.63.tar #mv httpd-2.0.59 apache #cd apache #配置(prefix是安裝路徑,enable-mods-shared=all表示編譯配置所有so文件) #./configure --prefix=/usr/local/apache --enable-mods-shared=all (/usr/local/apache為安裝目錄) #make #make install 配置httpd.conf vi /usr/local/apache/conf/httpd.conf ServerName 配置為 127.0.0.1,服務(wù)器IP或域名 DirectoryIndex 中添加index.htm index.jsp default.htm default.html Group nobody 必須要改,否則apache不能啟動 #cd /usr/local/apache/bin #./apachectl start Mod_jk的安裝: A. 在此下載編譯好的mod_jk.so(AIX); B. If the connector file has a different name than 'mod_jk.so', then rename it to 'mod_jk.so'. For example, if the connector file is named 'mod_jk-1.x.xx-apache-2.x.xx-solaris-sparc.so'. To rename it, type the following command: #mv mod_jk-1.x.xx-apache-2.x.xx-solaris-sparc.so mod_jk.so C. Copy the mod-jk.so file to the $APACHE_HOME/modules directory and grant it executable permissions. #cp mod_jk.so $APACHE_HOME/modules #cd $APACHE_HOME/modules #chmod 755 mod_jk.so D. workers.properties file # Define 1 real worker using ajp13 worker.list=worker1 # # ESRI IMS 9.2 Properties # worker.tomcat_home=/usr/tomcat55 worker.java_home=/usr/java5 worker.ajp13.host=localhost # # Set properties for worker1 (ajp13) # worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 worker.worker1.lbfactor=50 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.reclycle_timeout=300 E. 修改上面的:worker.tomcat_home worker.java_home F. Copy the workers.properties file to the $APACHE_HOME/conf directory. #cp workers.properties $APACHE_HOME/conf G. Navigate to $APACHE_HOME/conf and open httpd.conf with a text editor. Add the following lines to the bottom of the httpd.conf file and save. Set JkWorkersFile to the location of the workers.properties file. In our example, it would be: JkWorkersFile /usr/local/apache/conf/workers.properties
Set JkLogFile to the the location of the mod_jk.log file. For example: JkLogFile /usr/local/apache2058/logs/mod_jk.log
Set JkLogLevel, for example: JkLogLevel info
The following lines will add the mapping for servlets-examples to test the communication between Apache and Tomcat: JkMount /servlets-examples worker1 JKMount /servlets-examples/* worker1 d. While editing httpd.conf file, include these lines at the bottom of the file for the ArcIMS web applications: JkMount /servlet worker1 JKMount /servlet/* worker1 JKMount /esriadmin worker1 JKMount /esriadmin/* worker1 JKMount /metadataexplorer worker1 JKMount /metadataexplorer/* worker1 JKMount /wmsconnector worker1 JKMount /wmsconnector/* worker1 JKMount /wfsconnector worker1 JKMount /wfsconnector/* worker1 JKMount /aimscsw worker1 JKMount /aimscsw/* worker1 JKMount /aimsharvester worker1 JKMount /aimsharvester/* worker1 JKMount /jspsamples worker1 JKMount /jspsamples/* worker1 JKMount /jspviewer worker1 JKMount /jspviewer/* worker1 H. Please follow the instructions below to enable Apache Web Server to communicate with Tomcat. a. Edit the $APACHE_HOME/conf/httpd.conf file. b. Find the last LoadModule statement and add the following line: LoadModule jk_module modules/mod_jk.so c. Start Tomcat and the Apache Web Server as follows: $CATALINA_HOME/bin/startup.sh $APACHE_HOME/bin/apachectl start I. Verify that the Apache Web Server and Tomcat are communicating. Open a Web browser and navigate to the following URL: http://<server_name>/servlets-examples/servlet/HelloWorldExample If a response containing "Hello World" is returned, Apache and tomcat are communicating as expected. ArcIMS92的安裝 新建arcims用戶,用來安裝ArcIMS92; 建立安裝目錄: # cd /opt --創(chuàng)建安裝目標(biāo)目錄 # mkdir arcims # chown arcims arcims/ --改變目錄的所有者,使創(chuàng)建的用戶具有該目錄完全 安裝ArcIMS92: (因為地圖中的圖層信息含有中文,所以需要對AIX安裝中文環(huán)境,并對java添加中文字體,如宋體) 1) 用新建立的用戶arcims進入圖形界面; 2) 進入ArcIMS的安裝文件夾,運行 $./SetupArcIMS 3) 根據(jù)選項選擇,一步一步安裝,比較簡單,一般都能成功; 4) 安裝PostInstall,需要注意,選擇 'I will manually configure my Web server / servlet engine' 手動配置webserver和servlet engine. (如果需要重新進行 Post Install, 可以執(zhí)行./usr/arcims/tools/SetupArcIMS_PostInstall 腳本文件 $ ./SetupArcIMS_PostInstall) 5) 驗證系統(tǒng)變量配置 ArcIMS 配置中將 $JAVA_HOME 指向了ArcIMS自帶的jre安裝目錄,此時應(yīng)該手工修改過來. 編輯 .profile 將下面兩行注釋或刪除 #JAVA_HOME=/opt/arcgis/arcims/jre #export JAVA_HOME 重新加載系統(tǒng)變量 $ . /.bash_profile 6) 部署ArcIMS servlet 連接器 a) 運行下面命令: $ cd /opt/arcgis/arcims/Middleware/servlet_connector/ $ cp arcimsservletconnector.war servlet.war $ mkdir build $ cd build/ $ jar -xvf ../servlet.war #解包 $ cd WEB-INF/classes $ vi Esrimap_prop b) 修改 Esrimap_prop文件 將appServerMachine=mymachine 修改為 appServerMachine={serverhost-name} {serverhost-name}為實際的服務(wù)器名. c) 回到命令行,執(zhí)行以下命令: [arcims@yxgt-ims classes]$ cd .. [arcims@yxgt-ims WEB-INF]$ cd .. [arcims@yxgt-ims build]$ jar cvf servlet.war * #重新打包,解壓后war文件好像刪除了,此處出錯 $ mv servlet.war /usr/tomcat55/webapps/servlet.war #部署到Tomcat下 d) 重啟Tomcat ./shutdown.sh ./startup.sh 7) 測試ArcIMS是否安裝成功 在root下啟動apache、tomcat 以arcims的身份登錄到系統(tǒng)的圖形界面,然后在命令窗口中輸入: 一般需要先配置幾個變量: $export AIMSHOME=/usr/local/arcims/arcgis/arcims $export JAVA_HOME=/usr/java5 $export LIBPATH=”具體內(nèi)容參考 /home/arcims/.profile 中的內(nèi)容” 進入arcims目錄中: 為減少出錯幾率,可以重啟服務(wù): $cd Xenv $./aims_shutdown $./aims_bootup $./aimsappsrvr start $cd ../Xenv $./manage_arcims 選擇3,再選擇2,進入administrator管理界面 一般可以成功,輸入用戶名、密碼,然后就可以新建服務(wù)了。 如果出現(xiàn)沒有虛擬主機的問題,可以重新PostInstall一次,記得中間有個選擇是否安裝ArcIMS administrator 管理的一個界面,這里一定要選yes,否則會出問題。 如果上面選擇系統(tǒng)自動配置Apache+Tomcat,我試了很多遍,都失敗了,有錯誤。但是用Apache+ServletExec倒是可以成功。 另外,發(fā)布的地圖文件,可以將windows下的地圖文件和axl拷貝到arcims的AXL下繼續(xù)使用,需要注意的就是,要通過ultraEdit編輯一下AXL,選擇UNIX輸出,及UTF8編碼。 通過以上一系列的配置,就可以成功啟動地圖服務(wù)程序了。
本文來自CSDN博客,轉(zhuǎn)載請標(biāo)明出處:http://blog.csdn.net/mustbelove/archive/2008/03/15/2184996.aspx
|