You are currently browsing the monthly archive for May 2011.
This is the point at which the tutorial-like flavor of this series breaks down, for a variety of reasons. From here on, we’ll be dealing with divergent variables that cannot be easily addressed. We’ll discuss them each as they come up. Suffice to say that from now on I can only detail the steps I have taken. Any steps you take will depend on your equipment and circumstances.
Having finished putting my server together, I decided it was time to give it a face to show the world. Before I could do so, however, I had to give it a more substantial connection to that world, a process that began with establishing a dedicated address (domain). The most common method of achieving this is to simply purchase one (i.e., http://www.myinternetaddress.com). There are a variety of web hosts you can turn to for this. I cannot personally recommend any of them (due only to personal ignorance).
For the purpose of this exercise I didn’t feel I needed a whole lot (all I really wanted was an address, since I intended to host everything myself), so I went to DynDNS and created a free account (thanks, Don). DynDNS set me up with a personal address, and the use of their updater makes it work for dynamic addresses (which most routers provide). The web site does a decent job of walking you through the process, including setting up port forwarding in your router.
Exactly how to go about forwarding a port is particular to the router in question, so I won’t go into it in detail. I will say that it is not something that should be approached lightly. Port forwarding can pose certain security risks. It’s a very good idea to do some research into the process before you dabble in it.
Once I had an address and a port through which to use it, I had to choose a front end for my server. I was tempted to go with Drupal, mainly because it has the best documented means with which to serve up TileStream, but also because I’ve been meaning to learn my way around Drupal for some time now.
In the end, I realized that my little server, despite being almost Thomas-like in its dedication and willingness to serve, just doesn’t have the cojones necessary for serving those kind of tiles. Truth is, if I wanted my own custom base map tiles in an enterprise environment, I’d purchase MapBox’s TileStream hosting rather that serving it myself, anyway. (Umm… I really couldn’t have been more wrong about this.)
And so I decided learning Drupal could wait for another day. Instead I chose to go with WordPress, for several reasons. I’m reasonably familiar with it, it’s a solid, well-constructed application, it’s extremely customizable, and it has an enormous, dedicated user base who have written huge amounts of themes and plugins. And while WordPress was originally intended to be a blogging platform (and remains one of the best), it’s easy enough to reconfigure it for other purposes.
Installing WordPress is a snap since we included LAMP (Linux Apache, MySQL and PHP) while initially installing Ubuntu Server Edition. In the terminal, type:
sudo apt-get install wordpress
Let it do its thing. When it asks if you want to continue, hit ‘y’. When it gets back to the prompt, type:
sudo ln -s /usr/share/wordpress /var/www/wordpress
sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress mysite.com
But replace ‘mysite.com’ with the address you created at DynDNS.
Back to Webmin. On the sidebar menu, click on Servers→Apache Webserver→Virtual Server. Scroll down to the bottom. Leave the Address at ‘Any’. Specify the port you configured your router to forward (should be port 80, the default for HTTP). Set the Document Root by browsing to /var/www/wordpress. Specify the Server Name as the address you created at DynDNS (the full address – include http://). Stop and start Apache for good measure.
Now you should be able to point your browser to your DynDNS-created address (hereafter referred to as your address) to complete your configuration of WordPress. You will have to make many decisions. Choose wisely.
Once you have WordPress tweaked to your satisfaction, you’re probably going to want to add some web map functionality to it. First and easiest is Flex Viewer. All you have to do is move the ‘flexviewer’ folder from /var/www to /usr/share/wordpress. The file manager in Webmin can do this easily. Once you’re done, placing a Flex Viewer map on a page looks something like this:
<iframe style="border: none;" height="400" width="600" src="http://your address/flexviewer/index.html"></iframe>
Straightforward HTML. Nothing fancy, once all the machinery is in place.
Which gets a little trickier for GeoServer. By design, GeoServer only runs locally (localhost). In order to send GeoServer maps out to the universe at large, we have to do so through a proxy. This has to be configured in Apache. Luckily, Webmin makes it a relatively painless process.
We’ll start by enabling the proxy module in Apache. Click on Servers→Apache Webserver→Global Configuration→Configure Apache Modules. Click the checkboxes next to ‘proxy’ and ‘proxy_http’, then click on the ‘Enable Selected Modules’ button at the bottom. When you return to the Apache start page, click on ‘Apply Changes’ in the top right-hand corner.
Having done that, we can point everything in the right direction. Go to Servers→Apache Webserver→Virtual Server→Aliases and Redirects. Scroll to the bottom and fill in the boxes thus:
Your server will have a name other than maps. Most likely, it will be localhost. In any case, you can find it by looking in the location bar when you access the OpenGeo Suite. Apply the changes again, and you might as well stop Apache and restart it for good measure.
You can now configure and publish maps through GeoExplorer. The only caveat is that GeoExplorer will give you code that needs a minor change. It will use a local address (i.e., localhost:8080) that needs to be updated. Example:
<iframe style="border: none;" height="400" width="600" src="http://localhost:8080/geoexplorer/viewer#maps/1"></iframe>
<iframe style="border: none;" height="400" width="600" src="http://your address/geoexplorer/viewer#maps/1"></iframe>
And that – as they say – is that. Much of this has entailed individual choices and therefore leaves a lot of room for variation, but I think we’ve covered enough ground to get you up and running. If you want to see my end result, you can find it at:
I won’t make any promises as to how long I will keep it up and running, but it will be there for a short while, at least. Keep in mind that it is a work in progress. So be nice.
Update: My apologies to anyone who may give a crap. but I have pulled the plug on the Webby Thing. It was really just a showpiece, and I just couldn’t seem to find the time to maintain it properly. And frankly, I have better uses for the server. Sorry.