概述
centos7安装geoserver2.13.2_tomcat9.0.10的方法
服务器一台
geoserver 192.168.10.190
#禁用防火墙方法
systemctl stop firewalld.service ;
加入开机禁用
systemctl disable firewalld.service;
#安装jdk1.8
下载离线包jdk-8u172-linux-x64.gz
解压到/usr/jdk
tar -zxvf jdk-8u172-linux-x64.gz
mv jdk1.8.0_172 jdk
#安装tomcat9.0.10
下载离线包apache-tomcat-9.0.10.tar.gz
下载地址:https://tomcat.apache.org/download-90.cgi
选择Core tar.gz (pgp, sha512)下载
解压到/usr/tomcat
tar -zxvf apache-tomcat-9.0.10.tar.gz
mv apache-tomcat-9.0.10 tomcat
#配置环境变量
vi /etc/profile
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.
export JAVA_HOME=/usr/jdk
export PATH=${JAVA_HOME}/bin:$PATH
export JRE_HOME=/usr/jdk/jre
export PATH=${JRE_HOME}/bin:$PATH
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export CATALINA_HOME=/usr/tomcat
export CATALINA_BASE=/usr/tomcat
export PATH=${CATALINA_BASE}/bin:$PATH
export M2_HOME=/usr/maven
export PATH=$PATH:${M2_HOME}/bin
export GEOWAVE_HOME=/usr/geoserver
#创建一个文件setenv.sh
vi /usr/tomcat/bin/setenv.sh
CATALINA_PID="$CATALINA_BASE/tomcat.pid"
#编辑文件catalina.sh
编辑文件 vi /usr/tomcat/bin/catalina.sh
在#OS specific support前面添加Java环境
添加下面两行参数
JAVA_HOME=/usr/jdk
JRE_HOME=$JAVA_HOME/jre
# OS specific support. $var _must_ be set to either true or false.
#tomcat目录下启动和停止tomcat服务
sudo $CATALINA_BASE/bin/startup.sh
sudo $CATALINA_BASE/bin/shutdown.sh
#配置tomcat9.0.10参数
#修改文件tomcat-users.xml
/usr/tomcat/conf/tomcat-users.xml
添加内容:
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="root" password="1" roles="admin-gui,manager-gui"/>
具体如下所示:
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="root" password="1" roles="admin-gui,manager-gui"/>
</tomcat-users>
#修改文件context.xml
#manager/META-INF/context.xml
/usr/tomcat/webapps/manager/META-INF/context.xml
屏蔽Value段
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127.d+.d+.d+|::1|0:0:0:0:0:0:0:1" />
具体内容如下所示:
<Context antiResourceLocking="false" privileged="true" >
<!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127.d+.d+.d+|::1|0:0:0:0:0:0:0:1" /> -->
<Manager sessionAttributeValueClassNameFilter="java.lang.(?:Boolean|Integer|Long|Number|String)|org.apache.catalina.filters.CsrfPreventionFilter$LruCache(?:$1)?|java.util.(?:Linked)?HashMap"/>
</Context>
#/host-manager/META-INF/context.xml
/usr/tomcat/webapps/host-manager/META-INF/context.xml
屏蔽Value段
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="127.d+.d+.d+|::1|0:0:0:0:0:0:0:1" />
重启tomcat服务
bin/shutdown.sh
bin/startup.sh
#将tomcat配置为服务
可以开机启动
使用systemd的方式,使用
sudo vi /usr/lib/systemd/system/tomcat.service
[Unit]
Description=Tomcat
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/tomcat/tomcat.pid
ExecStart=/usr/tomcat/bin/startup.sh
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
刷新systemd配置
systemctl daemon-reload
启动tomcat并查看其状态
systemctl start tomcat
systemctl stop tomcat
systemctl restart tomcat
systemctl status tomcat
#设置tomcat开机启动
systemctl enable tomcat.service
打开tomcat首页地址:http://192.168.10.190:8080
#安装geoserver2.13.2
下载离线包:geoserver-2.13.2-war.zip
安装unzip解压软件(需要联网)
sudo yum install unzip -y
cd /usr
mkdir geoserver
unzip geoserver2.13.2-war.zip -d geoserver
将geoserver.war复制到$CATALINA_BASE/webapps中去
cd /usr/geoserver
sudo cp geoserver.war $CATALINA_BASE/webapps/
重启tomcat
systemctl restart tomcat
打开geoserver首页地址:http://192.168.10.190:8080/geoserver
使用默认的用户名 admin 和密码 geoserver 登录,
就能看到主界面了
#添加修改GeoServer数据目录(测试时未改动)
编辑文件WEB-INF/web.xml
vi /usr/tomcat/webapps/geoserver/WEB-INF/web.xml
添加下面一段配置
<context-param>
<param-name>GEOSERVER_DATA_DIR</param-name>
<param-value>/usr/geoserver/data</param-value>
</context-param>
重启tomcat后
geoserver 服务器状态中显示数据目录 /usr/geoserver/data
测试时未改动geoserver 服务器状态中显示数据目录为:/usr/tomcat/webapps/geoserver/data
#下载最新版本geoserver扩展的数据源插件地址:
https://zh.osdn.net/projects/sfnet_geoserver/releases/
#下载各种版本geoserver扩展的数据源插件地址:
http://geoserver.org/download/
extensions
geoserver-2.13.2-app-schema-plugin.zip 452.5 KB 2018-07-24 07:00 1
geoserver-2.13.2-arcsde-plugin.zip 3.5 MB 2018-07-24 07:00 2
geoserver-2.13.2-cas-plugin.zip 156.4 KB 2018-07-24 07:00 0
geoserver-2.13.2-charts-plugin.zip 1.5 MB 2018-07-24 07:00 0
geoserver-2.13.2-control-flow-plugin.zip 43.2 KB 2018-07-24 07:00 0
geoserver-2.13.2-css-plugin.zip 627.0 KB 2018-07-24 07:00 0
geoserver-2.13.2-csw-plugin.zip 979.6 KB 2018-07-24 07:00 1
geoserver-2.13.2-db2-plugin.zip 48.7 KB 2018-07-24 07:00 0
geoserver-2.13.2-dxf-plugin.zip 35.7 KB 2018-07-24 07:00 0
geoserver-2.13.2-excel-plugin.zip 10.6 MB 2018-07-24 07:00 0
geoserver-2.13.2-feature-pregeneralized-plugin.zip 41.6 KB 2018-07-24 07:00 0
geoserver-2.13.2-gdal-plugin.zip 334.8 KB 2018-07-24 07:00 1
geoserver-2.13.2-grib-plugin.zip 17.4 MB 2018-07-24 07:00 1
geoserver-2.13.2-h2-plugin.zip 1.2 MB 2018-07-24 07:00 0
geoserver-2.13.2-imagemap-plugin.zip 40.1 KB 2018-07-24 07:00 0
geoserver-2.13.2-imagemosaic-jdbc-plugin.zip 121.4 KB 2018-07-24 07:00 1
geoserver-2.13.2-importer-bdb-plugin.zip 3.7 MB 2018-07-24 07:00 0
geoserver-2.13.2-importer-plugin.zip 1.2 MB 2018-07-24 07:00 0
geoserver-2.13.2-inspire-plugin.zip 42.3 KB 2018-07-24 07:00 0
geoserver-2.13.2-jp2k-plugin.zip 301.9 KB 2018-07-24 07:00 0
geoserver-2.13.2-libjpeg-turbo-plugin.zip 56.0 KB 2018-07-24 07:00 0
geoserver-2.13.2-mongodb-plugin.zip 1.4 MB 2018-07-24 07:00 12
geoserver-2.13.2-monitor-plugin.zip 10.6 MB 2018-07-24 07:00 2
geoserver-2.13.2-mysql-plugin.zip 955.3 KB 2018-07-24 07:00 8
geoserver-2.13.2-netcdf-out-plugin.zip 5.9 MB 2018-07-24 07:00 2
geoserver-2.13.2-netcdf-plugin.zip 6.7 MB 2018-07-24 07:00 0
geoserver-2.13.2-ogr-wfs-plugin.zip 26.2 KB 2018-07-24 07:00 0
geoserver-2.13.2-ogr-wps-plugin.zip 8.7 KB 2018-07-24 07:00 0
geoserver-2.13.2-oracle-plugin.zip 80.7 KB 2018-07-24 07:00 0
geoserver-2.13.2-printing-plugin.zip 3.9 MB 2018-07-24 07:00 1
geoserver-2.13.2-pyramid-plugin.zip 26.9 KB 2018-07-24 07:00 1
geoserver-2.13.2-querylayer-plugin.zip 10.6 KB 2018-07-24 07:00 2
geoserver-2.13.2-sqlserver-plugin.zip 40.5 KB 2018-07-24 07:00 4
geoserver-2.13.2-teradata-plugin.zip 41.0 KB 2018-07-24 07:00 0
geoserver-2.13.2-vectortiles-plugin.zip 310.6 KB 2018-07-24 07:00 1
geoserver-2.13.2-wcs2_0-eo-plugin.zip 77.4 KB 2018-07-24 07:00 1
geoserver-2.13.2-wps-cluster-hazelcast-plugin.zip 3.4 MB 2018-07-24 07:00 1
geoserver-2.13.2-wps-plugin.zip 994.3 KB 2018-07-24 07:00 3
geoserver-2.13.2-xslt-plugin.zip 30.6 KB 2018-07-24 07:00 2
geoserver-2.13.2-ysld-plugin.zip
然后解压后拷贝到下面目录中:
/usr/tomcat/webapps/geoserver/WEB-INF/lib
新建数据源
选择你要配置的数据源的类型
s矢量数据源
Directory of spatial files (shapefiles) - Takes a directory of shapefiles and exposes it as a data store
GeoPackage - GeoPackage
Microsoft SQL Server (JNDI) - Microsoft SQL Server (JNDI)
Microsoft SQL Server (JTDS Driver) (JNDI) - Microsoft SQL Server (JTDS Driver) (JNDI)
MongoDB - MongoDB database
MySQL - MySQL Database
MySQL (JNDI) - MySQL Database (JNDI)
Oracle NG (JNDI) - Oracle Database (JNDI)
PostGIS - PostGIS Database
PostGIS (JNDI) - PostGIS Database (JNDI)
Properties - Allows access to Java Property files containing Feature information
Shapefile - ESRI™ Shapefiles (*.shp)
Web Feature Server (NG) - Provides access to the Features published a Web Feature Service, and the ability to perform transactions on the server (when supported / allowed).
栅格数据源
ArcGrid - ARC/INFO ASCII GRID Coverage Format
GeoPackage (mosaic) - GeoPackage mosaic plugin
GeoTIFF - Tagged Image File Format with Geographic information
ImageMosaic - Image mosaicking plugin
WorldImage - A raster file accompanied by a spatial data file
其他数据源
WMS - 悬挂一个远程网站地图服务
WMTS - Cascades a remote Web Map Tile Service
#安装geowave插件
下载离线包:geowave-geoserver-0.9.7-apache.jar
下载地址:
http://s3.amazonaws.com/geowave-rpms/release-jars/JAR/geowave-geoserver-0.9.7-apache.jar
更多版本地址:
http://locationtech.github.io/geowave/packages.html
选择Release JARS有一个列表下载
将它拷到 /usr/tomcat/webapps/geoserver/WEB-INF/lib下
此时启动geoserver, 打开浏览器进入 192.168.10.190:8080/geoserver/web 登录geoserver。默认帐号admin,密码geoserver。
在左侧data栏目下store, 点击add new store可以看到geowave插件已经加载了
s矢量数据源
Directory of spatial files (shapefiles) - Takes a directory of shapefiles and exposes it as a data store
GeoPackage - GeoPackage
GeoWave Datastore - ACCUMULO - A datastore that uses the GeoWave API for spatial data persistence in accumulo. A GeoWave store backed by tables in Apache Accumulo
GeoWave Datastore - BIGTABLE - A datastore that uses the GeoWave API for spatial data persistence in bigtable. A GeoWave store backed by tables in Google’s Cloud BigTable
GeoWave Datastore - HBASE - A datastore that uses the GeoWave API for spatial data persistence in hbase. A GeoWave store backed by tables in Apache HBase
Microsoft SQL Server (JNDI) - Microsoft SQL Server (JNDI)
Microsoft SQL Server (JTDS Driver) (JNDI) - Microsoft SQL Server (JTDS Driver) (JNDI)
MongoDB - MongoDB database
MySQL - MySQL Database
MySQL (JNDI) - MySQL Database (JNDI)
Oracle NG (JNDI) - Oracle Database (JNDI)
PostGIS - PostGIS Database
PostGIS (JNDI) - PostGIS Database (JNDI)
Properties - Allows access to Java Property files containing Feature information
Shapefile - ESRI™ Shapefiles (*.shp)
Web Feature Server (NG) - Provides access to the Features published a Web Feature Service, and the ability to perform transactions on the server (when supported / allowed).
—the–end—
最后
以上就是深情万宝路为你收集整理的centos7安装geoserver2.13.2_tomcat9.0.10的方法extensions的全部内容,希望文章能够帮你解决centos7安装geoserver2.13.2_tomcat9.0.10的方法extensions所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复