企业实战(21)基于Linux下安装部署GeoServer地图服务

简介: 企业实战(21)基于Linux下安装部署GeoServer地图服务

环境介绍:


CentOS 7.5


Java 1.8.0


Geoserver 2.17.2


GeoServer 2.17.2下载:

https://nchc.dl.sourceforge.net/project/geoserver/GeoServer/2.17.2/geoserver-2.17.2-bin.zip


安装部署

9.png1.确保在系统上安装了Java Runtime Environment(JRE)。GeoServer需要Java 8或Java 11环境,可从OpenJDK,AdoptOpenJDK获得或由您的OS发行版提供。

[root@test ~]# yum install java-1.8.0-openjdk
[root@test ~]# java -version
openjdk version "1.8.0_262"
OpenJDK Runtime Environment (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)

2.下载GeoServer

[root@test ~]# yum -y install wget
[root@test ~]# wget https://nchc.dl.sourceforge.net/project/geoserver/GeoServer/2.17.2/geoserver-2.17.2-bin.zip
[root@test ~]# ls
anaconda-ks.cfg geoserver-2.17.2-bin.zip

3.解压下载好的GeoServer安装包到指定目录


建议的位置为/usr/share/geoserver

[root@test ~]# yum search unzip
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.aliyun.com
================================ N/S matched: unzip =================================
unzip.x86_64 : A utility for unpacking zip files
[root@test ~]# yum -y install unzip
[root@test ~]# mkdir /usr/share/geoserver     //建议的位置为/usr/share/geoserver。
[root@test ~]# unzip geoserver-2.17.2-bin.zip -d /usr/share/geoserver/
[root@test ~]# ll -h /usr/share/geoserver/
总用量 268K
drwxr-xr-x. 2 root root   82 7月 22 09:53 bin
drwxr-xr-x. 14 root root 4.0K 7月 22 09:53 data_dir
drwxr-xr-x. 2 root root 276 5月 19 15:23 etc
drwxr-xr-x. 2 root root 4.0K 7月 22 09:53 lib
drwxr-xr-x. 2 root root   98 7月 22 09:53 license
drwxr-xr-x. 2 root root   24 5月 19 15:23 logs
drwxr-xr-x. 2 root root 173 5月 19 15:23 modules
-rw-r--r--. 1 root root 84K 7月 20 02:12 NOTICE.md
-rw-r--r--. 1 root root 423 5月 19 15:23 README.txt
drwxr-xr-x. 2 root root   30 5月 19 15:23 resources
-rw-r--r--. 1 root root 3.9K 7月 20 02:12 RUNNING.txt
-rw-r--r--. 1 root root 2.0K 5月 19 15:23 start.ini
-rw-r--r--. 1 root root 157K 5月 19 15:23 start.jar
-rw-r--r--. 1 root root 333 7月 22 09:44 VERSION.txt
drwxr-xr-x. 3 root root   23 7月 22 09:53 webapps

4.添加环境变量以保存GeoServer的位置

[root@test ~]# echo "export GEOSERVER_HOME=/usr/share/geoserver" >> /etc/profile
[root@test ~]# source /etc/profile
[root@test ~]# cat /etc/profile | tail -2
unset -f pathmunge
export GEOSERVER_HOME=/usr/share/geoserver

5.使自己成为geoserver文件夹的所有者

[root@test ~]# chown -R root:root /usr/share/geoserver/
[root@test ~]# ll /usr/share/geoserver/
总用量 268
drwxr-xr-x. 2 root root     82 7月 22 09:53 bin
drwxr-xr-x. 14 root root   4096 7月 22 09:53 data_dir
drwxr-xr-x. 2 root root   276 5月 19 15:23 etc
drwxr-xr-x. 2 root root   4096 7月 22 09:53 lib
drwxr-xr-x. 2 root root     98 7月 22 09:53 license
drwxr-xr-x. 2 root root     24 5月 19 15:23 logs
drwxr-xr-x. 2 root root   173 5月 19 15:23 modules
-rw-r--r--. 1 root root 85824 7月 20 02:12 NOTICE.md
-rw-r--r--. 1 root root   423 5月 19 15:23 README.txt
drwxr-xr-x. 2 root root     30 5月 19 15:23 resources
-rw-r--r--. 1 root root   3945 7月 20 02:12 RUNNING.txt
-rw-r--r--. 1 root root   1971 5月 19 15:23 start.ini
-rw-r--r--. 1 root root 160629 5月 19 15:23 start.jar
-rw-r--r--. 1 root root   333 7月 22 09:44 VERSION.txt
drwxr-xr-x. 3 root root     23 7月 22 09:53 webapps

6.通过进入目录geoserver/bin并执行startup.sh脚本来启动GeoServer

[root@test ~]# cd /usr/share/geoserver/bin/
[root@test bin]# ls
shutdown.bat shutdown.sh startup.bat startup.sh
[root@test bin]# ./startup.sh
GEOSERVER DATA DIR is /usr/share/geoserver/data_dir
2020-08-13 20:39:16.372:INFO::main: Logging initialized @1692ms to org.eclipse.jetty.util.log.StdErrLog
2020-08-13 20:39:16.840:WARN:oejx.XmlConfiguration:main: Property 'jetty.port' is deprecated, use 'jetty.http.port' instead
...
[root@test ~]# ss -antulp | grep :8080     //新开命令窗口查询,因为执行start.sh脚本没放入后台,会一直占用终端窗口
tcp   LISTEN     0     50       :::8080                 :::*                   users:(("java",pid=5791,fd=313))

访问GeoServer


http://服务器IP地址:8080/geoserver


默认的用户名 :admin 和 密码:geoserver 登录后,进入主界面

10.png11.png

要关闭GeoServer,请关闭永久命令行窗口,或运行bin目录中的shutdown.sh文件。


卸载


如果正在运行,请先停止GeoServer。


删除安装GeoServer的目录。

相关文章
|
2月前
|
资源调度 JavaScript Linux
【Azure 应用服务】本地Node.js部署上云(Azure App Service for Linux)遇到的三个问题解决之道
【Azure 应用服务】本地Node.js部署上云(Azure App Service for Linux)遇到的三个问题解决之道
|
1月前
|
NoSQL 关系型数据库 Redis
mall在linux环境下的部署(基于Docker容器),Docker安装mysql、redis、nginx、rabbitmq、elasticsearch、logstash、kibana、mongo
mall在linux环境下的部署(基于Docker容器),docker安装mysql、redis、nginx、rabbitmq、elasticsearch、logstash、kibana、mongodb、minio详细教程,拉取镜像、运行容器
mall在linux环境下的部署(基于Docker容器),Docker安装mysql、redis、nginx、rabbitmq、elasticsearch、logstash、kibana、mongo
|
27天前
|
监控 Linux Shell
30 个实用的 Linux 命令贴与技巧,提升你的效率(附实战案例)
本文介绍了30个实用的Linux命令及其应用场景,帮助你提升命令行操作效率。涵盖返回目录、重新执行命令、查看磁盘使用情况、查找文件、进程管理、网络状态监控、定时任务设置等功能,适合各水平的Linux用户学习和参考。
|
1月前
|
NoSQL Linux Redis
Linux Redis 服务设置开机自启动
【9月更文挑战第2天】在 Linux 系统中,可使用两种方法设置 Redis 开机自启动:一是通过创建 `redis.service` 文件并利用 systemd 进行管理,包括定义服务参数和启动脚本;二是编辑 `/etc/rc.local` 文件,在其中添加启动命令。推荐使用 systemd 方法,因为它更符合现代 Linux 系统的设计理念。设置完成后,可通过 `sudo systemctl status redis.service` 检查服务状态。
|
8天前
|
Linux Python
linux之部署python环境&创建虚拟环境
linux之部署python环境&创建虚拟环境
|
9天前
|
编解码 Linux 开发工具
Linux平台x86_64|aarch64架构RTMP推送|轻量级RTSP服务模块集成说明
支持x64_64架构、aarch64架构(需要glibc-2.21及以上版本的Linux系统, 需要libX11.so.6, 需要GLib–2.0, 需安装 libstdc++.so.6.0.21、GLIBCXX_3.4.21、 CXXABI_1.3.9)。
|
2月前
|
存储 Linux 开发工具
【Azure App Service】本地Git部署Python Flask应用上云(Azure App Service For Linux)关键错误
【Azure App Service】本地Git部署Python Flask应用上云(Azure App Service For Linux)关键错误
|
2月前
|
JavaScript Linux 应用服务中间件
【Azure 应用服务】FTP 部署 Vue 生成的静态文件至 Linux App Service 后,访问App Service URL依旧显示Azure默认页面问题
【Azure 应用服务】FTP 部署 Vue 生成的静态文件至 Linux App Service 后,访问App Service URL依旧显示Azure默认页面问题
|
2月前
|
Linux 应用服务中间件 网络安全
【Azure 应用服务】查看App Service for Linux上部署PHP 7.4 和 8.0时,所使用的WEB服务器是什么?
【Azure 应用服务】查看App Service for Linux上部署PHP 7.4 和 8.0时,所使用的WEB服务器是什么?
|
2月前
|
开发框架 .NET Linux
【Azure 应用服务】 部署到App Service for Linux 服务的Docker 镜像,如何配置监听端口呢?
【Azure 应用服务】 部署到App Service for Linux 服务的Docker 镜像,如何配置监听端口呢?
下一篇
无影云桌面