Posts Tagged 'Howtos'

Howto: AJAX-based SSH client for your Debian+Plesk Setup (AjaxTerm)

I recently read an article about AjaxTerm in the German Linux Magazin. It is a AJAX-based SSH client which runs in your browser. So with the respective setup you are able to access your box’ shell from anywhere just with a browser. You do not even have any problems with firewalls and proxies anymore!

This is a small guide which explains how to setup AjaxTerm on a Debian System with Plesk:

1. Go to the AjaxTerm Website and download the latest release (currently 0.10).
# wget http://antony.lesuisse.org/qweb/files/Ajaxterm-0.10.tar.gz

2. Extract the archive, become root, move the folder to /usr/local/ and create a symlink for easier access.

# tar xvzf Ajaxterm-0.10.tar.gz
# su
# mv Ajaxterm/ /usr/local
# ln -s /usr/local/Ajaxterm-0.10 /usr/local/ajaxterm
# cd /usr/local/ajaxterm

3. Copy the Debian init script for AjaxTerm to /etc/init.d/ and add it to all default run levels

# cp configure.initd.debian /etc/init.d/ajaxterm
# update-rc.d ajaxterm defaults

4. Edit the init script and change the variable DAEMON to /usr/local/ajaxterm/ajaxterm.py and PORT to 8022. Check that the executable name is ajaxterm.py (with the file extension!).

5. Make the init script executable and start AjaxTerm

# chmod a+x /etc/init.d/ajaxterm
# /etc/init.d/ajaxterm start
Starting ajaxterm on port 8022
AjaxTerm at http://localhost:8022/ pid: 7580

AjaxTerm is now successfully running (it started ssh session on localhost with user nobody) but is only listening on localhost:8022. Therefore we will use the Apache proxy module to access AjaxTerm using a subdomain. (As we did in the Plesk on Port 443 Howto)

6. Create a new subdomain with PHP support in Plesk, e.g. ajaxterm.example.com.

7. Go to the conf directory of the new domain.
# cd /var/www/vhosts/example.com/subdomains/ajaxterm/conf

8. Create a new vhost.conf with the following lines.

ProxyRequests Off
<proxy *>
Order deny,allow
Allow from all
</proxy>

ProxyPass /ajaxterm/ http://localhost:8022/
ProxyPassReverse /ajaxterm/ http://localhost:8022/

9. Activate the proxy Apache module, reconfigure Plesk so that it finds the new vhost.conf and reload the apache configuration.

# a2enmod proxy
# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=example.com
# /etc/init.d/apache reload

You should not get any errors!

10. Access AjaxTerm: https://ajaxterm.example.com/ajaxterm/ (Don’t forget the trailing slash!)

11. Because we do not want to be able to use AjaxTerm over unsecured HTTP, we create a simple index.php in httpdoc/ and httpsdoc/ of the subdomain folder, which will redirect to the above link. Furthermore you should delete the index.html file in httpdocs/ and httpsdocs/.

< ? header("Location: https://" . $_SERVER['SERVER_NAME'] . "/ajaxterm/"); ?>

Now you should be able to access AjaxTerm by visiting https://ajaxterm.example.com with your browser.

If you are really paranoid you should secure the access furthermore by setting up an authentication, e.g. basic http authentication.

Mac Mini on Speed (Mac Mini Core 2 Duo (Merom) Upgrade)

On Monday I successfully upgraded the CPU of my Mac Mini. The old Intel Core Solo 1,5 Ghz had to give way for a new Intel Core 2 Duo 2,0 Ghz (T7200, code name “Merom”). Additionally I replaced the two 512 MB RAM modules with two modules of 1024 MB each.

1. The Mac Mini still works stable! ;-)

2. The speedup is really huge. I did not do many exact benchmarks but most applications are starting much faster than before (espcially iPhoto with 8000 photos and Rosetta applications like MS Office or Acrobat 7) and feel more responsive.

3. The CPU temperature during normal usage (running apps: AdiumX, Skype, Mail, NetNewsWire, iTunes, EyeTV) ranges from 55 to 67 degrees celsius. At maximum load the temperature went up to 97 degrees for a short time (most of the time it was at 90 to 92 when running SETI@home). Although this is within the limit of critical temperature (which is at 125 degrees celsius for the Core 2 Duo), it is unfortunately not very low. I did not measure the temperature of the Core Solo 1,5 Ghz before the upgrade, but can remember that I ran CoreDuoTemp some weeks ago during normal system usage and got about 60 degrees celsius.

4. Some images of the upgrade can be found here.

Benchmarks:
Here are some benchmark values of the Mac Mini with the old CPU (first value) and the new one (second value). The third value shows the speedup-factor.

Xbench values
CPU Test: 56.20 -> 104.55 => 1,86
Thread Test: 82.82 -> 199.50 => 2,40
Memory Test: 105.20 -> 117.77 => 1,12

Most of the other Xbench tests showed a speedup similar to the memory test.

Cinebench 9.5
Rendering (Single CPU): 216 -> 332 => 1,54
Rendering (Multiple CPU): n/a -> 619
Multiprocessor Speedup of Core 2 Duo: 1.87

Shading (CINEMA 4D): 265 – 405 => 1,53
Shading (OpenGL Software Lighting): 850 -> 1440 => 1,69
Shading (OpenGL Hardware Lighting) : 869 -> 1574 => 1,81
OpenGL Speedup: 3.28 -> 3.88 => 1,19

Result: SPEEEEEED :-)

FTP backup with duplicity/ftplicity

While the 1blu vserver is still running even though I do not pay anything for it, I thought I could use it for something useful. ;-)

I found an interesting article about encrypted and incremental backups using ftp with the app “duplicity” in issue #13 of the German computer magazine c’t. (page 216)

The author of the article, Christiane Rütten, uses a wrapper script called ftplicity to simplify the usage of duplicity. It is working really great. Here are the steps to setup an automatic, encrypted and incremental backup using ftplicity/duplicity aggregated from the article:

————————————————————————-

apt-get install duplicity
gpg –gen-key
wget ftp://ftp.heise.de/pub/ct/listings/0613-216.tar.gz
unzip 0613-216.tar.gz
cp ftplicity/ftplicity /usr/local/bin
ftplicity
nano -w .ftplicity/conf
# GPG_KEY < = set to the 8 digit long key-id of the generated gpg key
# GPG_PW <= set to the passphrase which was used for generating the gpg key
# set the necessary ftp credentials
nano -w .ftplicity/exclude
# insert all directories which should be excluded from the back (each on a single line), for example: /dev /proc /sys /tmp /var/tmp /var/run
nano -w .ftplicity/pre
# insert all commands you want to execute before backup; for example dump of all mysql databases: mysqldump –all-databases -u admin -p’
chmod u+x .ftplicity/pre
chmod og-rwx .ftplicity/*#create first backup
ftplicity backup

#create crontab entries

# run the backup every night at 5am (incrementally)
00 5 * * * root /usr/local/bin/ftplicity backup

# run a full backup and delete old incrementals once a month
00 6 1 * * root /usr/local/bin/ftplicity full && /usr/local/bin/ftplicity purge –force

————————————————————————-

Howto: Installing PHP5 on Debian 3.1 with Plesk 8

This is a small Tutorial how to install PHP5 on Debian 3.1 with Plesk 8.0.0.

(1) Add new source to /etc/apt/sources.list
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
(2) Install PHP 5 – WARNING: Plesk is currently not compatible to MySQL5! So make sure, that you do not upgrade your MySQL Installation.
apt-get install psa-php5-configurator
apt-cache search php5
…and install any of the php modules you want.
(3) THIS STEP IS PROBABLY NOT NEEDED ANYMORE WITH PLESK 8 AND ABOVE! So try out https://webmail.example.com first!
Fix Horde Webmailer:
apt-get install php5-pear
pear upgrade DB
cd /usr/share/psa-horde/pear
tar cvzf DB.backup.tar.gz DB.php DB/
rm DB.php
rm -R DB/
cp -R /usr/share/php/DB* .

(4) That’s it!

Running Plesk on port 443

Today, I wrote a small tutorial about how to run Plesk on port 443 using mod_proxy.
—————————————————

This howto describes the configuration of your server to let your users login to plesk using standard ports 80 (http) and 443 (https). This is especially helpful, if you are behind any kind of firewall or proxy, which prohibits access to plesk’s standard port 8443. This solution uses mod_proxy to create an internal forward from ports 80/443 to port 8443.

Please notice, that you will not have access to the Virtuozzo Panel in Plesk when using this solution. But as access to Plesk and(!) Virtuozzo Panel is still available on Port 8443, this should not be problem for your clients.

I created this howto on a Debian Linux system. Therefore you will have to replace some of the commands with commands of the Linux distribution, which you are using. Basically, the configuration should work on any Linux system.

My test system: VPS, Debian 3.1, Plesk 8

(1) install mod_proxy_html
apt-get install libapache2-mod-proxy-html

(2) activate mod_proxy_html in apache configuration
a2enmod proxy_html

(3) create subdomain with ssl support through Plesk (example: plesk.example.com)

(4) create a file called vhost.conf in /var/www/vhosts//subdomains/plesk/conf/ and insert the following options:

ProxyPass / https://localhost:8443/
<Location />
ProxyPassReverse /
</Location>
SSLProxyEngine On

<Proxy *>
Order deny,allow
Deny from all
Allow from all
</Proxy>
(5) let Plesk reconfigure your domain (replace example.com with your domain)
/usr/local/psa/admin/sbin/websrvmng –reconfigure-vhost –vhost-name=example.com

(6) restart Apache
/etc/init.d/apache2 restart

(7) access Plesk using https://plesk.example.com or http://plesk.example.com

(8) Send me an eCard, email or comment this blog entry directly to give feedback on this tutorial. :-)
—————————————————



Archives

del.icio.us links