HTTP Server: Difference between revisions

From Sharpfin
Jump to navigation Jump to search
No edit summary
Line 40: Line 40:
=== Expanding / Updating ===
=== Expanding / Updating ===


The HTTP Server installs all files in /opt/webserver.  The main index file '/opt/webserver/index.html' is not overwritten by the install/upgrade process, so if you wish to replace it with your own, you are safe to do so.
The HTTP Server installs all files in /opt/webserver.


The default /index.html file simply refreshes the screen to show the /admin/index.html, which is a two-frame page.  The left frame being the menu, and the right being called 'right'.
==== Radio Menu ====


The menu itself is a cgi script '/cgi-bin/menu.cgi'.  This script looks for files called 'menuentry_Section_Menu_Entry_Name.cgi', and populates the menu in the sections defined in the filenames.  If you wish to add your own cgi-bin scripts, they are automatically added to the menu.
The Radio Menu is intended for radio 'user' type features, such as station selection, favorites programming, alarm setting etc ...
 
The default /index.html file shows the 'Radio' menu, which is a two-frame page.  The left frame being the menu, and the right being called 'right'.
 
The menu itself is a cgi script '/cgi-bin/radiomenu.cgi'.  This script looks for files called 'radio_Section_Menu_Entry_Name.cgi', and populates the menu in the sections defined in the filenames.  If you wish to add your own cgi-bin scripts, they are automatically added to the menu.
 
==== Admin ====
 
The other menu is the Admin menu, and contains diagnosting and development menus, and is found at /adminindex.html.  The left frame again is the menu, and the right is again called 'right'.
 
Like the radio menu, the admin menu is called '/cgi-bin/adminmenu.cgi' and looks for files called 'admin_Section_Menu_Entry_Name.cgi'
 
==== Useful Stuff ====


A useful script is also placed in the cgi-bin directory.  The 'getarg' script parses any parameters from a HTTP GET operation, searching for a specific tag, and returns to stdout the contents, for example:
A useful script is also placed in the cgi-bin directory.  The 'getarg' script parses any parameters from a HTTP GET operation, searching for a specific tag, and returns to stdout the contents, for example:
Line 50: Line 62:
The url:
The url:


  http://radio/admin/cgi-bin/menuentry_Info_Show_Status.cgi?function=player&when=today
  http://radio/admin/cgi-bin/admin_Info_Show_Status.cgi?function=player&when=today


Is parsed in a script file as follows:
Is parsed in a script file as follows:

Revision as of 21:44, 2 November 2007

HTTP Server

The HTTP Server is installed using an application called 'busybox', which has been renamed to 'sharpfin' and installed alongside the radio's own busybox program. This same executable program provides the telnet server so that you can login.

The HTTP server is installed at the same time as the login server using the patchfile which is found on the Enabling Login page.

Sharpfin-radio.jpg

Configuring

The HTTP server files are installed onto the debug partition, and can be found in /opt/webserver. The http config file is found in /opt/etc/httpd.conf

The HTTP server (and telnet server) automatically starts when the radio is booted. As they both use the same executable program, they are extremely efficient in their memory usage.

If you have previously installed the ssh server, it is recommended that you start using the telnet mechanism to login to you radio due to these efficiencies. Furthermore, it is important to ensure enough memory remains for the Reciva application. At its worst, it takes 90% of the memory. ssh takes 9% and the httpd/telnetd combination takes 2-4%.

We recommend uninstalling the ssh server before applying the sharpfin patch.

We also recommend uninstalling the sharpfin patch before upgrading the reciva application firmware (from Reciva).'

Features

The HTTP server provides the following menu features:

Menu

  • Home - Radio Homepage
  • Sharpfin Project - Link to the Sharpfin Website

Info

  • File Explorer - Browse the filesystem
  • Installed Apps - See what packages are installed
  • Radio Info - Various bits of radio info, including processes and memory usage

Install

  • Change Firmware - Very Advanced: Read Changing Firmware first
  • Debug Application - Download and run an application in /tmp
  • Install Addon - Install / upgrade a sharpfin package

Tools

  • Feedback - Provide us with vital feedback
  • Run Program - Run any unix command from the webserver, e.g. 'ls'

Expanding / Updating

The HTTP Server installs all files in /opt/webserver.

Radio Menu

The Radio Menu is intended for radio 'user' type features, such as station selection, favorites programming, alarm setting etc ...

The default /index.html file shows the 'Radio' menu, which is a two-frame page. The left frame being the menu, and the right being called 'right'.

The menu itself is a cgi script '/cgi-bin/radiomenu.cgi'. This script looks for files called 'radio_Section_Menu_Entry_Name.cgi', and populates the menu in the sections defined in the filenames. If you wish to add your own cgi-bin scripts, they are automatically added to the menu.

Admin

The other menu is the Admin menu, and contains diagnosting and development menus, and is found at /adminindex.html. The left frame again is the menu, and the right is again called 'right'.

Like the radio menu, the admin menu is called '/cgi-bin/adminmenu.cgi' and looks for files called 'admin_Section_Menu_Entry_Name.cgi'

Useful Stuff

A useful script is also placed in the cgi-bin directory. The 'getarg' script parses any parameters from a HTTP GET operation, searching for a specific tag, and returns to stdout the contents, for example:

The url:

http://radio/admin/cgi-bin/admin_Info_Show_Status.cgi?function=player&when=today

Is parsed in a script file as follows:

FUNCTION="`/opt/webserver/cgi-bin/getarg function`"
WHEN="`/opt/webserver/cgi-bin/getarg when`"