6
found ajaxterm a good thing if you just want to have a terminal through a webpage, i.e. you'll be able to use ssh to your server from anywhere with internet (such as public library, even if they block 22, 443, etc ports and only allow 80)
Complete Guide: http://mewbies.com/how_to_install_ajaxterm_tutorial.htm
My simple guide:
1. Install:
# Change SSH server configuration to make sure PasswordAuthentication is yes
sudo sed -i s:PasswordAuthentication.*:PasswordAuthentication yes: /etc/ssh/
sshd_config
sudo service ssh restart
#install ajaxterm
sudo apt-get install ajaxterm
sudo mkdir /srv/ajaxterm
sudo htpasswd -bc /srv/ajaxterm/.htpasswd yourusername password
# Above you should make the password verystrong, the password will be
encryped into /srv/ajaxterm/.htpasswd file.
sudo /etc/init.d/ajaxterm start
Then you can visit on the server: http://localhost:8022/
To enable remote access, After install, a few fine tuning needed:
2. patch for firefox 3.6:
edit /usr/share/ajaxterm/sarissa.js :
Change this (line 268):
XMLDocument.prototype.readyState = 0;
/**
* Emulate IE's parseError attribute
*/
To his:
try {
XMLDocument.prototype.readyState = 0;
} catch(e) {
};
/**
* Emulate IE's parseError attribute
*/
3. Resize window
edit /usr/share/ajaxterm/ajaxterm.py
Has this:
def __init__(self,width=80,height=24):
Changed to:
def __init__(self,width=140,height=42):
edit /usr/share/ajaxterm/ajaxterm.html
Has this:
t=ajaxterm.Terminal("term",80,25);
Changed to:
t=ajaxterm.Terminal("term",140,42);
4. Make the Fonts Larger:
Change : /usr/share/ajaxterm/ajaxterm.css,include "font-size:16pt;" lines as
follows:
pre.stat .on {
background-color: #080;
font-weight: bold;
font-size: 16pt;
color: white;
cursor: pointer;
}
pre.term {
margin: 0px;
padding: 4px;
display: block;
font-family: monospace;
font-size:16pt;
white-space: pre;
background-color: black;
border-top: 1px solid white;
color: #eee;
}
5. If only port 80 is allowed on your server ,
Put the following in your /etc/apache2/sites-available/default
#===========
ProxyRequests Off
AuthUserFile /srv/ajaxterm/.htpasswd
AuthName EnterPassword
AuthType Basic
require valid-user
Order Deny,allow
Allow From all
ProxyPass /ajaxterm/ http://localhost:8022/ #Change the port to your ajaxterm port, default is 8022, its set in /etc/init.d/ajaxterm
ProxyPassReverse /ajaxterm/ http://www.localhost:8022/
ServerAdmin webmaster@localhost
DocumentRoot /var/www
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
#===========
6. if you have 443 (https) port open
put the following in /etc/apache2/sites-available/default-ssl
#=====
ServerAdmin webmaster@localhost
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
#here you should create "/etc/apache2/ssl/apache.pem" file according
to http://mewbies.com/how_to_install_ajaxterm_tutorial.htm
DocumentRoot /var/www
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
#====proxy for ajaxterm===
ProxyRequests Off
AuthType Basic
AuthName "EnterPassword"
AuthUserFile /srv/ajaxterm/.htpasswd
require valid-user
Order deny,allow
Allow from all
ProxyPass /ajaxterm/ http://localhost:8022/
ProxyPassReverse /ajaxterm/ http://localhost:8022/
#=====
7. How to restart after changing configuration
sudo a2ensite default
sudo a2ensite default-ssl
sudo a2enmod proxy_http
sudo a2enmod proxy
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/ajaxterm restart
8. How to access:
http://ipaddress/ajaxterm/ (if you only have port 80 open)
https://ipaddress/ajaxterm/ (if you have https (port 443) open)
Screenshots:
https://help.ubuntu.com/community/AjaxTerm?action=AttachFile&do=get&target=
ajaxterm.png