A Terminal Anywhere
I use Debian GNU/Linux; if you use a different operating system or distribution you will need to translate the following. If you find any significant differences please let me know and I will add a note to this page.
I have written this for Apache2. You'll need the Apache2 server already set up and running and a suitable -dev package installed. I'm using apache2-threaded-dev.
The ROTE library is used to do the terminal emulation. Its installation is described in the next section.
Anyterm uses the excellent Sarissa library to wrap the XmlHTTP stuff, but I have included the necessary file so you don't need to download it separately.
You need g++, the GNU C++ compiler. Ancient versions (e.g. 2.95) will not work; versions 3.x and 4.x should be OK.
This version of Anyterm will not work on 64-bit systems.
ROTE is now packaged for Debian, so users of that distribution can simply "apt-get install librote0 librote-dev" and skip to the next section. Other users, read on.
You can download ROTE from its sourceforge project page at http://sourceforge.net/projects/rote. I recommend version 0.2.8 or newer. It can be installed using the standard "configure; make; make install" method:
From time to time improvements are made to ROTE's terminal emulation, and if these improvements have not been released you can instead compile ROTE from its CVS version, as follows.
ROTE will normally install itself under /usr/local. But the dynamic loaders on some systems do not look for shared libraries in /usr/local/lib by default. In this case, you need to add /usr/local/lib to /etc/ld.so.conf and then run ldconfig, after installing ROTE:
The result of not doing this is an error along the lines of "Syntax error ... cannot load anyterm.so ... undefined symbol ... rote" when you restart Apache.
Download the latest 1.0.x version of Anyterm from the download page, and unpack it:
The source code for Anyterm's Apache module is in the apachemod directory.
The build process uses a utility called apxs that's distributed with Apache. Some distributions including Debian call the Apache2 version of apxs "apxs2", while others just call it "apxs".
If your Apache installation is anywhere other than /usr, for example if it's in /usr/local, you'll need to adjust apachemod/Makefile slightly. It needs to know:
Anyerm needs to access data in an internal ROTE data structure. To do so it needs to find the roteprivate.h header file, which is in the rote source directory. If you built ROTE anywhere other than /usr/local/src/rote, please adjust apachemod/Makefile to specify the directory in which this file can be found.
In the apachemod directory, compile and install:
You should not see any errors or warnings while compiling. If you do see them it may mean that something is has gone wrong; please report them in the forums so that they can be investigated, even if everything seems to work.
Put something like the following in /etc/apache2/httpd.conf or similar so that the module is loaded:
Now restart Apache: (I think that restart, not just reload, is necessary.)
Just put anyterm.html, anyterm.js, sarissa.js and .htaccess from the browser directory somewhere accessible to your web server. Or use a symbolic link. The .htaccess file arranges for the URL anyterm-module to be handled by the Anyterm module; you may need to put something like "AllowOverride All" in your global Apache configuration to allow this .htaccess file to be effective.
You can of course change anyterm.html to adjust the appearance of the page to suit your application.
I use Mozilla Firefox 1.0 and also test periodically with IE6 and Opera 8. Feedback about how well it works on other browsers would be appreciated.
Visit the anyterm.html page. With luck you will see some output from the shell, e.g. a prompt. If you type "ls" and press return you should get a directory listing. Cursor and control keys should also work (e.g. ctrl-A and ctrl-E for start and end of line and tab completion). Applications that use more advanced terminal features may or may not work; "top" and "nano" both work for me. You should see bold and colours where they are used.
If it doesn't seem to work, first see the notes on the issues page. If you can work out what has gone wrong do please get in touch so that I can try to fix it.
Please see the configuration page for how to tune your new Anyterm installation.