Debianzone http://debianzone.posterous.com Most recent posts at Debianzone posterous.com Tue, 29 Jun 2010 10:46:31 -0700 MySql Database Replication http://debianzone.posterous.com/mysql-database-replication http://debianzone.posterous.com/mysql-database-replication When we search for `Database Replication` we will find lots of tutorials, so here I wont add new one, I am just highlighting one of the best tutorials to refer. http://www.howtoforge.com/mysql_database_replication This article contains simple copy & paste steps to configure MySql replication, if you need more detailed indepth explanation on different configuration settings then go to http://dev.mysql.com/doc/refman/5.0/en/replication.html

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Fri, 23 Apr 2010 18:33:50 -0700 MySQL Stress Test tool http://debianzone.posterous.com/mysql-stress-test-tool http://debianzone.posterous.com/mysql-stress-test-tool Recently we moved a client from virtual host to amazon ec2 3 tier architecture then we thought of providing benchmark test report to show the Improvement, then we searched for simple straight forward tools, but we haven`t found, then I started to write a java code to benchmark by stressing mysql server. It performed well, so being a fan of open source, thought of releasing that code and uploaded it to google code. Here is the link Downloadable binary is not yet posted you need to compile it from source code If you come across any bugs or improvements please feed us back. Screenshots [caption id="" align="alignnone" width="535" caption="Test server, you need to start server on all servers from where u need to test "]
Media_httplh3ggphtcom_ecgbq
[/caption] [caption id="" align="alignnone" width="574" caption="Monitoring server with MySQL admin while testing "]
Media_httplh5ggphtcom_cekbb
[/caption]

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Tue, 06 Apr 2010 11:08:00 -0700 Script to start a instance in amazon ec2 http://debianzone.posterous.com/script-to-start-a-instance-in-amazon-ec2 http://debianzone.posterous.com/script-to-start-a-instance-in-amazon-ec2

This script is used to start a instance in ec2, you can extended this script in the way you want, we keep on posting new scripts to work with ec2

#!/bin/bash

export EC2_HOME=/home/sandeep/ec2/ec2-api-tools-1.3-46266
PATH=$EC2_HOME/bin:$PATH
export EC2_PRIVATE_KEY=/home/sandeep/ec2/pk-XXXXXXXXXXXXXXXXXXXXXXXX.pem
export EC2_CERT=/home/sandeep/ec2/cert-XXXXXXXXXXXXXXXXXXXXXXXX.pem
export EC2_URL=https://us-east-1.ec2.amazonaws.com
export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre/

export amiid="ami-0d5db264"
export key="xxxxsshkeyxxxx"
export zone="us-east-1d"
export id_file="/home/sandeep/ec2/keyxxx.pem"
export group="default"

#
# Start the instance
#
echo Launching AMI ${amiid}
${EC2_HOME}/bin/ec2-run-instances ${amiid} -z ${zone}
                         -k ${key} --group ${group}  > /tmp/a
if [ $? != 0 ]; then
   echo "Error starting instance for image" ${amiid}
   exit 1
fi
export iid=`cat /tmp/a | grep INSTANCE | cut -f2`

#
# Loop until the status changes to 'running'
#
sleep 30
echo Starting instance ${iid}
export RUNNING="running"
export done="false"
while [ $done == "false" ]
do
   export status=`${EC2_HOME}/bin/ec2-describe-instances ${iid} | grep INSTANCE | cut -f6`
   if [ $status == ${RUNNING} ]; then
      export done="true"
   else
      echo Waiting...
      sleep 10
   fi
done
echo Instance ${iid} is running

Please feel free to post any comments or errors XX

 

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Wed, 17 Mar 2010 17:16:00 -0700 Page level caching using nginx http://debianzone.posterous.com/page-level-caching-using-nginx http://debianzone.posterous.com/page-level-caching-using-nginx

Many of our dynamic sites contain rarely updated content (ex. blog archive page). By adding nginx server as proxy server infront of your apache server you can server those pages like static pages instead of running the page for every request, this will boost your site speed from 50% - 400%. We need apache, nginx to work with this tutorial To install nginx on debian please follow this link http://timothybowler.com/2009/11/25/compiling-nginx-on-debian-lenny/ Note: Dont install using aptitude it contains older version where gzip and proxy module not available, Modify apache ports.conf to run apache on port 8080 Add this lines to default site of nginx [shell]

server { listen 80; server_name debianzone.com; location / { proxy_pass http://debianzone.com:8080; proxy_cache debianzone-cache; proxy_cache_valid 200 302 60m; proxy_cache_valid 404 1m; } } [/shell] Add this in http section of nginx.conf[shell] http { proxy_cache_path /var/www/cache levels=1:2 keys_zone=debianzone-cache:8m max_size=1000m inactive=600m; proxy_temp_path /var/www/cache/tmp; }

[/shell]

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Wed, 09 Dec 2009 10:07:34 -0800 Chrome released for debian distros http://debianzone.posterous.com/chrome-released-for-debian-distros http://debianzone.posterous.com/chrome-released-for-debian-distros Finally google released chrome browser for debian based distros. After running for hours i feel its stable and working fine Download Google chrome for Debian For developers it has developer tools which looks like firebug, but it`s not so power full like firebug, to open developer tools click
ctrl + shift + i
It also supports extensions and themes At present i can say it as just an alternate browser, but not total replacement for firefox, let me test the stability of chrome for some more time
Media_httpimgzemantac_chagp

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Tue, 08 Dec 2009 09:25:58 -0800 RAID and LVM on Amazon EC2 (part I) http://debianzone.posterous.com/raid-and-lvm-on-amazon-ec2-part-i http://debianzone.posterous.com/raid-and-lvm-on-amazon-ec2-part-i This is the first part of three articles I'm posting for a great storage solution using RAID, LVM and Amazon Elastic Block Store (EBS). First, you need to choose your RAID implementation. Personally, I prefer to use RAID 5 on Amazon EC2, combined with LVM2. For setting a RAID 5 up and running you will need to raise at least 3 EBS volumes and attach them to your instance (let’s say: sdb1, sdb2, sbd3). Using mdadm you will setup your RAID array (/dev/md1): $ mdadm --create /dev/md1 --level=raid5 \
> --chunk=64 --parity=left-symmetric \
> --raid-devices=3 /dev/sdb1 /dev/sdb2 /dev/sdb3
(if it doesn’t work, try forcing with the param --force). Wait for the sync to finish. For monitoring the sync operation, keep an eye on /proc/mdstat with a simple cat: $ cat /proc/mdstat After synced, create the filesystem: $ mkfs.ext3 -b 4096 -R stride=16 /dev/md1 (of course, you can create the filesystem of your choice here). Mount it: $ mkdir /path/where/you/wish/to/mount # this step is not required if you already have your path to mount the RAID $ mount –t ext3 /dev/md1 /path/where/you/wish/to/mount If you want to mount it at the boot:$ mdadm --detail --scan > /etc/mdadm/mdadm.conf Add a line to your /etc/fstab: # <file system> <mount point>                 <type>  <options> <dump>  lt;pass> /dev/md1        /path/where/you/wish/to/mount ext3    defaults 0       2 Please, note that all these commands must be run as root. Usually, at initialization mdadm can get confused when trying to scan your devices. Make sure you have a line “DEVICE” in the top of your / etc/mdadm/mdadm.conf and if it’s properly set. Not always the value “partitions” works fine, so try to be specific. Examples: DEVICE /dev/sdb[1-3] -- OR – DEVICE /dev/sdb1 /dev/sdbx  # where x is your device numberI hope these tips can be of some help. Soon, I'll be posting the next part, where I'll talk about LVM. Cheers!

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Tue, 08 Dec 2009 09:07:54 -0800 Porting Debian to Amazon EC2 for HPC http://debianzone.posterous.com/debian-hpc-at-amazon-ec2 http://debianzone.posterous.com/debian-hpc-at-amazon-ec2 Few months ago, I was challenged to build a High Performance Computing (HPC) instance on Amazon EC2 and the first thing that came in my mind was: which Linux distribution would fit on such requirements. I must confess I'm pretty much adept to Debian, but I was forced to be unbiased and start researching for better options for achieving my goal. Also because the environment I was going to port was already running Debian, but the application's traffic growth was increasing at high speed and it seemed something was going on with that server. Why not Debian? Well, I had to choose some distribution where I could have my packages being compiled locally to comply with a few standards, like packages must be compiled specifically for the processor they're running under, improve at compilation how programs make their calculations and it can be done only knowing exactly where you're running your program, and more. Unfortunately, Debian maintains their packages pre-compiled, which means that they don't know where they're installing into, so they're compiled with generic options and it can be a performance issue when talking about millions of users connected to your Apache. Let's say that if the package takes 50KB of memory per request more than a package specifically compiled to the computer set it's running under, for each 5000 users connected to my application I'll need more 240MB of RAM. Well, things get bit harder if we multiply this by 10 and so on. This thing was upsetting me, I didn't want to simply abandon Debian without doing some research before. I found great distros to fulfill my requirements, such as Gentoo or Slackware... but I was leaving Debian... Then I was about to really adopt Gentoo to achieve my goal, when I was talking to a friend of mine (which also is a Debian addict) and he said that it was possible to recompile packages locally with not much efforts and close (not that much, actually) to the Gentoo's portage. And then I found apt-build. It was pretty good! Despite the fact it took the whole week to recompile the whole distribution, it works pretty fine and I could get pretty close to my objective. Well, it was not that easy to get things exactly the way I wanted, but finally I could see it was possible. Why Debian? Indeed, I could really drop Debian and start using Gentoo or Slackware easily. But I had to be persistent to figure out a way to keep using Debian. Why? Well, package management is quite stable, I like the way they manage versions and Debian is a distribution I trust for years. Despite the fact I can get support very easy on the net and if I really need something installed quickly or if it's a non-regular service I can still using aptitude (or apt-get). The Result After much work and efforts, I got an AMI with a high-tuned Debian inside. A clean and base install of Debian GNU/Linux 5.0.3 Lenny. Right now, I just have the 32 bit for m1.small and c1.medium, but soon I will get a 64 bit done. Features Kernel, RamDisk, Kernel modules and Filesystem Userspace:
  • Uses the Canonical 2.6.28-12-xen-i386 Kernel (aki-21f01148) patched to be used on Debian Lenny.
  • Uses the Canonical 2.6.28-12-xen-i386 RAM Disk (ari-3bf01152) patched to be used on Debian Lenny.
  • All 2.6.28 kernel modules installed and running.
  • Updated with Fuse 2.8.1.
Improved Performance:
  • All installed Debian Packages _recompiled_ with GCC 4.3.2 and libc6 (xen and i686) for improved performance using Optimization level 3 (read more about GCC optmization options at http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html and http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html) and:
  • march=i686 (set PentiumPro instructions. Amazon EC2 - currently, Intel Xen 2.6GHz single core emulation - processor and Kernel in use are 686 compliant, but Debian packages are compiled as i386 for generic usage).
  • mfpmath=sse and msse for scalar floating point instructions to increase applications' speed and avoid the default 387 instability problems.
  • ffast-math to increase processor speed with math optimizations (Note that I used this flag only on IEEE and ISO math operation compliant applications. Don't use it if you're not sure if your application is compliant to IEEE and ISO specifications for math operations).
  • Still, I didn't skip the debugging output (-g), so if you realize that any package is performing weirdly, please, debug it and let me know commenting in this post. I will fix it and raise a new AMI with the fix.
  • Kernel modules recompiled from the source (2.6.28.10) retrieved from www.kernel.org, optimized to the Amazon's Xen environment. All security patches applied.
Packages:
  • Packages up-to-date.
  • OpenBSD SSH and Linux Screen for remote administration.
  • OpenSSL and CA Certificates for SSL and TLS support.
  • Amazon EC2 first boot script.
  • Amazon EC2 Tools 1.3.
  • Unused packages fully purged from system.
Security:
  • Shadow passwords enabled.
  • root password locked. Remote access is made only using the Keypair used to launch the instance.
  • ssh PasswordAuthentication disabled.
Conclusion I have proven to myself I could really have Debian running for an HPC environment smoothly, what  makes me even prouder of this distro. If you want to check the result, the AMI ID is ami-2d759644. If you do so, I'd be glad to hear from you.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sat, 05 Dec 2009 11:59:40 -0800 Changing host name of Linux server http://debianzone.posterous.com/changing-host-name-of-linux-server http://debianzone.posterous.com/changing-host-name-of-linux-server To change the host name of current session use
/bin/hostname your-host-name
To change the host name permanently use
/etc/hostname
/etc/init.d/hostname.sh start

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sun, 29 Nov 2009 08:57:59 -0800 Tools to monitor linux apache server http://debianzone.posterous.com/tools-to-monitor-linux-apache-server http://debianzone.posterous.com/tools-to-monitor-linux-apache-server The following tools are usefull to linux administration and monitoring RRDTool: RRDtool is the OpenSource industry standard, high performance data logging and graphing system for time series data. Use it to write your custom monitoring shell scripts or create whole applications using its Perl, Python, Ruby, TCL or PHP bindings.
Media_httpossoetikerc_kmfwv
AWStats: AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages.
Media_httpawstatssour_hfcec
Analog: Analog is a program to measure the usage on your web server. It tells you which pages are most popular, which countries people are visiting from, which sites they tried to follow broken links from, and all sorts of other useful information.
Media_httpwwwchiarkgr_jdbbv
Piwik: Piwik is a downloadable, open source (GPL licensed) web analytics software program. It provides you with detailed real time reports on your website visitors: the search engines and keywords they used, the language they speak, your popular pages… Piwik aims to be an open source alternative to Google Analytics. Piwik is a PHP MySQL software program that you download and install on your own webserver. At the end of the five minute installation process you will be given a JavaScript tag. Simply copy and paste this tag on websites you wish to track (or use an existing plugin to do it automatically for you).

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sat, 28 Nov 2009 17:47:33 -0800 Free ubuntu CD http://debianzone.posterous.com/free-ubuntu-cd http://debianzone.posterous.com/free-ubuntu-cd If you are facing problem in downloading large files of linux distibutions, Ubuntu is giving a great offer, you can request free CDs from ubuntu it is totally free and ships to any part of world. Request Free CD

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sat, 28 Nov 2009 17:38:27 -0800 Mail alert for ssh login http://debianzone.posterous.com/mail-alert-for-ssh-login http://debianzone.posterous.com/mail-alert-for-ssh-login To get a mail when some logged into your linux system then follow this steps Edit .bashrc in root folder /root [shell] vi .bashrc [/shell] Add following line at end of the file [shell] echo 'ALERT - Root Shell Access (server name) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" yourmail@gmail.com[/shell]

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sat, 28 Nov 2009 14:16:55 -0800 Intel poulsbo Drivers for Ubuntu http://debianzone.posterous.com/intel-poulsbo-drivers-for-ubuntu http://debianzone.posterous.com/intel-poulsbo-drivers-for-ubuntu Many people after installing Ubuntu for the first time or after Kernel update facing the problems with display drivers of Intel Poulsbo chipset. Here is steps to repair your display For new installation: Update aptitude sources
vi /etc/apt/sources.list
and add this lines
  • deb http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main
  • deb-src http://ppa.launchpad.net/ubuntu-mobile/ppa/ubuntu jaunty main
Then
apt-get update
apt-get install xserver-xorg-video-psb
For people facing problem with display after updating kernel use this
sudo dpkg-reconfigure psb-kernel-source

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sat, 28 Nov 2009 14:04:56 -0800 Installing Ubuntu on NetBook (Dell Mini) http://debianzone.posterous.com/installing-ubuntu-on-netbook-dell-mini http://debianzone.posterous.com/installing-ubuntu-on-netbook-dell-mini In netbooks we wont found CD Drive so Installing ubuntu or any OS is a bit diffciult. So for the people who are looking for installing ubuntu on Netbooks with preinstalled Microsoft OS, I am going to explain you, how to install ubuntu using USB UNetbootin: UNetbootin allows for the installation of various Linux/BSD distributions to a partition or USB drive, so it's no different from a standard install, only it doesn't need a CD. It can create a dual-boot install, or replace the existing OS entirely.

Creating bootable USB

Creation of the bootable USB Ubuntu installation really could not be easier. UNetbootin is a standalone utility which when run lets the user select from any support distribution flavor and version. The target USB key is also selected and after pressing OK the distribution is downloaded, unarchived, the USB key formatted and the distribution copied to the USB key and made bootable. All of this is handled for the user. Steps to install ubuntu in Dell Mini
  1. Insert USB Key in Dell Mini USB port
  2. Boot Dell Mini and press ‘0’ on the boot-up screen
  3. Ubuntu Live boots and double-clicking on the Install icon on the desktop gets the process started.
  4. After the very few and simple prompts are answered the installation runs for a while and when completed you are prompted to reboot. When rebooting the USB key is removed and you now have a nice Ubuntu installation.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne
Sat, 28 Nov 2009 13:50:46 -0800 Debian / Ubuntu Apache SSL Configuration http://debianzone.posterous.com/debian-ubuntu-apache-ssl-configuration http://debianzone.posterous.com/debian-ubuntu-apache-ssl-configuration Hey you are planning to start a e-commerce website, then you must know about SSL without which no one will trust your website as a safe place to use their cards… What is SSL? SSL (Secure Socket Layer) is a protocol used for secure data transfer. This is done by using private keys and certificates. A private key is used to encrypt the data which you are sending and the server can only decrypt this data with the private key available with it, A certificate is used to authentic yourself before proceeding. So we need two things to make our website secure for online transactions. In this article i will explain how to generate a private key, certificate request with open-ssl and apache, get certificate from CA (Certificate Authority), configure your server to respond for ssl requests. Different types of certificates Before going to configuration I will explain about the different types of certificates available in the market and when to use which. The certificates are mainly divided into High Assurance and Low Assurance, High assurance is needed for sites dealing with financial transactions, low assurance is needed for internal corporate networks or small websites and mainly used for secure login to site and sending sensitive documents securely. Remember every byte you are sending through http protocol means non-ssl layer can be seen or accessed by anyone. Configuration: I used Apache 2, Debian Linux, Openssl for this configuration. First step is to install Apache: Go to console mode [shell]aptitude install apache2 [/shell] next install openssl to generate keys and certificates or certificate requests [shell]aptitude install openssl [/shell] next generate certificate request and key using openssl [shell]openssl req -new -nodes -keyout linuxforu.key -out linuxforu.csr[/shell] Here you want to fill up details like Country code, State, City, Company name, the most important thing is common name, it must be same as your website name (suppose you website is www.linuxforu.com then the common name must be linuxforu.com). This will generate two files in your directory one is a private key file (myserver.key) and another one is certificate request file (myserver.csr) Now you need to get a certificate from some certificate vendors like verisign or comodo or anyother of your choice. The certificate request which we already generated is used to get this the certificate vendors will ask you to paste the certificate request. Comodo is providing a free trail certificate which is valid for 3 months. (Comodo Free Trail). Remember every certificate has some validity after that if we use the same certificate browser will through security error. After getting the certificates you want to enable ssl module in apache and configure it [shell]a2enmod ssl vi /etc/apache2/sites-available/default[/shell] [shell]ServerName linuxforu DocumentRoot /var/www/ SSLEngine On SSLCertificateFile /etc/apache2/ssl/linuxforu.cert SSLCertificateKeyFile /etc/apache2/ssl/linuxforu.key[/shell] [shell]Options Indexes FollowSymLinks AllowOverride All Order deny,allow Allow from all[/shell] Then restart your server [shell]/etc/init.d/apache2 restart[/shell] We all know that a default http request will be sent to port 80, in the same way default https request will be forwarded to port 443 so we configured the server for listening 443 port. You are done now access your website with https://server.com If you face any problems you want to check this things first Whether the server is hearing port 443 or not to find this type [shell]lsof -i tcp:443[/shell] Next check whether your port 443 is forwarded or not. If you face any new problems other than this please post a comment and we will try to solve it.

Permalink | Leave a comment  »

]]>
http://files.posterous.com/user_profile_pics/894020/a9105079458196173bfc8734807b32ed.jpeg http://posterous.com/users/4xlDDq0UWIA9 Sandeep Manne smanne Sandeep Manne