Hello everyone,

I had to install anyterm on a fresh karmic koala yesterday but i’ve ran into so many problems that I decided I’ll write a simple tutorial about this subject.

Anyterm is a software that allows you to acces a terminal over http(s) protocol, so it allows you to bypass most proxys.

For more info on anyterm please visit the official website at http://anyterm.org/

This tutorial will explain how to compile from the SVN source 1.1.29 but may be slightly diferent if you are trying to use another version.

OK so let’s start by making sure that you have subversion installed.

If you don’t or you are unsure please check it via


sudo apt-get install subversion

Ok now we need to checkout the svn in a temp directory so

cd
mkdir tmp
cd tmp
svn co http://svn.anyterm.org/anyterm/tags/releases/1.1/1.1.29/ anyterm-1.1.29
cd anyterm-1.1.29

Now we need to compile the bin anytermd by using the command make but before that we need to install some dependencys

sudo apt-get install zlib1g-dev libboost-dev

Note : As of today there is a bug in SmtpClient.cc so you have to manually add a line in this file

nano libpbe/src/SmtpClient.cc

locate the line
#include “SmtpClient.hh”
and add after this line
#include <stdio.h>

Now you can launch the make command (this may take some time)

make

Once it is finished and if there was no errors you have to copy anytermd binary to your /usr/bin dir

sudo cp anytermd /usr/bin

Ok now that we have the binary we have to configure apache2 with SSL and Proxy to secure your shell access.

If you do not have apache2 installed you should install it a this time and enable mod_proxy mod_ssl and mod_http_proxy

sudo apt-get install apache2.2-common apache2-mpm-prefork
sudo a2enmod proxy ssl proxy_http
sudo /etc/init.d/apache2 restart

Now we need to modify the mod_proxy configuration so it allows us to use it

sudo nano /etc/apache2/mods-enabled/proxy.conf

And change this

<Proxy *>
AddDefaultCharset off
Order deny,all
Deny from all
#Allow from .example.com
</Proxy>

to this (or anything else that works better for you check out the doc)

<Proxy *>
AddDefaultCharset off
Order allow,deny
Allow from all
#Allow from .example.com
</Proxy>

Now we need to create a ssl certificate

sudo mkdir /etc/apache2/ssl
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/domain.pem

now let’s make a conf in apache to trigger anyterm.
In this example i’ll use the /term directory so basicly you will have to go to https://yourhost/term to acces anyterm

sudo nano /etc/apache2/sites-available/anyterm

And add this configuration

<VirtualHost _default_:443>  # HTTPS port
ServerName _default_
<Location /term>
ProxyPass http://localhost:7777 ttl=60
ProxyPassReverse http://localhost:7777
AuthType Basic
AuthName "domain"
require valid-user
AuthUserFile /etc/apache2/passwds/.passwdAnyterm
</Location>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/domain.pem
ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Ok now we need to add the site to apache2 and launch anytermd

sudo a2ensite anyterm
sudo /etc/init.d/apache2 restart
anytermd -p 7777 --local-only

Before we finish we need to add users to the htpasswd file

sudo mkdir /etc/apache2/passwds
sudo htpasswd -c /etc/apache2/passwds/.passwdAnyterm ALOGIN

Congratulations ! You should have a working anyterm on https://localhost/term

firefox might complain over not trusted certificate but there is nothing we can do about this ( as far as I know )

Share

Related Posts: