Jumat, 29 April 2011

Ubuntu 10.10 LAN Torrent Seedbox With Avalanche-rt, Lighttpd, Rtorrent, Vsftpd And Samba

This tutorial is based on a LAN setup, but it should also be applicable for an Internet seedbox (e.g. on a vps or rootds), but some additional steps may need to be performed (firewall, securing rpc-mount, generally hardening of the server).

The best lightweight software combination for a seedbox is lighttpd with rtorrent/libtorrent and a nifty web interface. So we use avalanche-rt, an actively developed project which looks very promising.

First step is to install the distribution of your choice on your box. Use a minimal installation if possible. The rest of the steps are Ubuntu specific.

At the end of the installation choose the ssh-server as additional service which should be installed.

After the reboot, first thing we need to do, is to connect to the Internet (if not already).

If you, like me, use a laptop as your server, you may want or need to use a wireless connection to connect to the Internet. You can do this without a graphical interface with the neat tool wicd-curses, an ncurses frontend for wicd.

Get it with (obviously you need to be connected to the Internet to perform this step, so in most cases you need a wired connection for at least this step):

sudo apt-get install wicd-ncurses

Afterwards, you may have to manually start the wicd-daemon:

sudo /etc/init.d/wicd start

Then you should be able to use wicd-curses and connect to your wireless network. If you are connected, perform a system update:

sudo apt-get update && sudo apt-get upgrade

Next, we install some software which makes live a bit more easy:

sudo apt-get install htop mc pydf

htop lets you check you system, mc comes in kind handy when handling a lot of files and pydf gives you nice overview over the space left on your harddrive.

Let’s set up the seedbox:

First step is to install lighttpd and php:

sudo apt-get install lighttpd php5-cgi php5-curl

Then we create a file to test if php is working:

sudo nano /var/www/phpinfo.php

Fill it with:

If you now go to

/phpinfo.php

you will just see a 403 (Forbidden) error

So we have to set up php to work with lighttpd:

sudo nano /etc/php5/cgi/php.ini

Search (strg + w)) for

cgi.fix_pathinfo

and uncomment the line. Save and exit (strg + x).

Next, we configure lighttpd to use php5. Open lighttpd.conf...

sudo nano /etc/lighttpd/lighttpd.conf

and add to the

server.modules

section (right at the beginning of the file)

"mod_fastcgi"

and at the end of the file the following:

fastcgi.server = ( ".php" => (( "bin-path" => "/usr/bin/php5-cgi", "socket" => "/tmp/php.socket" )))

Then restart lighttpd:

sudo /etc/init.d/lighttpd restart

If we now go to

/phpinfo.php

you should see some information about php.

Now we install more rtorrent and other needed software:

sudo apt-get install screen libtorrent11 rtorrent

Get the default-config for rtorrent (we're in our home-directory now):

wget "http://libtorrent.rakshasa.no/export/1135/trunk/rtorrent/doc/rtorrent.rc"

and move it to the right location:

mv rtorrent.rc .rtorrent.rc

Create needed folders:

mkdir downloads
mkdir .session
mkdir torrents-watch
mkdir torrent-files

Next, edit .rtorrent.rc:

nano .rtorrent.rc

Look for

directory =

and uncomment it and change it to your needs (in our case: directory = /home/downloads/).

Next, search for

session

and uncomment it and change it to your needs (in our case: session = /home/.session/).

Go to the end of .rtorrent.rc an insert the following:

#SCGI Serverscgi_port = 127.0.0.1:5001

Save & exit nano (strg + x).

Now we can start rtorrent and check if scgi support is enabled:

rtorrent

You should see something like

"XMPLRPC initialized with 519 functions."

Next step is to enable RPC with lighttpd:

sudo nano /etc/lighttpd/lighttpd.conf

Add to the

server.modules

section the following:

"mod_scgi"

and at the end of the file the following:

#SCGI Serverscgi.server = ("/RPC2" =>( "127.0.0.1" => ("host" => "127.0.0.1","port" => 5001,"check-local" => "disable")))

and reload lighttpd:

sudo /etc/init.d/lighttpd restart

Because this is a LAN setup, we do not protect the RPC-mount with a username / password combination. You will find it on almost every other tutorial out there and you really should protect the RPC-mount-directory with a strong password if you intend to use your seedbox on a server exposed to the Internet. But in our case it is not necessary and just an additional point of failure.

So we now have rtorrent with xmlrpc enabled, and lighttpd with xmlrpc enabled. Now we need the avalanche-rt web interface.

Ubuntu 10.10 LAN Torrent Seedbox With Avalanche-rt, Lighttpd, Rtorrent, Vsftpd And Samba - Page 2

View the original article here

Kamis, 28 April 2011

The Perfect Server - CentOS 5.6 x86_64 [ISPConfig 2]

This tutorial shows how to set up a CentOS 5.6 server (x86_64) that offers all services needed by ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 64-bit version of CentOS 5.6, but should apply to the 32-bit version with very little modifications as well. In the end you should have a system that works reliably, and if you like you can install the free webhosting control panel ISPConfig 2 (i.e., ISPConfig runs on it out of the box).


I will use the following software:

Web Server: Apache 2.2 with PHP 5.1.6 Database Server: MySQL 5.0 Mail Server: PostfixDNS Server: BIND9 (chrooted) FTP Server: ProftpdPOP3/IMAP server: DovecotWebalizer for web site statistics

Please note that this setup does not work for ISPConfig 3! It is valid for ISPConfig 2 only!


I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!


To install such a system you will need the following:


In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.


Boot from your first CentOS 5.6 CD (CD 1) or the first CentOS 5.6 DVD. Press at the boot prompt:


 It can take a long time to test the installation media so we skip this test here:

 

The welcome screen of the CentOS installer appears. Click on Next:


 

Choose your language next:


 Select your keyboard layout:

 I'm installing CentOS 5.6 on a fresh system, so I answer Yes to the question Would you like to initialize this drive, erasing ALL DATA?

 Now we must select a partitioning scheme for our installation. For simplicity's sake I select Remove linux partitions on selected drives and create default layout. This will result in a small /boot and a large / partition as well as a swap partition. Of course, you're free to partition your hard drive however you like it. Then I hit Next:

 Answer the following question (Are you sure you want to do this?) with Yes:

 On to the network settings. The default setting here is to configure the network interfaces with DHCP, but we are installing a server, so static IP addresses are not a bad idea... Click on the Edit button at the top right.

In the window that pops up uncheck Dynamic IP configuration (DHCP) and Enable IPv6 support and give your network card a static IP address (in this tutorial I'm using the IP address 192.168.0.100 for demonstration purposes) and a suitable netmask (e.g. 255.255.255.0; if you are not sure about the right values, http://www.subnetmask.info might help you):

Set the hostname manually, e.g. server1.example.com, and enter a gateway (e.g. 192.168.0.1) and up to two DNS servers (e.g. 8.8.8.8 and 145.253.2.75):  

Choose your time zone Give root a password:


 The Perfect Server - CentOS 5.6 x86_64 [ISPConfig 2] - Page 2

View the original article here

How To Automatically Shut Down Your Computer After A Download Finishes

Sometimes you want to download something but don't want to wait until it finishes so you can shut down the computer. In this case you can use Sentinella. Install it with the following command:

sudo apt-get install sentinella


Now you can see Sentinella under the System menu of your desktop. Launch it and you will see something like this: 


Use the same settings as in the screenshot but make sure you choose your main network interface. Just press the Start button and that's it!



View the original article here

Installing And Using OpenVZ On CentOS 5.6

In this HowTo I will describe how to prepare a CentOS 5.6 server for OpenVZ. With OpenVZ you can create multiple Virtual Private Servers (VPS) on the same hardware, similar to Xen and the Linux Vserver project. OpenVZ is the open-source branch of Virtuozzo, a commercial virtualization solution used by many providers that offer virtual servers. The OpenVZ kernel patch is licensed under the GPL license, and the user-level tools are under the QPL license.


This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web.


This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!


In order to install OpenVZ, we need to add the OpenVZ repository to yum:

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ


The repository contains a few different OpenVZ kernels (you can find more details about them here: http://wiki.openvz.org/Kernel_flavors). The command

yum search ovzkernel


shows you the available kernels:

[root@server1 yum.repos.d]# yum search ovzkernel
...
ovzkernel.i686 : Virtuozzo Linux kernel (the core of the Linux operating system)
ovzkernel.x86_64 : Virtuozzo Linux kernel (the core of the Linux operating system)
ovzkernel-PAE.i686 : The Linux kernel compiled for PAE capable machines.
ovzkernel-PAE-debug.i686 : The Linux PAE kernel compiled with debug config
ovzkernel-PAE-devel.i686 : Development package for building kernel modules to match the PAE kernel.
ovzkernel-debug.i686 : The Linux kernel compiled with debug config
ovzkernel-debug.x86_64 : The Linux kernel compiled with debug config
ovzkernel-devel.i686 : Development package for building kernel modules to match the kernel.
ovzkernel-devel.x86_64 : Development package for building kernel modules to match the kernel.
ovzkernel-ent.i686 : The Linux kernel compiled for huge mem capable machines.
ovzkernel-ent-debug.i686 : The Linux ent kernel compiled with debug config
ovzkernel-ent-devel.i686 : Development package for building kernel modules to match the ent kernel.
ovzkernel-xen.i686 : The Linux kernel compiled for Xen VM operations
ovzkernel-xen.x86_64 : The Linux kernel compiled for Xen VM operations
ovzkernel-xen-devel.i686 : Development package for building kernel modules to match the kernel.
ovzkernel-xen-devel.x86_64 : Development package for building kernel modules to match the kernel.
[root@server1 yum.repos.d]#


Pick one of them and install it as follows:

yum install ovzkernel


This should automatically update the GRUB bootloader as well. Anyway, we should open /boot/grub/menu.lst; the first kernel stanza should now contain the new OpenVZ kernel. The title of that kernel just reads "CentOS". I think it's a good idea to change that title and add something with "OpenVZ" to it so that you know that it's the OpenVZ kernel. Also make sure that the value of default is 0 so that the first kernel (the OpenVZ kernel) is booted automatically instead of the default CentOS kernel.

vi /boot/grub/menu.lst

# grub.conf generated by anaconda## Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a /boot partition. This means that# all kernel and initrd paths are relative to /boot/, eg.# root (hd0,0)# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00# initrd /initrd-version.img#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS OpenVZ (2.6.18-238.5.1.el5.028stab085.5) root (hd0,0) kernel /vmlinuz-2.6.18-238.5.1.el5.028stab085.5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-238.5.1.el5.028stab085.5.imgtitle CentOS (2.6.18-238.el5) root (hd0,0) kernel /vmlinuz-2.6.18-238.el5 ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.18-238.el5.img

Now we install some OpenVZ user tools:

yum install vzctl vzquota


Open /etc/sysctl.conf and make sure that you have the following settings in it:

vi /etc/sysctl.conf

[...]net.ipv4.ip_forward = 1net.ipv4.conf.default.proxy_arp = 0net.ipv4.conf.all.rp_filter = 1kernel.sysrq = 1net.ipv4.conf.default.send_redirects = 1net.ipv4.conf.all.send_redirects = 0net.ipv4.icmp_echo_ignore_broadcasts=1net.ipv4.conf.default.forwarding=1[...]

If you need to modify /etc/sysctl.conf, run

sysctl -p


afterwards.

The following step is important if the IP addresses of your virtual machines are from a different subnet than the host system's IP address. If you don't do this, networking will not work in the virtual machines!


Open /etc/vz/vz.conf and set NEIGHBOUR_DEVS to all:

vi /etc/vz/vz.conf

[...]NEIGHBOUR_DEVS=all[...]

SELinux needs to be disabled if you want to use OpenVZ. Open /etc/sysconfig/selinux and set the value of SELINUX to disabled:

vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - SELinux is fully disabled.SELINUX=disabled# SELINUXTYPE= type of policy in use. Possible values are:# targeted - Only targeted network daemons are protected.# strict - Full SELinux protection.SELINUXTYPE=targeted

Finally, reboot the system:

reboot


If your system reboots without problems, then everything is fine!


Run

uname -r


and your new OpenVZ kernel should show up:

[root@server1 ~]# uname -r
2.6.18-238.5.1.el5.028stab085.5
[root@server1 ~]#

Installing And Using OpenVZ On CentOS 5.6 - Page 2

View the original article here

ISPConfig Monitor App For Android

The ISPConfig Monitor App is for all servers, not only for servers running ISPConfig. With the ISPConfig Monitor App, you can check your server status and find out if all services are running as expected. You can check TCP and UDP ports and ping your servers. In addition to that you can use this app to request details from servers that have ISPConfig installed (please note that the minimum installed ISPConfig 3 version with support for the ISPConfig Monitor App is 3.0.3.3!); these details include everything you know from the Monitor module in the ISPConfig Control Panel (e.g. services, mail and system logs, mail queue, CPU and memory info, disk usage, quota, OS details, RKHunter log, etc.), and of course, as ISPConfig is multiserver-capable, you can check all servers that are controlled from your ISPConfig master server.


For download and usage instructions, please visit http://www.ispconfig.org/ispconfig-3/ispconfig-monitor-app-for-android/.



View the original article here

Firefox 4 Downloaded Over 7 Million Times And Counting

Mozilla team has released the latest version of its flagship product - Firefox 4.

Firefox 4 has been downloaded over 7 million times since its official release. This new avatar of the popular web browser from Mozilla stables makes extensive use of HTML 5 to render web pages. It also uses hardware acceleration when displaying HTML 5 pages - drawing on the power of a computer's graphics processor to improve the speed of complex visuals.


Speed of rendering graphics, loading web pages faster, and better start up times.

Less clutter - Firefox 4 has been re-designed to make it less intrusive, allowing for a much richer web browsing experience.


Panorama - It is intelligent tab grouping at its best. You can group tabs containing similar web pages and switch between the groups. Just press "Ctrl + Alt + E" to move into Panorama mode.


Synchronize your data - This includes your bookmarks, passwords, preferences, and history. In Firefox 3, this was made possible using an addon. However, in Firefox 4, this is an inbuilt feature.

Private browsing - Now you can surf to your hearts content knowing that cookies are not stored on your machine thus giving you a semblance of privacy.


Improved security - Firefox 4 is not vulnerable to cross site scripting attacks as it supports HTTP Strict Transport Security, or HSTS.


Integrated Add-ons, Plugins, Appearance ,and Extensions dialog that opens in its own tab. You can install, uninstall, and manage all your extensions, plugins, and addons from this dialog.


Head over to Mozilla website to download Firefox 4.


View the original article here

Debian Is No Longer Just A Linux Distribution

Debian stable version 6.0 code named "Squeeze" has been released. After 24 months of arduous testing, the Debian team has finally released v 6.0 which brings many firsts among its features. They are -

Technical previews of two new ports which runs on the FreeBSD kernel instead of the Linux kernel. This means FreeBSD will be powering the operating system while the users still get to use all the great tools in the Debian user-land.The Linux kernel has been scrubbed free of all the closed sourse firmware files. In other words, you get a completely Free as in Freedom Linux distribution in Debian 6.0 if you opt to download the package with Linux kernel instead of the FreeBSD kernel. Richard Stallman should definitely be pleased with this one.Boot times have improved drastically because of parallel execution of boot scripts.Most software has been updated to the more modern versions. Linux kernel 2.6.32 , KDE 4.4.5, GNOME 2.30, X.Org 7.5 and over 29,000 other ready to use software packages.
Did you know that Debian supports diverse hardware ranging from Intel 32-bit and 64-bit architecture, Motorola/IBM PowerPC, Sun/Oracle Sparc, MIPS (big-endian & little-endian), Intel Itanium, IBM S/390, and ARM EABI ? That is a total of 9 architectures.

Another really nice feature found in Debian 6.0 is the introduction of what is called "Debian Pure Blends".

Debian pure blends are customized Debian images which cater to a specific user profile. For example, if you wish to install Debian for your kids, you could download Debian-Jr which is specifically customized with children in mind. Similarly there are other pure blends such as Debian Med, Debian Science, Skolelinux and so on.

The Debian installer has also seen minor improvements in the form of easier language and keyboard selections, partitioning disk for RAID, Logical Volumes, and Encrypted systems. And the installer supports a whopping 70 languages.

You can download Debian 6.0 via BitTorrent, jigdo, or HTTP.

[Source : Debian News Release ]


View the original article here