Jim’s Development Blog

Software development in progress

Jim’s Development Blog Alaska 2

Web Server version 0.1

August 14th, 2010 · No Comments · Museum software

Users of the premium edition of the Museum Archive software project are invited to contact me in order to participate in testing (playing with) the first version of the project’s web server. This is version 0.1. It has very limited functionality – it is really just a quick example to see how this approach might work.

 

You can see your Objects in a web browser. You can sort by column. You can use a locator field to jump to a specific Object in the list. That’s it – no viewing of the Object’s details, no editing, no reports. Just a simple browse list with basic locator and navigation controls. But it is a start. If you want to see how it works, contact me and I’ll send you a link.

web server example 

The web browser produces the web pages served on the fly. There are style sheets and javascript code that make it work, although I am totally ignoring the user interface style at the moment. Eventually, you’ll be able to apply your own styles and make this look the way you’d like.

 

How does this work?

 

The Museum Archive software database exists in a folder on one of your computers on your network. This computer has an IP address. In this example, let’s say that the IP address is 192.168.1.20. Other computers on your network have similar IP addresses; these addresses typically all begin with 192.168.1, with only the last segment having a distinct value.

 

Continuing with our example, let us say that the Museum Archive software is located on the computer’s C: drive in a folder called Musarch. When you are working on that computer, the path to the software is C:\Musarch. You can allow other computers on your network to share the contents of the C:\Musarch folder, and they can access those contents by specifying a path from their machine to the shared folder. This is how you set up a multi-user environment to use the software.

 

What we want to do is place a new application in the C:\Musarch folder. This new app is a special purpose web server; its job is to watch a specific computer port for web requests and answer those requests when appropriate. The web server coexists with the rest of the Museum Archive software, and it accesses the same database. In this example, the web server watches port 88 (normal web browser traffic happens on port 80). When you start the web server app, it just sits there waiting for a web request to show up on port 88.

 

[I always advise you to backup your data before trying anything new, so back up now.]

 

Download the zip file from the link I provide in the email (you’ll get an email from me after you tell me that you are interested). Extract the contents to the installation folder of the Museum Archive software package – be sure to enable the use of folder names for the extraction process. You’ll end up with a musarch_server.exe file in the installation folder, as well as a new sub-folder called web. Double-click on the exe to start the server.

 

If you start a web browser (Internet Explorer, Firefox, Chrome, Safari, etc.) on the same computer that holds the Museum Archive software, you can point to this special web server and see your data. In the address bar of the browser, type this:

 

http://localhost:88

 

Localhost is a way of telling your browser to look at this computer, and the port number following the colon tells it not to use the default port number (80).

 

You can access this same web server from another machine on your network. Start the browser and type in the IP address of the computer running the web server, and don’t forget to add the port number. In this example, you could go to a computer with an IP address of 192.168.1.25, start the web browser, and specify this address:

 

http://192.168.1.20:88

 

Your web browser will communicate with the web server running on the computer with the IP address of 192.168.1.20 (the computer with the Museum Archive software on it).

 

[Note: Your firewall might ask you for permission before making these connections.]

 

Eventually, you can open up access to this special purpose web server to the whole internet. This involves setting up your router to forward requests made on a specific port to a specific computer on your network and so on. We won’t be dealing with this now. This example is merely a “test of concept”, something to see if I am on the right track as I attempt to develop a web-based component for the Museum Archive software project.

 

Is this safe?

 

The special web server can only do the tasks that I build into it, so in that sense it is safer than a general purpose web server such as Apache or IIS, which are designed to do many things and are much more flexible. Because the backend of the Museum Archive software project does not use an off-the-shelf database engine, it is not vulnerable to the usual tricks and techniques favored by malicious users. Plus, you can simply close the web server app at any time.

 

This example is meant to be used on your own computer (localhost) or, at most, on your local network. It only displays data. Play with it and let me know what you think.

 

Tags: ·