r2 - 01 Apr 2005 - 05:39:29 - DarrylBondYou are here: TWiki >  Ltsp Web  > ClientWebserver

Using tserver as a client Web Server

Why would you do this.

Web Servers allow access to the host using a simple web browser. A web server that can be CGI scripted be used to create custom applications using forms.

Tserver

Tserver was written by Andrew Tridgell of Samba fame and is part of his junk code collection. It's claim to fame is the ability to execute bash commands as embedded CGI in an extermely light weigth server program with few library dependencies.
 
# ls -l /usr/sbin/tserver
-rwxr-xr-x  1 root root 14552 Mar 26 16:30 tserver 
# ldd /usr/sbin/tserver
        libc.so.6 => /lib/libc.so.6 (0x40018000)
   /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

A web page like thus:

<HTML>
<BODY>
<H1>Welcome to LTSP Client <font color=red> {{ ! hostname }} </font> </H1>
Here is the contents of some interesting /proc files
<pre>
<h4>/proc/cpuinfo</h4>
{{ ! 
cat /proc/cpuinfo
}}
<h4>/proc/meminfo</h4>
{{! 
cat /proc/meminfo
}}
</pre>
</BODY>
</HTML>

will output a Web page with the hostname of the machine substituted. The syntax {{ ! bash script commands }} execute the external command and substitute its output for the {{ ...... }}. Attached is an example page from the distribution files.

To set up tserver for LTSP

  • Create a directory /opt/ltsp/i386/usr/share/html
  • Copy the files
  • Set up RCFILE_01 = start_tserver in lts.conf
  • Create other html files

Install files

  • tserver: Tserver web server executable compiled for LTSP4.1

  • nohup: nohup script for starting tserver

Example web pages

Download these by using save as. They require tserver as the backend server to be parsed correctly.

-- DarrylBond - 28 Mar 2005

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback