Surveying, Mapping and GIS

Exploring all aspects of mapping and geography, from field data collection, to mapping and analysis, to integration, applications development and enterprise architecture...

  • Geospatial Technology, End to End...

    Exploring all aspects of mapping and geography, from field data collection, to mapping and analysis, to integration, applications development, enterprise architecture and policy
Showing posts with label WebGIS. Show all posts
Showing posts with label WebGIS. Show all posts

Building a Headless Linux GeoServer Box

Posted by Dave Smith On 8/30/2009 08:40:00 AM 17 comments

I recently inherited some older machines and, to support some ongoing in-house experimentation I've been involved in, set them up as quick-and-dirty servers to help serve up geospatial data services - the approach I took was to build what are essentially minimal machines running linux in command-line mode, and then load GeoServer on them to serve the data - As I haven't blogged in a while, a friend suggested that posting a quick description of the mechanics of this might be a good thing to share for folks who haven't dipped their toes into Linux much.

As a disclaimer, I do not claim to profess guruhood when it comes to Linux or the other packages, this is not necessarily warranted to be a "hardened-and-tweaked" system for production, it's just some very quick and dirty steps toward standing up a headless Linux-based GeoServer instance. Note that this uses the default Jetty install - some folks prefer to run it under Tomcat, which is a different path.

So, I started out with the "minimal install CD" for Ubuntu 9.04, available here:

https://help.ubuntu.com/community/Installation/MinimalCD



Select a package appropriate for the CPU you are using - in my case, I chose Ubuntu 9.04 for 32-bit PC.

Burn the ISO and follow the prompts to install from the text-based installer as command-line interface (CLI). I essentially went with the defaults. You will want to have the machine connected to the internet so that it can identify and set up the network connection and grab any files needed during install.

Once you've installed a minimal version of Linux, you will be ready to configure and install the other goodies.


For remote administration, you may want to install OpenSSH- http://www.openssh.com/



The step for doing this is simple:

Log in to your Linux machine, and use the following command:

sudo apt-get install openssh-server

This will download and install the OpenSSH package. For folks new to Linux, sudo tells it to use superuser privileges and permissions, and will ask for the root password used when you installed Linux. apt-get install uses the Advanced Package Tool to search for, retrieve and install software packages for Linux - this makes installation of much standard software in Linux easy.

For remote administration, you'll want to know how to reach your machine on the network - you can get the IP address by using the ifconfig command, which will give results something like this:



If you use Windows as a primary OS for your other work, you can then access the box from a Windows machine using an SSH client. I usually use PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html



From there, you can install PuTTY on your windows machine and then access the Linux box via command-line interface remotely for administration.

Plug in the IP address you got above:



and voila - you should be presented with a login screen for your linux box:



Tools like PuTTY are a great asset when it comes to administering boxes.

Side trip into remote administration aside, on to the REAL stuff: Installing GeoServer.

As a prerequisite, you will need to install the Java JDK - the GeoServer install page gives some recommendations, and here's how you would do it from the command line:

sudo apt-get install sun-java6-jdk

Next, you will need to do some configuration of the JDK

Define the default Java to use:
sudo update-java-alternatives -s java-6-sun

And set the JAVA_HOME directory - this is doable in a number of ways, you may or may not want to define it in /etc/environment. I really like 'nano' as an editor for command-line Linux environments and it comes pre-installed in the minimal Ubuntu 9.04 version.

sudo nano /etc/environment

Again 'sudo' makes sure you have an appropriate privilege level to write the changes.

In nano, you can navigate around in the file using your arrow keys. Insert the following:

JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.14/


nano is intuitive and easy to use, following the commands along the bottom of the screen, e.g. ctrl-O to write changes, ctrl-X to exit.

Now on to the fun stuff - installing GeoServer.

GeoServer isn't available via apt - so you will need to download and unzip it to install it.

To be able to use ZIP archives, sudo apt-get install unzip will provide that capability. Next, you can download GeoServer.

Decide where you want to put it - some folks put it in /usr/local, or /usr/share, or if you are just experimenting, you could even leave it in your home directory - if putting it /usr/share in you would cd /usr/share

To download it, the download location given on the GeoServer page is http://downloads.sourceforge.net/geoserver/geoserver-1.7.6-bin.zip

Thus, to download it, use wget -

sudo wget http://downloads.sourceforge.net/geoserver/geoserver-1.7.6-bin.zip

Then, unzip it

sudo unzip geoserver-1.7.6-bin.zip
and you should see the files extracting into a geoserver-1.7.6 folder.

Depending on where you put it and privileges held by the account you are using, you may also need to ensure you have ability to access and run GeoServer and that GeoServer can create any files it needs.

chown will change ownership, using -R makes it recursive through subfolders and files:

sudo chown -R geoserver_username geoserver-1.7.6 would change all files and directories to be owned by the user specified (geoserver_username as a placeholder).

You can list files using ls and navigate directories using cd.

You may or may not also then want to configure directories, such as defining the location of your GeoServer installation directory, e.g. GEOSERVER_HOME="/usr/share/geoserver-1.7.6" - again, you could do this using nano to edit /etc/environment - and there are also plenty of other ways to do this. You could also define other parts of GeoServer, such as GEOSERVER_DATA_DIR at this point as well - consult the GeoServer docs for details there... http://docs.geoserver.org/1.7.x/en/user/

Pretty much ready to run now... cd to the /bin directory under your geoserver install, e.g. cd /usr/share/geoserver-1.7.6/bin" and launch the startup script sh startup.sh and voila... You will see some program output scroll by,
ultimately resulting with an output line like

[main] INFO org.mortbay.log - Started SelectChannelConnector@0.0.0.0:8080 - this should tell you that the GeoServer Jetty container is up and listening for connections on 8080.

Now, open a browser, point it to your machine's IP address and enter it, pointing to port 8080 and the geoserver instance, e.g. http://192.168.2.125:8080/geoserver/ and after an initial "loading" screen you should get the GeoServer web interface:



And you are off to the races... Confirm that it works via the demos:

OpenLayers NYC Tiger map

Again, this is just meant to be a quick-and-dirty guide - enough to make even someone with minimal Linux experience armed and dangerous - and from here, there are many tweaks and customizations that can be made, such as optimizing performance, hardening and security and so on (there are plenty of discussions around the web and on listservs regarding this)- but I figured, I'd at least share this as a quick start for anyone looking to play with GeoServer in a minimal Linux environment...

ESRI DevSummit 07 Blogosphere Wrapup

Posted by Dave Smith On 3/29/2007 04:04:00 PM 1 comments

Though I wasn't able to attend ESRI DevSummit 07, I did get some good feedback - my own people report on the continued push toward web-based GIS and server-based GIS and SOA, with SOAP, REST, JavaScript and AJAX APIs being made available, along with tremendous demand from the .NET developer community.

I also scoured the blogosphere and scavenged together a set of posts and resources - dig through these, as there are copious notes, slides and podcasts to be had.


In no particular order:



Very Spatial 3/28: Dev Summit Overview "VSTV Episode 12": http://veryspatial.com/?p=1486

Very Spatial 3/28: Daily Podcasts:
http://veryspatial.com/?p=1485

Very Spatial 3/26: Daily Podcast talking to DevSummit Attendees:
http://veryspatial.com/?p=1478

Very Spatial 3/24: Standards and Interoperability Podcast:
http://veryspatial.com/?p=1475

Very Spatial 3/23: ArcWeb Services Podcast:
http://veryspatial.com/?p=1473

Very Spatial 3/22: ESRI Support Team Podcast:
http://veryspatial.com/?p=1471

Very Spatial 3/22: Keynote Session Podcast:
http://veryspatial.com/?p=1468

Very Spatial 3/21: Keynote Comments:
http://veryspatial.com/?p=1466

Very Spatial 3/21: Gartner Keynote:
http://veryspatial.com/?p=1463

Very Spatial 3/20: Plenary Session Podcast:
http://veryspatial.com/?p=1462

Very Spatial 3/20: Plenary Part 2:
http://veryspatial.com/?p=1458

Very Spatial 3/20: Plenary Session:
http://veryspatial.com/?p=1457

Very Spatial 3/18: Preconference Podcast:
http://veryspatial.com/?p=1453




Steve's Little World 3/28: On participating in a VS podcast: http://thesteve0.wordpress.com/2007/03/28/if-you-want-to-hear-what-i-sound-like/

Steve's Little World 3/23: Final Day: http://thesteve0.wordpress.com/2007/03/23/final-day-and-still-in-palm-springs/

Steve's Little World 3/21: GeoDB Replication:
http://thesteve0.wordpress.com/2007/03/21/geodb-replication/

Steve's Little World 3/21: Web Service API to ArcGIS Server:
http://thesteve0.wordpress.com/2007/03/21/web-service-api-to-server/

Steve's Little World 3/21: Turbocharging GeoDB interactions:
http://thesteve0.wordpress.com/2007/03/21/turbocharging-geodb-interactions/

Steve's Little World 3/21: .NET and Java SIG:
http://thesteve0.wordpress.com/2007/03/21/net-sig/

Steve's Little World 3/21: The Gartner Talk:
http://myesri.blogspot.com/2007/03/update-from-dev-summit.html

Steve's Little World 3/20: Enterprise Applications with the GeoDB:
http://thesteve0.wordpress.com/2007/03/20/enterprise-applications-with-the-geodatabase/

Steve's Little World 3/20: .NET Mobile ADF:
http://thesteve0.wordpress.com/2007/03/20/net-mobile-adf/

Steve's Little World 3/20: .NET Engine Application Development:
http://thesteve0.wordpress.com/2007/03/20/net-engine-application-development/

Steve's Little World 3/20: First Night:
http://thesteve0.wordpress.com/2007/03/20/going-to-the-dev-summit-and-first-night/

Steve's Little World 3/20: Plenary Session:
http://thesteve0.wordpress.com/2007/03/20/plenary-session/


ESRI News Feed 3/15: ArcGIS Explorer Best Practices Podcast:
http://www.esri.com/news/podcasts/audio/speaker/devsummit07-mark-dara.mp3

ESRI News Feed 3/14: ArcGIS 9.2 3D Visualization Podcast:
http://www.esri.com/news/podcasts/audio/speaker/devsummit07-tam-nathan.mp3


Dot Without A Net 3/24: Dev Summit Day 3 Overview:
http://priour.wordpress.com/2007/03/24/dev-summit-final-day/

Dot Without A Net 3/22: Day 2:
http://priour.wordpress.com/2007/03/22/dev-summit-continues/

Dot Without A Net 3/22: Day 1:
http://priour.wordpress.com/2007/03/22/thoughts-on-dev-summit/


It Is What It Is 3/25: .NET versus Java:
http://www.palladiumconsulting.com/blog/sebastian/2007/03/who-was-at-esri-developer-summit-not.html

It Is What It Is 3/21: SQL API and Data Access:
http://www.palladiumconsulting.com/blog/sebastian/2007/03/esri-sde-stgeometry-and-re-unification.html

It Is What It Is: 3/21: It's not Crap Anymore:
http://www.palladiumconsulting.com/blog/sebastian/2007/03/esri-developer-summit-2007-its-not-crap.html


Rise and Shout 3/29: Developer Summit slides are now available on EDN:
http://myesri.blogspot.com/2007/03/dev-summit-slides-on-edn.html

Rise and Shout 3/26: Dev Summit Summary:
http://myesri.blogspot.com/2007/03/dev-summit-summary.html

Rise and Shout 3/21: Update:
http://myesri.blogspot.com/2007/03/update-from-dev-summit.html

Rise and Shout 3/20: Plenary Session:
http://myesri.blogspot.com/2007/03/arcgis-server-takes-stage-author-server.html

Rise and Shout 3/20: Dev Summit:
http://myesri.blogspot.com/2007/03/2nd-annual-esri-developer-summit.html

Rise and Shout 3/19: It's Time:
http://myesri.blogspot.com/2007/03/it-time.html


Dave Bouwman 3/22: Dev Summit Wrapup and SIG presentation:
http://blog.davebouwman.net/2007/03/23/DevSummitWrapup...

Dave Bouwman 3/20: Plenary Session:
http://blog.davebouwman.net/2007/03/20/DevSummitPlenarySession...

Dave Bouwman 3/14: Blogger Meetup:
http://blog.davebouwman.net/2007/03/15/DevSummitBloggerMeetup...


James Fee 3/25: Dev Summit ArcGIS Server Code Challenge Results:
http://www.spatiallyadjusted.com/2007/03/25/arcgis-server-code-challenge-results/

James Fee 3/21: .NET SIG:
http://www.spatiallyadjusted.com/2007/03/21/esri-dev-summit-net-sig/

James Fee 3/20: Dinner:
http://www.spatiallyadjusted.com/2007/03/20/esri-developer-summit-2007-dinner/


The Unofficial ArcBlog 3/25:
http://gis.typepad.com/blog/2007/03/esri_2007_devel.html


The Memory Leak 3/23: Defense SIG:
http://ambergis.wordpress.com/2007/03/23/esri-dev-summit-defense-sig/

The Memory Leak 3/21: ArcGIS GeoProcessing: http://ambergis.wordpress.com/2007/03/21/esri-dev-summit-ags-geoprocessing/

The Memory Leak 3/21: DevSummit Day 1: http://ambergis.wordpress.com/2007/03/21/esri-dev-summit-day-1/



The ArcPad Team: 3/28: On participating in a VS podcast: http://arcpadteam.blogspot.com/2007/03/1152-minutes-of-fame-its-very-spatial.html

The ArcPad Team: 3/22: Hello: http://arcpadteam.blogspot.com/2007/03/esri-developer-summit.html


Many thanks and kudos to all who shared with those of us who couldn't be there. I am certain I probably missed a few, but this provides an excellent roundup. Also, there is a post from Directions Magazine 3/22: Directions Magazine didn't attend, but nonetheless deserving special mention - Adena also pulled together an excellent collection of articles and items: http://www.directionsmag.com/article.php?article_id=2435&trv=1

HostGIS Linux

Posted by Dave Smith On 3/20/2007 02:13:00 PM 1 comments

I just discovered a great Linux distribution called HostGIS - it comes ready to run MapServer and a whole suite of other goodies, right out of the box.

I went to the HostGIS site, and within about 20 minutes, had downloaded it, loaded it up on MS VirtualPC, and had it up and running:





It comes complete with OpenLayers and TileCache from our friends at MetaCarta, MySQL, PostgreSQL, and a few other add-ons and goodies that I am not as familiar with, such as Map-Fu.

While I am usually spoiled with plenty of ESRI tools, this certainly provides a refreshing alternative for projects without an ESRI budget...

Search