2009
10.30

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/Bookmark

Related Posts:

9 comments so far

Add Your Comment
  1. https://localhost/term ???????

  2. Yes ? If you follow this tutorial you should see anyterm on your localhost so it would be at https://localhost but also from your internet ip if you don’t have a firewall enabled

  3. When I try to restart my server I receive:
    Starting web server (apache2)…Syntax error on line 11 of /etc/apache2/sites-enabled/anyterm:
    Invalid command \’SSLEngine\’, perhaps misspelled or defined by a module not included in the server configuration
    failed!
    What\’s the problem?

  4. Did you forget to do this command ?

    sudo a2enmod proxy ssl proxy_http

    if not add your conf to a pastebin and post it here so I can check it out

  5. I’m sorry but I’m a newbie.
    Is it possible, but I think yes, to use without ssl?

    Or what can I do to let you know my configuration? Because when I do sudo a2enmod proxy ssl proxy_http, the server reply: This module is already enabled!

  6. Yes you could use without ssl but it’s not recommended because everyone could sniff your infos & stuff…

    Go to pastebin.com and paste the content of your anyterm conf file.

    Then It will give a link that you will have to copy here so I can go check it out

  7. Hello.
    I cannot access to the terminal by putting my Internet IP address instead of localhost.
    If I could connect by that way;Does it mean that I can connect from the Internet?
    If so, what could be the problem?
    Should I forward a port in the router?
    Thank for the article.

  8. If it works via localhost but not your wan ip it may be different things.
    For example if your are behind a router you may have to configure port forwarding.
    It could also be a firewall that prevents you from accessing your server.

    The article works for internet access…

  9. I have tried this but i now get the error
    \"An error occurred during a connection to localhost.

    SSL received a record that exceeded the maximum permissible length.

    (Error code: ssl_error_rx_record_too_long)\"

    What did i screw up?