Install GeoServer On Linux
Install GeoServer On Linux
BASIC
1. Download geoserver "Platform Independent Binary"
2. Create folder:
/opt/geoserver/
3. Create folder:
/etc/default/geoserver
10. Create init scripts file: /etc/init.d/geoserver , and then copy paste text on Appendix -
Geoserver init script into that file.
11. Make that file executable:
$ cd /tmp
$ wget http://download.java.net/media/jai/builds/release/1_1_3/jai-1_1_3-lib-linux-
amd64.tar.gz && \
gunzip -c jai-1_1_3-lib-linux-amd64.tar.gz | tar xf - && \
mv /tmp/jai-1_1_3/lib/*.jar $JAVA_HOME/jre/lib/ext/ && \
mv /tmp/jai-1_1_3/lib/*.so $JAVA_HOME/jre/lib/amd64/ && \
rm /tmp/jai-1_1_3-lib-linux-amd64.tar.gz && \
rm -r /tmp/jai-1_1_3
$ cd /tmp
$ wget http://download.java.net/media/jai-imageio/builds/release/1.1/jai_imageio-
1_1-lib-linux-amd64.tar.gz && \
gunzip -c jai_imageio-1_1-lib-linux-amd64.tar.gz | tar xf - && \
mv /tmp/jai_imageio-1_1/lib/*.jar $JAVA_HOME/jre/lib/ext/ && \
mv /tmp/jai_imageio-1_1/lib/*.so $JAVA_HOME/jre/lib/amd64/ && \
rm /tmp/jai_imageio-1_1-lib-linux-amd64.tar.gz && \
rm -r /tmp/jai_imageio-1_1
Optional cleanup
Once the installation is complete, you may optionally remove the original JAI files from the
GeoServer instance:
jai_core-x.y.z.jar
jai_imageio-x.y.jar
jai_codec-x.y.z.jar
PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="GeoServer daemon"
NAME=geoserver
#JAVA_HOME=/usr/lib/jvm/java-6-sun
#JAVA_OPTS="-Xms128m -Xmx512m"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
if [ -z $MARLIN_JAR]; then
MARLIN_JAR=`find $GEOSERVER_HOME/webapps -name "marlin*.jar" | head -1`
fi
MARLIN_ENABLER="-Xbootclasspath/a:$MARLIN_JAR -
Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"
DAEMON="$JAVA_HOME/bin/java"
DAEMON_ARGS="$JAVA_OPTS $MARLIN_ENABLER $DEBUG_OPTS -
DGEOSERVER_DATA_DIR=$GEOSERVER_DATA_DIR -Djava.awt.headless=true -jar start.jar"
do_start(){
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
do_stop(){
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
[ "$VERBOSE" != no ] && log_daemon_msg "JAVA_HOME location: $JAVA_HOME"
[ "$VERBOSE" != no ] && log_daemon_msg "GEOSERVER_DATA_DIR location:
$GEOSERVER_DATA_DIR"
[ "$VERBOSE" != no ] && log_daemon_msg "MARLIN: $MARLIN_ENABLER"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac