ADLINK Hurricane-QM57 User Manual

Page 25

Advertising
background image

SME-LEMT-R0V8

Revision 0.8

Page 21 of 22

tricky to set up and beyond the scope of this document. See e.g. man thttpd to avoid cutting the
server off from its own logfile. We recommend to set nochroot to avoid this obstacle at least initially
until you got the LEMTWeb interface up and running. Then you may try and re-enable it if you want
to.

Dir specifies the base directory for all web content, the "/" directory as seen by the browsers. If you
installed a distribution-specific package then do not change this setting, rather only understand to
use the appropriate path when reading this documentation.

cgipat is the pattern applied by the server to determine if a file is a CGI executable. (Alternatives
are "*.cgi" or "/cgi-bin/*.cgi".) This option must be set and the LEMTWeb binary must match it.

If the web server is not running already or if you changed its configuration file then (re)start it with:

/etc/init.d/thttpd restart

By entering the supervised system's IP address in any browser's address bar you should now be able
to connect from another computer to show whatever is already provided in /var/www/. If you are
not, check if a firewall on the supervised system is blocking incoming(!) access to the HTTP port 80
or test the basic network setup with ping.

LEMTWeb

The second component is responsible for calling the LEMT command line tool and formatting its
output as an HTML page, which it then passes to the web server. lemtweb can be compiled from its
source file lemtweb.c with:

gcc -Wall -O2 -s -o lemtweb lemtweb.c

This is only necessary after changing one of the few configuration options #defined at the beginning
of the source file. Install the resulting binary lemtweb in the /var/www/cgi-bin/ directory where the
web server expects to find CGI executables.

Also copy the logo image file to /var/www/img/ as specified by the "#define LOGO_IMAGE" line near
the start of the source file. You might have to create the img/ directory first. Aiming your browser at

http://your.ip.address/cgi-bin/lemtweb

now should at least show the LEMT Web Interface headline and the logo, likely next to an error
message about lemt not being found. If you won't get even that check the files' permissions and the
web server's CGI setting. lemtweb must be executable by whatever user the web server runs as;
often this is a dedicated user with minimum rights, named www-data or nobody.

LEMT

The last component is the LEMT executable which does the actual hardware access. LEMT_COMMAND
in lemtweb.c defines how it is run. Per default this is just "lemt" without a specific location, meaning
lemt

will have to be installed somewhere in the standard search path to be found. Copy it e.g. to

/usr/bin/

or specify the full path. It, too, has to be executable by the web server user.

Now you will probably get something about "IO Access: Operation not permitted" and "Admin
privileges needed" in your browser. This means that LEMTWeb succeeded in calling LEMT, but the
latter did not have the rights to access the hardware. To make it work the LEMT executable itself
must run as root, even when being called by the unprivileged web server's user. One way to achieve
this is to make LEMT a setuid root executable:

chown root:root lemt
chmod 4755 lemt

Advertising
This manual is related to the following products: