When you think of web servers, your mind instantly turns to Unix-like operating systems such as Linux or some form of BSD – the vast majority of websites on the Internet run on a Unix-like server, they’re renowned for being ridiculously stable and never having to be rebooted. Linux/BSD web servers are usually run in a completely bare bones, command-line only mode in order to keep resource requirements to a minimum and minimising the amount of stuff you’re running that could be vulnerable to attack.
What’s had me thinking however is, I find RISC OS to be just as stable and it is capable of operating with very little memory and little resources – it’ll do all of this while throwing a graphical interface your way at the same time.
Lately I’d been toying around with the idea of running a basic web server on my home network that provides an interface that links me into the various services I run around my house – my email server, media server, file server etc. Remembering the details to access these services’ various web interfaces is a pain as I have to remember the IP address of the system as well as the port number that web interface is running on.
So seeing as I had a Raspberry Pi running as a VNC server for remotely accessing my RISC OS box from work, I figured I’d take a look at running a web server on it so that I can just point my browser to that web server and click into my various services from there.
From digging around, I found three HTTP web server software offerings to chose from, there are no applications out there that support HTTPS as far as I can see.
While there are alternatives out there such as Netplex from Warm Silence Software and h11p, the most widely used server of choice on RISC OS seems to be WebJames, and from the short amount of time I spent setting it up, I can see why. For the most part, it just works straight out of the box, you just decompress it from the Zip file it’s packaged in then you execute it – just as easy as setting up Apache or something on a Unix server.
Originally developed by Hernik Bjerregaard Pedersen, Web James is a HTTP web server that is compatible with all modern 32-bit RISC OS 5 systems and supports the below features:
- Supports GET, POST, HEAD, PUT and DELETE requests
- Content negotiation
- Cache for recently requested files
- Configurable logging of all requests
- Password protection
- Customisable error reports
- Standard CGI interface
- Custom CGI interface which allows multi-tasking scripts
- Supports Server Side Includes (SSI)
- Built in handler for PHP
- Support for name-based virtual hosts
Setting up WebJames
The installation process is as easy as you think, download the Zip file and unarchive it using SparkPlug or a similar application, drag and drop the !WebJames application into whatever location on your storage drive you want to keep it.
You’ll most likely want to ensure that !WebJames automatically runs whenever the machine boots into RISC OS just in case of any unexpected reboots. Editing the ‘PreDesk’ configuration file located here will provide this functionality – !Boot.Choices.Boot.PreDesk.
When run, WebJames will tick away in the background and respond to any HTTP requests it receives over port 80.
The files displayed by your webpage will be stored in the ‘Site’ directory within the directory you’ve saved !WebJames in. This is where your HTML files and anything else you want accessible via your web server will live.
If you’d rather not write your website manually via a text editor, you could use something like HTML3 to design the website that will run on your WebJames server. Alternatively, if you’ve already got a pre-designed website or something similar ready to upload from another machine, you can use something like Samba so that files can be dropped onto the RISC OS system running WebJames.
Just by running the !WebJames program, your web server should be running. By default, the webpage displayed in the screenshot at the bottom of this article will be displayed unless you’ve modified it. To make sure your web server is running, visit http://127.0.0.1 in a web browser on the system you’re running WebJames on, this should bring up your website.
If you ever need to troubleshoot issues with people accessing your website, or if you want to keep tabs on what IP addresses are connecting to you – there’s a log text file inside !WebJames named ‘clf’.
Local network configuration
If you want to access your website from an external network (i.e. via the Internet) then you’ll need to enable the firewall your web server is passing through to allow connections on port 80 (the HTTP port). With most setups this can be achieved by adding a port forwarding rule in your router’s firewall to allow TCP connections over port 80.
Should you decide you don’t require access to your web server from an external network – for example, you only need to connect to it from devices in your home so that you can easily link through to other servers/services on your home network – then you don’t need to do anything, traffic should pass over port 80 without a problem unless you have device-specific firewalls blocking this port (you’ll probably know about it if this is the case).
Accessing your website
Once your web server is setup and running on RISC OS, you can remotely access it by pointing any web browser to the IP address designated to your RISC OS machine running WebJames, or alternatively if you’ve configured a domain name to point to your IP address, you can visit the domain name.
LAN Access – If you’re accessing it from a device connected to the same local network as your server, then you can specify the LAN IP address for your device (e.g. 192.168.0.2) – it’s worth setting up a static LAN IP address in your router’s DHCP settings to ensure this stays the same. If you will be accessing the server from your local network and from external connections, then following the steps in the ‘WAN Access’ section below will be your best bet.
WAN Access – If your website needs to be accessed from machines outside your home network, then web browsers will need to point to your WAN IP address, which will be assigned to your Broadband modem. You can find out your IP address by searching ‘My IP’ using most major search engines,(click here for a pre-configured search query) or or alternatively if you’ve configured a domain name to point to your IP address, you can visit the domain name.
There we have it! You’re running a web server on your RISC OS computer.