分享

AIX 5.3环境下搭建ArcIMS92+Apache2.0.63+Tomcat5.5.2...

 apsbb 2010-08-03

AIX 5.3环境下搭建ArcIMS92+Apache2.0.63+Tomcat5.5.25全工略
前言
在Windows下配置ArcIMS91、92都非常简单,一般从网上下载Apache2.0.*、Tomcat5.5.25、JDK1.5就可以非常顺利的安装成功,不会遇到什么问题。
但是在AIX环境下,因为初次使用该操作系统,虽然熟悉些Linux命令,但是毕竟这两种环境还是存在很多的不同。
因为项目需要,不得不在AIX环境下安装ArcIMS92,在全部安装成功前,走了很多的弯路,也解决了很多的问题,在此做一下总结,希望对各位能有所帮助。
 
JDK1.5的安装
在AIX环境下已经安装了,一般目录为 /usr/java5,在此不多涉及,一般通过网上的方法就能安装成功。
在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
修改所有用户的环境变量
# 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
设置路径:
#vi /etc/profile
在该文件的最后加入:
export TOMCAT_HOME=/usr/ tomcat5
退出后执行
#./etc/profile
或者退出重新登录使环境变量生效
修改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登录,查看各发布程序的状态了。
到此为止,如果在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的虚拟内存:
$TOMCAT_HOME/bin/catalina.sh的前面,增加如下设置:
  JAVA_OPTS='-Xms【初始化内存大小】 -Xmx【可以使用的最大内存】'
  需要把这个两个参数值调大。例如:
  JAVA_OPTS='-Xms256m -Xmx512m'
  表示初始化内存为256MB,可以使用的最大内存为512MB。
Apache2.0.63的安装
Apache的安装不算麻烦,一般装完就能用,但是最为复杂的是与tomcat的jk安装,从网上找了很多很多的资料,但是基本没有找到能配置成功的。最后,又看了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,服务器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                                                --创建安装目标目录
# mkdir arcims
# chown arcims arcims/                                  --改变目录的所有者,使创建的用户具有该目录完全
安装ArcIMS92:
(因为地图中的图层信息含有中文,所以需要对AIX安装中文环境,并对java添加中文字体,如宋体)
1)         用新建立的用户arcims进入图形界面;
2)         进入ArcIMS的安装文件夹,运行 $./SetupArcIMS
3)         根据选项选择,一步一步安装,比较简单,一般都能成功;
4)         安装PostInstall,需要注意,选择 'I will manually configure my Web server / servlet engine' 手动配置webserver和servlet engine.
(如果需要重新进行 Post Install, 可以执行./usr/arcims/tools/SetupArcIMS_PostInstall 脚本文件 $ ./SetupArcIMS_PostInstall)
5)         验证系统变量配置
ArcIMS  配置中将 $JAVA_HOME 指向了ArcIMS自带的jre安装目录,此时应该手工修改过来.
     编辑 .profile  将下面两行注释或删除
      #JAVA_HOME=/opt/arcgis/arcims/jre
      #export JAVA_HOME
     重新加载系统变量
    $ . /.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}为实际的服务器名.
c)         回到命令行,执行以下命令:
[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的身份登录到系统的图形界面,然后在命令窗口中输入:
一般需要先配置几个变量:
$export AIMSHOME=/usr/local/arcims/arcgis/arcims
$export JAVA_HOME=/usr/java5
$export LIBPATH=”具体内容参考 /home/arcims/.profile 中的内容”
进入arcims目录中:
为减少出错几率,可以重启服务:
$cd Xenv
$./aims_shutdown
$./aims_bootup
$./aimsappsrvr start
$cd ../Xenv
$./manage_arcims
选择3,再选择2,进入administrator管理界面
一般可以成功,输入用户名、密码,然后就可以新建服务了。
如果出现没有虚拟主机的问题,可以重新PostInstall一次,记得中间有个选择是否安装ArcIMS administrator 管理的一个界面,这里一定要选yes,否则会出问题。
如果上面选择系统自动配置Apache+Tomcat,我试了很多遍,都失败了,有错误。但是用Apache+ServletExec倒是可以成功。
另外,发布的地图文件,可以将windows下的地图文件和axl拷贝到arcims的AXL下继续使用,需要注意的就是,要通过ultraEdit编辑一下AXL,选择UNIX输出,及UTF8编码。
通过以上一系列的配置,就可以成功启动地图服务程序了。


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/mustbelove/archive/2008/03/15/2184996.aspx

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多