在tomcat/conf/Catalina/localhost路径下添加xxx.xml文件
xxx.xml文件内容为:
<?xml version="1.0" encoding="UTF-8"?> <Context docBase="F:\soft\geo" //文件映射地址 reloadable="true"> </Context>
访问地址为:localhost:8080/xxx/
------------------------------------------------------
在tomcat中添加geoserver
1、将geoserver的war包放进tomcat的webapp文件夹中
2、apache-tomcat\conf文件下tomcat-users.xml添加账号密码
<user username="admin" password="1234" roles="manager-gui"/>
3、localhost:8080/geoserver 默认用户名为admin密码为geoserver
4、修改默认切片目录,在webapp/geoserver/WEB-INF/web.xml加入
<context-param>
<param-name>GEOWEBCACHE_CACHE_DIR</param-name>
<param-value>切片存放路径。。</param-value>
</context-param>
------------------------------------------------------
解决tomcat中geoserver跨域问题
1、在maven下载java-property-utils-1.9.1.jar、cors-filter-2.5.jar包
2、将jar包放入webapps\geoserver\WEB-INF\lib中
3、打开webapps\geoserver\WEB-INF\web.xml,在适当的位置加入以下代码:
<filter>
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
<init-param>
<param-name>cors.tagRequests</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CORS</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
4、重启tomcat,进入tomcat首页Manager App中重启geoserver
ps:tomcat解决跨域问题(读取terrian地形数据)https://www.cnblogs.com/zhaoyanhaoBlog/p/9370830.html
-----------------------------------------------------------
转载请注明出处:https://www.cnblogs.com/implementer/ |