Sunday, September 25, 2011

Debian / Ubuntu Linux: Configure Network Bonding [ Teaming / Aggregating NIC ]

NIC teaming is nothing but combining or aggregating multiple network connections in parallel. This is done to increase throughput, and to provide redundancy in case one of the links fails or Ethernet card fails. The Linux kernel comes with the bounding driver for aggregating multiple network interfaces into a single logical interface called bond0. In this tutorial, I will explain how to setup bonding under Debian Linux server to aggregate multiple Ethernet devices into a single link, to get higher data rates and link failover.



View the Original article

Prevent Ubuntu from asking a password after resuming from Hibernate or Suspend

When you close the lid of your laptop and Ubuntu is running, the computer goes into Suspend mode. Same goes for chosing Hibernate from the shutdown menu, when the laptop goes into deep sleep and consumes less power. When resuming from these two states, Ubuntu will ask you for your password. If you’d like to get rid of this password field, you need to launch gconf-editor and navigate to apps > gnome-power-manager > lock. There you’ll find a checkbox for hibernate and one for suspend. Uncheck these and close the Configuration Editor. Next time you resume from Suspend and Hibernate, you won’t be prompted for a password.
You can still manually lock your screen before closing the lid by using Ctrl

View the Original article

How To Set Up SSL Vhosts Under Nginx + SNI Support (Ubuntu 11.04/Debian Squeeze)

Enable the vhost and reload nginx:

cd /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/www.hostmauritius.com.vhost www.hostmauritius.com.vhost
/etc/init.d/nginx reload

 

4 Creating A Self-Signed Certificate

Before we set up our SSL vhost, we need an SSL certificate. I will now show you how to create your own self-signed certificate. With this certificate, you will get browser warnings, but this certificate is required to get a trusted certificate from a trusted CA later on.

Make sure that the package ssl-cert is installed:

apt-get install ssl-cert

You can now create a self-signed certificate for www.hostmauritius.com as follows:

make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/www.hostmauritius.com.crt

You will be asked for the hostname:

Host name: <-- www.hostmauritius.com

This will create the self-signed certificate and the private key in one file, /etc/ssl/private/www.hostmauritius.com.crt:

cat /etc/ssl/private/www.hostmauritius.com.crt

-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAsxOSdUsiEcay6M8EpSu5eeC797v/TpDRGnui4uaYd/YpjrPhPWW01FEIpaCixYb5U2uMuvFOlmZhyfer

View the Original article

Continuous Deployment With Jenkins And Rex

To build Rex you need the following dependencies:

build-essential libexpat1-dev libssh2-1-dev zlib1g-dev libssl-dev

Don't forget to install Rex and Rex::Apache::Deploy on your Jenkins server as well. You need at least Rex 0.19.0 and Rex::Apache::Deploy 0.7.0.

 

Installing Tomcat

Install it on: CI Server

At first we will install Jenkins. Fire up a shell and use apt-get to installtomcat6 and tomcat6-admin. If you want, you can use this howto that shows youhow to install Tomcat with Rex and jump to Step 2 "Deploying Jenkins".

sudo apt-get install tomcat6 tomcat6-admin

Now open the file /etc/tomcat6/tomcat-users.xml and replace the content with the following.


View the Original article

Mounting Remote Directories With SSHFS On Debian Squeeze

#

 

3 Using SSHFS As rootserver1:

Now I want to mount the remote directory /home/backup (on server2, owned by server2's root user) to the local /backup directory as the local root user.

First add root to the fuse group:

adduser root fuse

Create the local /backup directory and make sure it's owned by root (it should be anyway as you are running these commands as root):

mkdir /backup
chown root /backup

Then mount the remote /home/backup directory to /backup:

sshfs -o idmap

View the Original article

PHP-FPM/Nginx Security In Shared Hosting Environments (Debian/Ubuntu)

If you want to use nginx and PHP-FPM for shared hosting environments, you should make up your mind about security. In Apache/PHP environments, you can use suExec and/or suPHP to make PHP execute under individual user accounts instead of a system user like www-data. There's no such thing for PHP-FPM, but fortunately PHP-FPM allows us to set up a "pool" for each web site that makes PHP scripts execute as the user/group defined in that pool. This gives you all the benefits of suPHP, and in addition to that you don't have any FTP or SCP transfer problems because PHP scripts don't need to be owned by a specific user/group to be executed as the user/group defined in the pool.

I do not issue any guarantee that this will work for you!

 

1 Preliminary Note

I use a vhost called www.example.com/example.com here with the document root /var/www/www.example.com/web.

You should have a working LEMP installation, as shown in these tutorials:

Installing Nginx With PHP5 And MySQL Support On Debian Squeeze Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 11.04

A note for Ubuntu users:

Because we must run all the steps from this tutorial with root privileges, we can either prepend all commands in this tutorial with the string sudo, or we become root right now by typing

sudo su

 

2 What We Have So Far

On Debian/Ubuntu, PHP-FPM's pool directory is /etc/php5/fpm/pool.d/ - this is where new pools will be created. The php.ini used by PHP-FPM is /etc/php5/fpm/php.ini. There's one pool already, www.conf - let's take a look at it:

vi /etc/php5/fpm/pool.d/www.conf

; Start a new pool named 'www'.; the variable $pool can we used in any directive and will be replaced by the; pool name ('www' here)

View the Original article