读书人

本土虚拟机的相关部署(jdk tomcat 等

发布时间: 2013-04-12 18:33:12 作者: rapoo

本地虚拟机的相关部署(jdk tomcat 等)
安装linux64遇到的问题

1. 查看linux的版本是否为64位:

getconf LONG_BIT


2. 拷贝jdk linux 64 到 /usr/local/ 里面

chmod +x jdk-6u31-linux-x64.bin
./jdk-6u31-linux-x64.bin
jdk 已经被安装到:/usr/local/jdk1.6.0_31/bin ,,,,,,


3. 修改环境变量: vi /etc/profile

JAVA_HOME=/usr/local/jdk1.6.0_31/
JRE_HOME=/usr/local/jdk1.6.0_31/jre
CLASSPATH=/usr/local/jdk1.6.0_31/lib/dt.jar:/usr/local/jdk1.6.0_31/lib/tools.jar
PATH=/usr/local/jdk1.6.0_31/bin:$PATH
export PATH JAVA_HOME JRE_HOME CLASSPATH

4. 拷贝一个tomcat上去 写个index.html 测试一下
修改setenv.sh server.xml 8882

chmod +x *.sh
http://192.168.111.128:8882/demo/index.html

5. 拷贝 data index 的基础数据 到虚拟机 共 8.8g 数据

6. 拷贝licence

7. 修改licence 里面的路径

8. 上传tomcat_route route程序

http://192.168.111.128:8882/route/getDriveByLatLon.jsp?orig=HESJIWXVVHERV&dest=HERSWEXVVHDSU&width=600&height=400&style=2

http://192.168.111.128:8882/route/getDriveByLatLon.jsp?orig=120.14913,30.24923&dest=120.30033,30.37917&width=600&height=400&style=2&customer=2

因本地启动后访问太卡 调整tomcat的内存

访问不了: 防火墙的问题 service iptables stop
乱码问题:
==============================================
linux中文: /etc/sysconfig/i18n

LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"



catalina.sh:

CATALINA_OPTS="$CATALINA_OPTS -verbose:gc -Xloggc:/mapbar/logs/web_gc.vgc -Xms3000M -Xmx3000M -DLOCALE=UTF-16LE -XX:+UseConcMarkSweepGC -DROUTE_PATH=/data/route_mapx/ -DMAP_DATA_PATH=/data/navinfo2010win/
-DRAMDISK=/ -DCTMR=6F6A5L5M6YSM2J6F192Z1Y368M6BNM5B -DCTMRD=272Z4R5W3O3E3266395K5L6X476F4CVM -DRAM_DISK=false"

startup.sh , run.sh: 需要增加:
export LANG="zh_CN.GB18030"

=======================================


9. 安装apache 详细参见apache.txt


10. 测试search 接口 tomcat server.xml search程序:licence目录 data,index 目录
run.sh startup.sh 中文
http://192.168.111.128:8803/search/getPoiByKeyword.jsp?keyword=天坛&city=北京市


11. 测试bus 接口: tomcat server.xml search程序:licence目录 data,index 目录
run.sh startup.sh 中文

http://192.168.111.128:8884/bus/getBusBigCity.jsp?city=%B1%B1%BE%A9%C%D0&orig=HEJTWEXVVGWIJ&dest=HETACTWVVIHAJ&width=680&height=450&all=1

http://192.168.111.128:8884/bus/getRouteNamesByKeyword.jsp?keyword=1&city=%B1%B1%BE%A9%CA%D0


http://192.168.111.128:8884/bus/getRouteByRouteName.jsp?keyword=地铁1号线上行(苹果园-四惠东)&city=%B1%B1%BE%A9%CA%D0&width=900&height=530


12. 测试decode的经纬度接口 8885

CTMR= 偏移
CTMRD= 偏正
WGSK= 84转02
WGSD= 02转84

IP=192.168.111.128 CTMR=2O5Z6W2K1S3N643V551A6C3Y3O444R14 CTMRD=6E621U3FZMFM1T1J414O6Q3A4E6I5L60

IP=192.168.111.128 WGSK=224Q244M205K1G5R5E1M562K1Z4B5A5W WGSD=1Q26696B1E384FTM4T1C53581K5A4ICM

客户使用这个:
http://192.168.111.128:8885/decode/getLatLon.jsp?latlon=116.35873,39.94442;116.35873,39.94442;116.35873,39.94442;116.35873,39.94442;116.35873,39.94442;116.35873,39.94442;116.35873,39.94442&customer=2

如果key没有生效:
vi /etc/hosts
修改ip127.0.0.1 ::1 注释 为使用的ip
查看hostname 是否一致

最后记得重启tomcat

测试经纬度:
84 真实 116.35873,39.94442

http://geocode.mapbar.com/Decode/encode_xml.jsp?lonlat=116.35873,39.94442

02 真实: 116.36493,39.94578 HERIITXVVICUW

02 偏移: 116.36033 39.94642


13. 测试叠加层接口,tomcat run.sh startup.sh setnev.sh 同 layer 放一个空的图片 xml里面放个gaosu.xml

http://192.168.111.128:8888/layer/addLineLayer.jsp?xmlUrl=http://192.168.111.128:8888/layer/xml/gaosu.xml&userId=tts&themeName=gaosu


14. 逆地理接口:

a 部署netty 服务
b 部署tomcat_netty 服务
c 部署inverse_netty 程序
d 需要一些数据: /data/route10win /index/inverseIndex(poi) /data/index/reverseIndex/spatial
/data/city/


ln -s /var/mapbar/data /data
ln -s /var/mapbar/index /index

tail -fn 100 nohup.out

http://192.168.111.128:7081/inverse/getInverseGeocoding.jsp?detail=1&zoom=11&customer=2&latlon=120.16926,30.28174




15.测试tomcat的负载均衡服务:
webapps: webapps_junhengtest
把这3个tomcat的启动内存改小点

tomcat_www_junhengtes1 8382 7732/7832
tomcat_www_junhengtes2 8482 7742/7842
tomcat_www_junhengtes3 8582 7752/7852

http://192.168.111.128:8382/junheng/index.jsp
http://192.168.111.128:8482/junheng/index.jsp
http://192.168.111.128:8582/junheng/index.jsp

测试地址:
http://192.168.111.128/index.jsp

apache的安装过程要包含 proxy的编译
添加vhost.conf proxy.conf 和 httpd.conf 里面引入这2个配置
注意 tomcat里面配置的程序路径 要和 apache里的规则一致
httpd.conf:
DefaultType text/plain ...................




# 负载均衡 new add :
Include conf/vhosts.conf
Include conf/proxy.conf


<Proxy balancer://myCluster>
BalancerMember ajp://192.168.111.128:7832 loadfactor=5
BalancerMember ajp://192.168.111.128:7842 loadfactor=5
BalancerMember ajp://192.168.111.128:7852 loadfactor=5
</Proxy>


<VirtualHost *:80>
ServerName x.mapbar.com
DocumentRoot "/home/tomcat/mapbar/"
DirectoryIndex index.html index.htm index.jsp

<Directory /home/tomcat/mapbar>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

RewriteEngine On
ProxyPreserveHost on

Include conf/proxy.conf
RewriteRule ^/dymatic/(.*) balancer://myCluster/junheng/$1 [P,N,NC]
</VirtualHost>



for i in `ls` ;do tar xvf $i ;done
底图的世界级W 需要大写






读书人网 >其他数据库

热点推荐