如何在macOS下安装geoserver
macOS 下的编译包
如果是使用安装文件,请查看官网文档,如果想要部署在已有的tomcat服务下,请查看网页压缩包章节。 Web archive.
An alternate way of installing GeoServer on OS X is to use the platform-independent binary. This version is a GeoServer web application bundled inside Jetty, a lightweight and portable application server. It has the advantages of working very similarly across all operating systems and is very simple to set up.
Installation
-
确认已经安装了JRE环境. GeoServer 需要 Java 8 环境, and the JRE supplied by OS X is not sufficient. For more information, please see the instructions for installing Oracle Java on OS X.
Note
注意:Java 9 目前还不支持!
For more information about Java and GeoServer, please see the section on Java Considerations.
-
在官方网站下载页面 GeoServer Download page.
-
选择稳定版本 Stable.
-
选择编译包选项.
-
下载后解压缩到你想要使用的位置
建议使用该位置:
/usr/local/geoserver
. -
通过命令行添加环境变量:
echo "export GEOSERVER_HOME=/usr/local/geoserver" >> ~/.profile . ~/.profile
-
通过命令行给文件夹添加用户权限:
sudo chown -R <USERNAME> /usr/local/geoserver/
其中
USER_NAME
是当前用户的名称 -
进入到安装目录,
geoserver/bin
并执行startup.sh 脚本:
cd geoserver/bin sh startup.sh
Warning
If you encounter the following error during startup, you may have some invalid JAI jars from the default Mac Java install:
java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI
To fix this error, locate your Java extensions folder (Usually
/System/Library/Java/Extensions
and/or~/Library/Java/Extensions
), and delete the following jars:jai_codec-1.1.3.jar jai_core-1.1.3.jar jai_imageio-1.1.jar
If you have upgraded your OS from an older version, you may not have permission to delete these jars. In this case, you will first need to disable System Integrity Protection.
-
打开浏览器输入网址:
http://localhost:8080/geoserver
.
如果能够看到geoserver的logo,说明安装成功。
关闭 GeoServer, 可以通过关闭当前命令行窗口,也可以通过执行bin文件夹下的 shutdown.sh
脚本.
卸载:
- 如果geoserver正在运行,请先停止。
- 删除Geoserver所在的目录文件夹。
原文地址:https://docs.geoserver.org/stable/en/user/installation/osx_binary.html