Tuesday, August 27, 2013

Install deluge web interface on Ubuntu

About Deluge Torrent

Deluge is a full-featured BitTorrent client for Linux, OS X, Unix and Windows. It uses libtorrent in it’s backend and features multiple user-interfaces including: GTK+, web and console. It has been designed using the client server model with a daemon process that handles all the bittorrent activity. The Deluge daemon is able to run on headless machines with the user-interfaces being able to connect remotely from any platform.
Deluge torrent features a rich plugin collection; in fact, most of Deluge’s functionality is available in the form of plugins.
Deluge was created with the intention of being lightweight and unobtrusive. It is our belief that downloading shouldn’t be the primary task on your computer and therefore shouldn’t monopolize system resources.
Deluge is not designed for any one desktop environment and will work just fine in GNOME, KDE, XFCE and others. We do our best to adhere to the freedesktop standards.
Deluge Torrent Client
Deluge Torrent Client
Deluge has a wide-array of features, including:
  • Core/UI split allowing Deluge to run as a daemon
  • Connect remotely to the Deluge daemon
  • Web UI
  • Console UI
  • GTK+ UI
  • BitTorrent Protocol Encryption
  • Mainline DHT
  • Local Peer Discovery (aka LSD)
  • FAST protocol extension
  • µTorrent Peer Exchange
  • UPnP and NAT-PMP
  • Proxy support
  • Web seed
  • Private Torrents
  • Global and per-torrent speed limits
  • Configurable bandwidth scheduler
  • Password protection
  • RSS (via Plugin)
  • Other libtorrent features
  • And much more!

Step 1: Add Deluge PPA Repository

Deluge is readily available in Ubuntu repository. However, Ubuntu repository is usually a bit slow on updating versions. So if you are like me and would like to have the latest version as soon as possible, then add the PPA repository as described below. If not proceed to step 2.
sudo add-apt-repository ppa:deluge-team/ppa

Step 2: Install Deluge Web Interface

Then update packages list and install Deluge:
sudo apt-get update
sudo apt-get install deluged deluge-webui
If you want the full desktop gui software then use:
sudo apt-get update
sudo apt-get install deluged deluge-webui deluge

Step 3: Create the Init Script for Deluge

Create the file /etc/init/deluge.conf (init script for Deluge) and enter the following contents in it:
start on (filesystem and networking) or runlevel [2345]
stop on runlevel [016]

env uid=USER
env gid=GROUP
env umask=022

exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluged -- -d
Replace "USER" with name of the user you want to run Deluge as and "GROUP" with group of the user. I like to run Deluge under my username and group, that way I have full access to the files downloaded through Deluge and to the log files as well. If you do not know your group then refer to this post under “Record the Current State”. Or you could simply create a temporary file using the command “touch temp” and then check the username and group associated with file “temp” using the command ls -al. Below is an explanation of how you can manage access and permission of files downloaded through Deluge (umask parameter):
  • 007 grants full access to the user and members of the group Deluge is running as (in this case Deluge) and prevents access from all other accounts.
  • 022 grants full access to the user Deluge is running as and only read access to other accounts.
  • 000 grants full access to all accounts.

Step 4: Create the Init Script for Deluge Webui

Create the file /etc/init/deluge-web.conf (init script for Deluge webui) and enter the following contents in it:
start on started deluge
stop on stopping deluge

env uid=USER
env gid=GROUP
env umask=027

exec start-stop-daemon -S -c $uid:$gid -k $umask -x /usr/bin/deluge-web
Don’t forget to change "USER" and "GROUP". The same explanation from above applies. The umask parameter here only affects the plugins and logs created by Deluge. A value of "027" grants full access to the user Deluge is running as, read access to members of the group that Deluge is running as and prevents access from all other accounts.

3 Best Standalone Bittorrent Downloaders:

Don’t want to mess with servers? Check these out:
  1. Synology DiskStation 2-Bay (Diskless) DS212 (Black) with Bittorrent Downloader
  2. Synology DiskStation 2-Bay (Diskless) DS212j (White) with Bittorrent Downloader
  3. Buffalo Technology LinkStation Pro 2 TB High Performance (Black)

Step 5: Starting and Stopping Deluge Daemon

You can start and stop Deluge using the following commands:
sudo start deluge
sudo stop deluge
Deluge webui is tied to Deluge daemon and therefore does not normally require manual start stop. But you can still do that manually using the following commands:
sudo start deluge-web
sudo stop deluge-web
Worst that could happen is you might get a message saying that deluge-web is already running. For convenience, you could create bashaliases as described in this post. For example, delugestart could execute sudo start deluge.

Monday, August 26, 2013

Configure PPTP VPN on Ubuntu

Here is a quick tutorial to set up a basic PPTP VPN server on Ubuntu 10.04.
Install necessary packages
sudo aptitude install ppp pptpd iptables
Configure PPTP IP ranges on the server
sudo vim /etc/pptpd.conf
At the bottom of the file add
localip 10.89.64.1

remoteip 10.89.64.100-150
This sets up the PPTP server to use IP 10.89.64.1 while distributing the IP range 10.89.64.100 to 10.89.64.150 to PPTP clients. Change these as you wish as long as they are private IP addresses and do not conflict with IP addresses already used by your server.
Configure DNS servers to use when clients connect to this PPTP server
sudo vim /etc/ppp/pptpd-options
Find lines containing ms-dns and add
ms-dns 8.8.8.8

ms-dns 8.8.4.4
to use Google's DNS service. You can specify other DNS servers if you know their addresses.
Now add a test account
sudo vim /etc/ppp/chap-secrets
Append a line at the bottom
# client    server  secret          IP addresses

test    pptpd   abcd1234    *
Configure NAT for PPTP connections, otherwise you cannot reach anywhere from this server
sudo vim /etc/rc.local
adding to the bottom right before exit 0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Enable IPv4 forwading
sudo vim /etc/sysctl.conf
Uncomment the line
net.ipv4.ip_forward=1
Then reload the configuration
sudo sysctl -p
Done. Reboot to see if everything goes well.

How to Install OpenVPN Access Server on Ubuntu 12.04

Basic Server Setup


In this tutorial, we are using an Ubuntu 12.04 64-bit cloud server. Go ahead and create one to follow along. If you need help with this, you can refer to this tutorial here. After you have started up your cloud server, let's make some adjustments before we install OpenVPN AS. Please follow this guide to prepare our cloud server for installation.

Installing OpenVPN Acess Server


Let's begin by logging in as the root user. From here, download the OpenVPN AS package:
sudo wget http://swupdate.openvpn.org/as/openvpn-as-1.8.4-Ubuntu10.amd_64.deb

The above link is for 64-bit cloud servers since that is what we've decided to use. If by any chance you're using a 32-bit version, the download link would be:
sudo wget http://swupdate.openvpn.org/as/openvpn-as-1.8.4-Ubuntu10.i386.deb

To install OpenVPN AS, enter the following command:
dpkg -i openvpn-as-1.8.4-Ubuntu10.amd_64.deb 

If you are using a 32-bit cloud server, enter the following command instead:
dpkg -i openvpn-as-1.8.4-Ubuntu10.i386.deb

That's it. OpenVPN AS is now installed. However, there are still some things left to do before we can use it. During the installation, OpenVPN has created a default admin user called 'openvpn'. We need to set a password for 'openvpn'. To do that, enter the following command:
sudo passwd openvpn

You'll be prompted to enter your desired password. Make sure your password is secure.

Administration and Client Software Setup


OpenVPN AS web interfaces can be found at:
Admin  UI: https://YourIpAddress:943/admin

Client UI: https://YourIPAddress:943/

Replace "YourIPAddress" with your actual cloud server's IP address. Then, head over to the Client UI to use the access server. You'll see a big bad security warning. But don't be alramed, it is perfectly okay since we've self-signed our server's SSL. Ignore the warning and click Ok/Proceed and you'll be prompted for username and password. Enter 'openvpn' as the username and the password should be what you've set for 'openvpn' before. After filling out username/password, click 'Go' and you'll see a screen like this:

openvpn

Download the 'OpenVPN Connect' software by clicking the link. After it has finished downloading, run it and enter your login credentials. And voilà! You are now connected to your OpenVPN Access Server.

You can login to the Admin UI if you need to make changes to your access server, although default settings works fine.

One more thing: remember that you can use OpenVPN access server with your smartphone? Download the official Android app here and the iOS app here.

Now, have fun with your OpenVPN Access Server!

Sunday, August 25, 2013

Installing ISPCP Omega 1.0.7 On Ubuntu 10.10


1. Download and extract ISPCP from Sorceforge

cd /usr/local/src
wget http://sourceforge.net/projects/ispcp/files/ispCP%20Omega/ispCP%20Omega%201.0.7/ispcp-omega-1.0.7.tar.bz2/download
tar xjvf ispcp-omega-1.0.7.tar.bz2
cd ispcp-omega-1.0.7

2. Now update your system

aptitude update && aptitude upgrade

3. ISPCP needs some software installed, we will do this now

ISPCP's install script is for Ubuntu 10.04 but works just aswell with 10.10
cd docs/Ubuntu
aptitude install $(cat ubuntu-packages-lucid)
You will be asked to enter a new MySql password
You will also need to configure Courier as below
Create web directories -> NO
Type of mail configuration -> Internet Site
System mail name should be populated with your hostname
ProFTPd configuration -> Standalone

4. Build the system using make

cd /usr/local/src/ispcp-omega-1.0.7
make -f Makefile.ubuntu install

5. Copy all the directories to your system and setup

cp -Rv /tmp/ispcp/* /
cd /var/www/ispcp/engine/setup
perl ispcp-setup
The setup defaults should be adequate, you will be required to enter your MySQL password.

6. Clean temporary files

rm -fR /tmp/ispcp
After setup completes you should be able to login to your new control panel.

Install Ajenti (A Web Based Control Panel) for Managing Linux Server

Ajenti is an open source web based system management control panel for managing remotesystem administrating tasks from the web browser much similar to Webmin moduleAjentiis a much powerful and lightweight tool, that provides fast and responsive web interface for managing small server set-ups and also best suitable for VPS and Dedicated servers. It has built with many pre-made plugins for configuring and monitoring server software’s and services such as ApacheCronFile SystemFirewallMySQLNginxMuninSambaFTPSquid and many other tools like File ManagerCode Editor for developers and Terminal access.
Install Ajenti Control Panel
Install Ajenti Control Panel
In this article we’re going to show you how we going to install Ajenti Server Manager tool onRHEL 6.4/6.3/6.2/6.1/6/5.8CentOS 6.4/6.3/6.2/6.1/6/5.8Fedora 19/18/17/16/15/14/13/12Ubuntu 13.04/12.10/12.04/11.10Linux Mint 15/14/13/12and Debian SidDebian Wheezy and Debian Squeeze systems using own ajenti repository.

Installing Ajenti On RHEL/CentOS and Fedora

Ajenti is a third party tool and requires EPEL repositories to be enabled on our system to install dependency packages. Use the given link to install it.
  1. Enable EPEL Repositories
Once enabled, now we can move further to download and install Ajenti’s official repository using “wget” command. If you don’t have “wget” package, install using “yum install wget“.
# wget http://repo.ajenti.org/ajenti-repo-1.0-1.noarch.rpm
# rpm -i ajenti-repo-1.0-1.noarch.rpm
Install the package using “YUM” package manager tool.
# yum install ajenti
Once installation finishes, open “8000” port on firewall/router for remote access of web interface. Open the following file with VI editor.
# vi /etc/sysconfig/iptables
Append the following two lines at the bottom of the file, save and close it.
-A INPUT -p udp -m state --state NEW --dport 8000 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW --dport 8000 -j ACCEPT
Next, restart iptables service.
# service iptables restart

Installing Ajenti On Ubuntu/Debian and Linux Mint

As I said above, Ajenti is not included in the default repository, it needs to be added. So, let’s download and add the ajenti PPA repository to “/etc/apt/sources“.list.
# wget http://repo.ajenti.org/debian/key -O- | apt-key add -
# echo "deb http://repo.ajenti.org/ng/debian main main" >> /etc/apt/sources.list
Once PPA added, update the system and then install the package.
# apt-get update && apt-get install ajenti
To verify, open a web browser and type the IP of the server where we’ve installed Ajenti and enter default username “admin“  or “root” and password is “admin“.
https://localhost:8000
OR

https://ip-address:8000
Login Screen
Ajenti Login Screen
Ajenti Login Screen
Dashboard
Ajenti Dashboard
Dashboard
Plugins
Ajenti Plugins
Ajenti Plugins
Filesystem
Ajenti File System
Filesystem
Firewall
Ajenti Firewall
Firewall
System Packages
Ajenti Package Manager
Packages
Running Processes
Ajenti Processes
Linux Running Processes
File Manager
Ajenti File Manager
Linux File Manager
Running Services
Ajenti Services

Ubuntu Packages

Installing

Ajenti requires ubuntu 12.04 Precise Pangolin. Previous releases might work with Python upgraded.
Add repository key:
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
Add repository to /etc/apt/sources.list:
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
Install the package:
apt-get update && apt-get install ajenti
Start the service:
service ajenti restart

RPM Packages

Installing

Ajenti requires EPEL repositories: http://fedoraproject.org/wiki/EPEL
Add repository key:
wget http://repo.ajenti.org/ajenti-repo-1.0-1.noarch.rpm
rpm -i ajenti-repo-1.0-1.noarch.rpm
Install the package:
yum install ajenti
Start the service:
service ajenti restart

Package does not match intended download?

yum clean metadata