Application Examples • 177
Example Program for a CGI Application
WAGO-I/O-SYSTEM 750
Linux Fieldbus Coupler
8.4 Example Program for a CGI Application
Program names:
web, info, ether, kernelmsg, eeprom, config, restart
Installation directory:
/var/www
index.html
upperframe.html
menuframe.html
Installation directory:
/var/www/cgi-bin
web
info (symbolic link web)
ether (symbolic link web)
kernelmsg (symbolic link web)
eeprom (symbolic link web)
config (symbolic link web)
restart (symbolic link web)
Source code files:
~
/uclinux-dist/user/wagoweb/html/index.html
~
/uclinux-dist/user/wagoweb/html/upperframe.html
~
/uclinux-dist/user/wagoweb/html/menuframe.html
~
/uclinux-dist/user/wagoweb/web.c
~
/uclinux-dist/user/wagoweb/info.c
~
/uclinux-dist/user/wagoweb/ether.c
~
/uclinux-dist/user/wagoweb/kernelmsg.c
~
/uclinux-dist/user/wagoweb/eeprom.c
~
/uclinux-dist/user/wagoweb/config.c
~
/uclinux-dist/user/wagoweb/restart.c
Function description
This example program implements the web-based management (WBM) of the
Linux fieldbus coupler.
The web server BOA uses the CGI files/programs. The HTML pages come
directly from the web server.
The CGI file
web
can be called via different symbolic links. The name of the
link is analyzed in the file and has a direct effect on the HTML output. The
links described above are essential in order to execute the functions. This type
of CGI call administration is ideal if you only want to need little memory in
the file system for the files to be called. It is furthermore possible to exchange
the entire functionality of the CGI calls by only replacing one file (see also
chapter 4.5.5).