[Geoserver-users] Installing Geoserver on Ubuntu

Hello everyone,

I’ve been trying to install Geoserver on Ubuntu for a few days without success. Here’s what I did so far:

. downloaded the binaries and extracted them to a directory under the java main;

. moved up the data_dir one level (following advice from a tutorial that makes sense);

. created the /etc/init.d/geoserver configuration file;

. edited the /geoserver/etc/jetty.xml file to change the default port to 8090 (I have Tomcat installed);

It seems simple but when I try to start Geoserver I get the following error:

export: 7: : bad variable name

The contents of the /etc/init.d/geoserver file:

#! /bin/sh -e

Author: Fernando Quadro

http://www.fernandoquadro.com.br/html/2009/05/14/instalando-o-geoserver-no-ubuntu/

export GEOSERVER_DATA_DIR = /usr/lib/jvm/Geoserver/data_dir

export GEOSERVER_HOME = /usr/lib/jvm/Geoserver/geoserver
export JAVA_HOME = /usr/lib/jvm/java-6-openjdk

case “$1” in
start)
/usr/lib/jvm/Geoserver/geoserver/bin/startup.sh
;;
stop)
/usr/lib/jvm/Geoserver/geoserver/bin/shutdown.sh
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
exit 1
;;

esac
exit 0

There seems to be somthing with the GEOSERVER_DATA_DIR variable. Any clues?

Thank you,

Luís

I don't know the specific answer to your problem, but I do fear that you may have problems with your choice of JRE/JDK. I believe OpenJDK is verboten at this point (Sun is the only officially supported one.) Anyone else, please correct me if I'm wrong here.

http://zerokspot.com/weblog/2008/08/18/geoserver-with-openjdk-on-ubuntu-i-guess-not/

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Luís de Sousa wrote:

Hello everyone,

I've been trying to install Geoserver on Ubuntu for a few days without success. Here's what I did so far:

. downloaded the binaries and extracted them to a directory under the java main;

. moved up the data_dir one level (following advice from a tutorial that makes sense);

. created the */etc/init.d/geoserver configuration file;

. edited the /geoserver/etc/jetty.xml file to change the default port to 8090 (I have Tomcat installed);

It seems simple but when I try to start Geoserver I get the following error:

export: 7: : bad variable name

The contents of the **/etc/init.d/geoserver file:

*#! /bin/sh -e
#
# Author: Fernando Quadro
#
# http://www.fernandoquadro.com.br/html/2009/05/14/instalando-o-geoserver-no-ubuntu/

export GEOSERVER_DATA_DIR = /usr/lib/jvm/Geoserver/data_dir
export GEOSERVER_HOME = /usr/lib/jvm/Geoserver/geoserver
export JAVA_HOME = /usr/lib/jvm/java-6-openjdk

case "$1" in
    start)
    /usr/lib/jvm/Geoserver/geoserver/bin/startup.sh
    ;;
    stop)
    /usr/lib/jvm/Geoserver/geoserver/bin/shutdown.sh
    ;;
    force-reload|restart)
        $0 stop
         $0 start
    ;;
    *)
    exit 1
    ;;

esac
exit 0

There seems to be somthing with the GEOSERVER_DATA_DIR variable. Any clues?

Thank you,

Luís

------------------------------------------------------------------------

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Luis

try removing the spaces around your = signs

export GEOSERVER_DATA_DIR=/usr/lib/jvm/Geoserver/data_dir

export GEOSERVER_HOME=/usr/lib/jvm/Geoserver/geoserver
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

regards

Simon

From: Luís de Sousa [mailto:luis.a.de.sousa@anonymised.com]
Sent: 14 January 2010 16:38
To: geoserver-users@lists.sourceforge.net
Subject: [Geoserver-users] Installing Geoserver on Ubuntu

Hello everyone,

I’ve been trying to install Geoserver on Ubuntu for a few days without success. Here’s what I did so far:

. downloaded the binaries and extracted them to a directory under the java main;

. moved up the data_dir one level (following advice from a tutorial that makes sense);

. created the /etc/init.d/geoserver configuration file;

. edited the /geoserver/etc/jetty.xml file to change the default port to 8090 (I have Tomcat installed);

It seems simple but when I try to start Geoserver I get the following error:

export: 7: : bad variable name

The contents of the /etc/init.d/geoserver file:

#! /bin/sh -e

Author: Fernando Quadro

http://www.fernandoquadro.com.br/html/2009/05/14/instalando-o-geoserver-no-ubuntu/

export GEOSERVER_DATA_DIR = /usr/lib/jvm/Geoserver/data_dir

export GEOSERVER_HOME = /usr/lib/jvm/Geoserver/geoserver
export JAVA_HOME = /usr/lib/jvm/java-6-openjdk

case “$1” in
start)
/usr/lib/jvm/Geoserver/geoserver/bin/startup.sh
;;
stop)
/usr/lib/jvm/Geoserver/geoserver/bin/shutdown.sh
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
exit 1
;;

esac
exit 0

There seems to be somthing with the GEOSERVER_DATA_DIR variable. Any clues?

Thank you,

Luís

This problem is not related to the JDK version (although the Sun JVM is highly recommended for production environment.)
The error message

export: 7: : bad variable name

indicates a problem with the shell script. I think that all you need to do is remove the spaces around the '=' operator (for all your assignments). For example:

GEOSERVER_DATA_DIR=/path/to/gs/data/

If you have spaces in the pathname, you'll also need to surround it with single or double quotes.

btw, I would recommend keeping the GeoServer binaries somewhere other than inside your JVM, for similar reasons to keeping your datadir outside of the GeoServer directory (makes it harder to destroy Geoserver as part of a JVM update).

Hope this helps,

--
David Winslow
OpenGeo - http://opengeo.org/

On 01/14/2010 11:45 AM, Mike Pumphrey wrote:

I don't know the specific answer to your problem, but I do fear that you may have problems with your choice of JRE/JDK. I believe OpenJDK is verboten at this point (Sun is the only officially supported one.) Anyone else, please correct me if I'm wrong here.

http://zerokspot.com/weblog/2008/08/18/geoserver-with-openjdk-on-ubuntu-i-guess-not/

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Luís de Sousa wrote:
   

Hello everyone,

I've been trying to install Geoserver on Ubuntu for a few days without
success. Here's what I did so far:

. downloaded the binaries and extracted them to a directory under the
java main;

. moved up the data_dir one level (following advice from a tutorial that
makes sense);

. created the */etc/init.d/geoserver configuration file;

. edited the /geoserver/etc/jetty.xml file to change the default port to
8090 (I have Tomcat installed);

It seems simple but when I try to start Geoserver I get the following error:

export: 7: : bad variable name

The contents of the **/etc/init.d/geoserver file:

*#! /bin/sh -e
#
# Author: Fernando Quadro
#
http://www.fernandoquadro.com.br/html/2009/05/14/instalando-o-geoserver-no-ubuntu/

export GEOSERVER_DATA_DIR = /usr/lib/jvm/Geoserver/data_dir
export GEOSERVER_HOME = /usr/lib/jvm/Geoserver/geoserver
export JAVA_HOME = /usr/lib/jvm/java-6-openjdk

case "$1" in
     start)
     /usr/lib/jvm/Geoserver/geoserver/bin/startup.sh
     ;;
     stop)
     /usr/lib/jvm/Geoserver/geoserver/bin/shutdown.sh
     ;;
     force-reload|restart)
         $0 stop
          $0 start
     ;;
     *)
     exit 1
     ;;

esac
exit 0

There seems to be somthing with the GEOSERVER_DATA_DIR variable. Any clues?

Thank you,

Luís

As a long time ubuntu java user, both dev boxes and servers, I'd say
you should never use the openjdk for anything. Not the browser
plugin, and certainly not for development or server hosting. Just
throwing that out there.

On Thu, Jan 14, 2010 at 11:56 AM, David Winslow <dwinslow@anonymised.com> wrote:

This problem is not related to the JDK version (although the Sun JVM is
highly recommended for production environment.)
The error message

export: 7: : bad variable name

indicates a problem with the shell script. I think that all you need to
do is remove the spaces around the '=' operator (for all your
assignments). For example:

GEOSERVER_DATA_DIR=/path/to/gs/data/

If you have spaces in the pathname, you'll also need to surround it with
single or double quotes.

btw, I would recommend keeping the GeoServer binaries somewhere other
than inside your JVM, for similar reasons to keeping your datadir
outside of the GeoServer directory (makes it harder to destroy Geoserver
as part of a JVM update).

Hope this helps,

--
David Winslow
OpenGeo - http://opengeo.org/

On 01/14/2010 11:45 AM, Mike Pumphrey wrote:

I don't know the specific answer to your problem, but I do fear that you may have problems with your choice of JRE/JDK. I believe OpenJDK is verboten at this point (Sun is the only officially supported one.) Anyone else, please correct me if I'm wrong here.

http://zerokspot.com/weblog/2008/08/18/geoserver-with-openjdk-on-ubuntu-i-guess-not/

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

Luís de Sousa wrote:

Hello everyone,

I've been trying to install Geoserver on Ubuntu for a few days without
success. Here's what I did so far:

. downloaded the binaries and extracted them to a directory under the
java main;

. moved up the data_dir one level (following advice from a tutorial that
makes sense);

. created the */etc/init.d/geoserver configuration file;

. edited the /geoserver/etc/jetty.xml file to change the default port to
8090 (I have Tomcat installed);

It seems simple but when I try to start Geoserver I get the following error:

export: 7: : bad variable name

The contents of the **/etc/init.d/geoserver file:

*#! /bin/sh -e
#
# Author: Fernando Quadro
#
#
http://www.fernandoquadro.com.br/html/2009/05/14/instalando-o-geoserver-no-ubuntu/

export GEOSERVER_DATA_DIR = /usr/lib/jvm/Geoserver/data_dir
export GEOSERVER_HOME = /usr/lib/jvm/Geoserver/geoserver
export JAVA_HOME = /usr/lib/jvm/java-6-openjdk

case "$1" in
start)
/usr/lib/jvm/Geoserver/geoserver/bin/startup.sh
;;
stop)
/usr/lib/jvm/Geoserver/geoserver/bin/shutdown.sh
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
exit 1
;;

esac
exit 0

There seems to be somthing with the GEOSERVER_DATA_DIR variable. Any clues?

Thank you,

Luís

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
--------------------
Kevin Galligan
www.kagii.com

First of all thanks to everyone for the replies. The problem was indeed the spaces in the config file. I copied it from a blog where it was posted as an image.

I’ll also follow the advice and move the binaries outside the jvm root. For now OpenJDK isn’t giving me trouble, so I’ll let it be.

Thank you once more,

Luís

Luís de Sousa ha scritto:

First of all thanks to everyone for the replies. The problem was indeed the spaces in the config file. I copied it from a blog where it was posted as an image.

I'll also follow the advice and move the binaries outside the jvm root. For now OpenJDK isn't giving me trouble, so I'll let it be.

You're just experiencing 4 times slower WMS responses, but it should work.
See my "GeoServer in production" presentation, slide 27:
http://download.osgeo.org/osgeo/foss4g/2009/SPREP/3Fri/Parkside%20Auditorium/1300/fri%20paud%201400%20aime.odp

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.