Thursday, March 31, 2011


OK, if you need to install FTP here is a quick and totally insecure way to do it!! I am just going to get the most simple FTP server running here, but you will probably want to do something to secure it better at some point. Just use OpenSSH if you simply need to move files over from development to production.

$ sudo apt-get install vsftpd
Configure it's configuration file located at /etc/vsftpd.conf
$ sudo restart vsftpd


Well, we need to be able to connect to this new server and we want to do everything from the command-line, so we need to install an SSH server. I am going to use OpenSSH because it just works and is very simple. You can do a lot with OpenSSH including connect to the terminal and transfer files over SFTP, and all very securely. With this there is no good reason to have an FTP server installed.

Install the server...
sudo apt-get install openssh-server
Backup the configuration file...
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
Configure the server to make it a bit more secure by modifying the file located at /etc/ssh/sshd_config. Change it to something non-standard like...port 2222 if you like, but this is not really necessary since it is already secure...but may prevent denial of service types of attacks...

Restart the server...
sudo /etc/init.d/ssh restart
Now try connecting from another computer using the following command from a terminal...
ssh <username>@<ipaddress>

Now, if you want to log in to your remote servers using ssh and not have to bother entering a password, you can use a private / public key to set that up. Below I have created a set of steps starting with what you do from the local computer...

Local Computer:

1. Set the appropriate ownership for the entire ~/.ssh directory and do it recursively
sudo chown -R user:group ~/.ssh

2. Set the appropriate permissions for ~/.ssh/known_hosts so ssh can write to it.
sudo chmod ~/.ssh/known_hosts 700

3. Now run these commands to generate the private/public keys and to put the public key on the remote computer. Just accept all the defaults (leave blank and press enter) for the first command.
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/ user@computer
Remote Computer:
Run this command on the client as well to make sure the key is now managed by the ssh-agent
On the remote computer you just need to make sure that the configuration file used by the ssh deamon (/etc/sshd/sshd_config) has a couple of lines added or uncommented.
RSAAuthentication yes
PubkeyAuthentication yes

After doing this restart the ssh service and you should be able to connect from the local computer without needing to enter your password. You can repeat these step for another remote computer, but of course you do not need to use the ssh-keygen command because you already have private/public keys generated from running it the first time.


Wednesday, March 30, 2011


Ok, now that we have installed Ubuntu Server 10.04, we need to do a bit of configuration. Let's go ahead and do a few things to make the server accessible over the internet.  There are many ways to do this so I will just share with you what I do to host my servers.

You could set your server up on a computer that is co-located, or dedicated at a professional hosting company, or perhaps you just want to run these servers from a computer at your house. I run my servers from my house, but with business class internet service and a few static IP addresses. If you do not have a static IP address available, you can still us an internal LAN IP address (internal network specific IP address) and use port forwarding on you router to let the outside world access services on your Ubuntu Server. You could even use one of the many services like to simulate a global static IP address. Perhaps this is worth an entire blog entry for later, so lets just continue.

Modify the network settings in the file located at /etc/network/interfaces to suite your situation.
auto eth0
iface eth0 inet static
Set the DNS settings if they are not already set in the file located at /etc/resolv.conf with...
Refresh and check the ethernet settings using the commands below.
$ sudo /etc/init.d/networking restart
$ ifconfig
If you are using VirtualBox to set this up, make sure to setup your guest VM to use the Bridged Network connection so the Ubuntu Server can be reached at the static IP address you assigned it.

So now the computer should be accessible over the internet, but there is almost nothing running on this bare bones server, so we need to install some software next.

Tuesday, March 29, 2011


Canonical Ltd. make it so easy to install a bare bones Ubuntu Server system. Go ahead and download the .iso file from here... if you have not already. There are detailed instructions on this page for downloading, burning to CD, and installing, so go ahead and follow those instructions or follow the screen shots below.

I install the very least amount of software at first in order to take a snapshot of the system in it's simplest form. Then we can build it up from there. Here are the steps you will see while installing Ubuntu Server...

Step 1 (Choose Language)

Step 2 (Start Install)

Step 3 (Installation Language)

Step 4 (Country)

Step 5 (Automatically Detect Keyboard)

Step 6 (Origin of the Keyboard)

Step 7 (Keyboard Layout)

Step 8 (Host Name)

Step 9 (Timezone)

Step 10 (Partition Guide)

Step 11 (Disk to Partition)

Step 12 (Confirm Write to Partition)

Step 13 (Full User Name)

Step 14 (User Account Name)

Step 15 (Password)

Step 16 (Confirm Password)

Step 17 (Encrypt Home Directory)

Step 18 (HTTP Proxy Server)

Step 19 (Automatic Updates)

Step 20 (Software Installs)

Step 21 (Configure Grub)

Step 22 (Installation Complete)

Step 23 (First Reboot)

Update all the software packages and then reboot with...
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo shutdown -h now

Monday, March 28, 2011


I run all of my development, test, and production computers as virtual machines using the free / open source virtualization package called VirtualBox OSE. You can download it from here... if you would like. VirtualBox is fantastic open source software that you can run on any host operating system. I do this primarily so I can take periodic snapshots of my operating system and role back to a previous state if it crashes or I just dirty up the virtual machine. There are many reasons to use virtualization.

If you are running Ubuntu Desktop 10.04 on your host computer and want to use VirtualBox to virtualize the Ubuntu Server operating system that we are going to build, then you can follow these instructions. Or, you can just skip this blog entry and go to the next one about installing Ubuntu Server like normal on a physical machine. Below is a screen shot of the Applications > Ubuntu Software Center window. Open this window and search for "VirtualBox" and install it like you see below.

Then you can start VirtualBox from Applications > Accessories >VirtualBox OSE. You will see the window below, but will not have any VMs of course. Go ahead and create a new virtual machine using the "New" button and step through the wizard.

Once you have created the new VM, you can go into the storage item and add set the CDROM to point to your Ubuntu Server .ISO file so it will begin the installation process the first time you start the VM. I recommend doing this because it works well and allows you to avoid burning a CD with the operating system on it.

Now you are ready to install the Ubuntu Server 10.04 operating system.

Sunday, March 27, 2011

The Plan

I guess the best place to start is with a plan, so here it is...

I am going to write a bunch of blogs over the next few days / weeks explaining how I built a nice little Linux GIS web server. I am going to build it with the technologies I have become familiar with over the last couple of years and cover each technology as a separate blog entry. Please give me some feedback or corrections so we can document these steps together. I will update the blog entries with any good ideas or corrections.

Since professionally I'm primarily a Microsoft developer myself, the selection of technologies may not satisfy the most hardcore purist Linux geek, but that is not my goal. I want to lay out a solution that anyone (that is relatively comfortable with linux) can put together to create a good platform for GIS web no cost.

I have been using the following technologies for a little while now (maybe a few years). Until recently I have been developing my applications using Ubuntu Desktop for both development and production. It has been nice using the Gnome GUI, but now I am going to try my hand at building this as a bare bones headless Ubuntu Server strictly from the terminal. Oh, and I am creating this system as a VirtualBox guest operating system on an Ubuntu Desktop 10.04 host operating system. VirtualBox and virtualization in general is a great tool for doing this kind of experimentation so you can role back if you make mistakes. Here is the set of snapshots for the system we are building...

So, this is the system we are going to build and document in the coming blog entries...

VirutalizationVirtualBox OSEv3.1.6_r59338
Operating SystemUbuntu Serverv10.04 LTS
Web ServerApache2v2.2.14-5ubuntu8.4
Spatial Database Ext.PostGISv1.4.0-2
Mapping/GIS ServerGeoserverv2.0.3
Client GIS APIOpenLayersv?

The version numbers were obtained using...
$ sudo dpkg -s <packagename> | more 
I think this is a great little system and I am currently running these technologies to host a couple of websites with GIS functionality. I am amazed at the things you can do with a completely free solution like this. The next blog entries will cover each of these technologies.

Again, you may want to look at OpenGeo Suite if you want to do a lot of what I am going to cover here, but in a much quicker and easier way. You may not learn as much, but can get started in just a few minutes.


    Friday, March 25, 2011

    Hello World

    I have been building GIS software solutions for over 10 years now and have never blogged about it. I don't think I have ever blogged about anything technology related actually. Not sure why...probably just too tired at the end of the day and want to think about other things (I am pretty damn tired right now and not sure I want to even do this!!) Well I'm not exactly going to start blogging about what I do for a living now. As interesting as it can be, 8 hours a day is enough for me. I am going to blog about the free / open source GIS software that I don't use professionally for building GIS solutions.

    Most professional GIS software developers (including myself) use software components, built by a fine company called ESRI, as a starting point for building their solutions. ESRI builds great software, but it is very expensive and is primarily built to run on the Windows operating systems... which is also very expensive software. You usually need a database, and most people naturally choose a Microsoft database like SQL Server...which is also very expensive. The price tag for running a GIS solution can become huge before you even start to develop your custom software solution on top of it.

    For the last couple of years I have been playing around with free / open source technologies that one can use to build GIS software solutions as well. I guess the community calls it FOSS4G (Free Open Source 4 GIS). I am starting this blog to document my experiments using these opens source equivalents to ESRI software. I am not exactly sure why I have been so drawn to these technologies lately. It is probably because of the global cooperative effort and the more idealistic approach to building open source technologies. It seems somehow very pure and honest. Some of these technologies are really very good as well...if not better than their commercial counterparts. I think taking the capitalistic motivation out of the equation can result is some really great software.

    So here is the goal of this blog. I want to document the process of building a completely free / open source platform for creating web-based GIS software solutions. Most of the proprietary GIS software products out there are amazingly expensive and it is nice to know that there are a number of free community driven solutions that work well. The problem is that the information on how to use them is sometimes hard to find or laden with unnecessarily technical jargon. I am hoping to document a few things that may help others get started using these technologies.

    Luckily there are a number of technologies in the open source world that many seem to agree on as the best in class. I am going to blog about the following technologies and try to explain how to set them all up in a simple and reproducible way, and how to use them to build great GIS software solutions. I am not a master of any of these technologies but hopefully I will learn a lot more going through this process.
    • Linux
    • Apache
    • C# / Mono
    • PostgreSQL / PostGIS
    • Geoserver
    • OpenLayers
    • etc
    On last thing, for most of my career I have been a Microsoft developer and have become very comfortable using C# / .Net to build applications.  Because of this I have been drawn to Mono so I can continue to use my experience with the C# language and .Net framework but on the Linux operating system. I will probably spend a lot of time covering topics related to Mono with C# as the language of choice...because it makes a lot of sense in my case, with so many years of experience invested. Many of the Open Source GIS software available is written in C, C++, Java, and PHP, so this will make things a bit interesting and challenging. I'll probably cover the use of some other languages as well though.

    Ok, I am really tired of talking about technology now....good night.

    EDIT: Take a look at OpenGeo Suite if you want to do a lot of what I am going to cover here, but in a much quicker and easier way. You may not learn as much, but can get started in just a few minutes.