Monday, February 8, 2010

How to install the command line transmissioncli bittorrent client in Ubuntu

mkdir ~/downloads
cd ~/downloads

# get the latest stable version from http://www.transmissionbt.com/download.php
wget http://mirrors.m0k.org/transmission/files/transmission-1.83.tar.bz2

bunzip2 transmission-1.83.tar.bz2
tar -xvf transmission-1.83.tar
cd transmission-1.83/
cat README | more

sudo apt-get install intltool
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install openssl

./configure
make
sudo make install

# verify that the install worked
ls -la /usr/local/bin/transmissioncli

------

Share

Saturday, February 6, 2010

How to set up Apache with groups of users and basic HTTP authentication

1. Do this as user root:

sudo su -

and find the path to the config files for Apache, ex: ls -la /etc/apache2/

2. create users, and use the htpasswd tool to encrypt their passwords
and store them in the password file:

htpasswd /etc/apache2/passwords john

and

htpasswd /etc/apache2/passwords mary


3. add your users to a groups file

nano /etc/apache2/groups

Create a group called "trusted" followed by ":" followed by
the user names who are in that group, space delimited:

trusted:john mary


and set permissions so that user apache (who is in group "www-data")
can actually see the "passwords" and "groups" files.

chown root:www-data /etc/apache2/groups
chown root:www-data /etc/apache2/passwords


4. edit the apache config file to set up the directory which you are serving

nano /etc/apache2/apache2.conf

At the end of the Apache config file, add the following alias,
assuming that you keep all your files in /home/john/coolfiles/


alias /john "/home/john/coolfiles"

Options Indexes +MultiViews
AllowOverride None
Order allow,deny
Allow from all

AuthType Basic
AuthName "Password Required"
AuthUserFile /etc/apache2/passwords
AuthGroupFile /etc/apache2/groups
Require Group trusted




5. restart apache, as user root

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start



6. test with a browser

http://localhost/john/

or

http://yourdomain.com/john/



Share

How to use wget to download recursively, using HTTP basic authentication

wget --http-user=john --http-password=smith -e robots=off
--recursive --level=1 --no-directories --no-host-directories
http://myhost.mydomain.com/path/to/files/


Share