1.下载geoserver安装包 GeoServer
2.上传至Linux服务器
3.设置修改geoserver端口
编辑start.ini 文件
4.设置环境变量 注意:安装geoserver必须配置Java环境,jdk必须是大于1.8,(我用过1.7做过发现实验不行,如果有兴趣可以自己尝试)
vi /etc/profile 编辑文件命令
JAVA_HOME=/usr/java/jdk1.8.0_121
JRE_HOME=/usr/java/jdk1.8.0_121/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
export GEOSERVER_HOME=/devvdb/geoserver-2.21.1
source /etc/profile 编辑完后重新加载配置文件
5.查看端口8090 (自己设定的geoserver端口)是否开启,保证端口能用
netstat -anp 查看端口是否开放
开启端口
iptables -I INPUT -p tcp --dport 8090 -j ACCEPT
6. 启动geoserver
进入bin目录下,输入 ./startup.sh 命令启动geoserver
7.关闭客户端,让geoserver继续运行命令
nohup /devvdb/geoserver-2.21.1/bin/startup.sh &
8.设置开机自启动
vi /etc/rc.local
[root@localhost etc]# cat rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
cd /devvdb/geoserver-2.21.1/bin
nohup ./startup.sh &