Wednesday, November 13, 2013

Install Quota and Sieve Plugin for Dovecot Mailserver

To use Quota, you will first need to make sure you are using Dovecot's deliver for delivering incoming mail to users' mailboxes. Then, you need to enable the Quota plugin in your dovecot.conf

First we will start with configuring PostfixAdmin To Enable Quota Limits,

vim /var/www/postfixadmin/config.inc.php

$CONF['quota'] = 'YES';
$CONF['used_quotas'] = 'YES';
$CONF['new_quota_table'] = 'YES';

These enable the quota configuration within PostfixAdmin.

The "quota" field in the table mailbox is the user quota limit which postfixadmin enters in Megabytes and is stored in bytes.
The "maxquota" field in the domain table is the domain quota limit.
The SuperAdmin within PostfixAdmin has control over these values.

Enabling Quota Mailbox Limits in Dovecot,

Install Dovecot LDA and SASL for Postfix Mailserver

The Dovecot LDA is a local delivery agent which takes mail from an MTA and delivers it to a user's mailbox.

Key features :-

1. Mailbox indexing during mail delivery which provides faster mailbox access later.
2. Quota enforcing by a plugin.
3. Sieve language support by a plugin.

Here I will explain how to configure Dovecot as your LDA/MDA having MTA running under Postfix. And also I will cover giving Quota and sieve support to Dovecot.

The Mail server installation can be followed from the link below,
postfix-mailserver

The above documentation uses Postfix itself as LDA and this should be modified as explained below.

First we need to add the following to the master file,

vim /etc/postfix/master.cf

dovecot unix - n n - - pipe
  flags=DRhu user=dovecot:dovecot argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}

Now we need to tell postfix to use dovecot as LDA,

Friday, November 8, 2013

Maildrop Installation on Postfix Server

Maildrop is a Mail delivery agent used by Mail Servers mostly for its filtering functionality. Maildrop reads a mail message from standard input, then delivers the message to your mailbox.

Mailserver installation can be followed from the links below ..

postfix-dovecot

Here I will explain how to configure maildrop with postfix for filering SPAM mails to Junk folder.

First we need to install Perl Compatible Regular Expression software with utf8 support.

For that download the package from the link below,

wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.zip

unzip pcre-8.33.zip
cd pcre-8.33

./configure --enable-utf
make
make install

Monday, November 4, 2013

Installing Liferay on JBoss 7

Today I will explain how to deploy liferay portal on JBoss 7. For this I am using a linux based system.

First we start by installing jdk.
Download the jdk from java.net from the link below,

wget http://download.java.net/jdk6/6u38/promoted/b04/binaries/jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin?q=download/jdk6/6u38/promoted/b04/binaries/jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin

Install the jdk in /usr/lib/jdk6/ , by unzipping and extracting the downloaded jdk to this folder.
Now create user jboss,
useradd -m jboss

su - jboss

vim /home/jboss/.profile

export PATH
JAVA_HOME=/usr/lib/jdk6/
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
JBOSS_HOME=/opt/liferay/jboss
export JBOSS_HOME

source /home/jboss/.profile

Saturday, October 19, 2013

Mailman Mailing List with Postfix

Mailman is free mailing list manager for managing electronic mail discussions and  newsletter lists. It is widely used mailing list manager which supports supports built-in archiving, automatic bounce processing, content filtering, digest delivery, spam filters.

Here I will explain how to install and configure mailman on a linux system.

First download the latest pack from the link below,

wget http://ftp.gnu.org/gnu/mailman/mailman-2.1.15.tgz

useradd -m /usr/local/mailman mailman
chmod 02775 /usr/local/mailman

apt-get install python-dev

tar -zxvf mailman-2.1.15.tgz
cd mailman-2.1.15

I am running my web server as apache user, having gid = 48.

./configure --with-cgi-gid=48 --with-mail-gid=mailman
make
make install

Saturday, October 12, 2013

Autoresponder for roundcube postfixadmin

Here I will explain configuring autoreply in roundcube.

Create a mysql database table in the mail server database. Here I am using postfixadmin database, so create as metioned below,

mysql -u root
use postfix;

CREATE TABLE `autoresponder` (
`email` varchar(255) NOT NULL default '',
`descname` varchar(255) default NULL,
`from` date NOT NULL default '0000-00-00',
`to` date NOT NULL default '0000-00-00',
`message` text NOT NULL,
`enabled` tinyint(4) NOT NULL default '0',
`force_enabled` tinyint(4) NOT NULL default '0',
`subject` varchar(255) NOT NULL default '',
PRIMARY KEY (`email`),
FULLTEXT KEY `message` (`message`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Grant privileges to the users,
mysql -u root
mysql> GRANT SELECT,INSERT,UPDATE ON postfix.autoresponder TO  autoresponder IDENTIFIED BY 'autoresponder.pass';
mysql> GRANT SELECT ON postfix.mailbox TO autoresponder;
mysql> exit;

Thursday, October 10, 2013

SPF + DKIM for postfix

SPF allows administrators to specify which hosts are allowed to send email from a given domain by creating a specific DNS SPF record in the public DNS.

Mailserver installation and amavis mail filerings can be followed from the links below ..

postfix-dovecot
amavisd-clamav-spamassassin

For giving SPF support without recompling postfix follow the below steps ..

cpan Mail::SPF Sys::Hostname::Long

Now download the spf perl version,

wget https://launchpad.net/postfix-policyd-spf-perl/trunk/release2.010/+download/postfix-policyd-spf-perl-2.010.tar.gz

tar -zxvf postfix-policyd-spf-perl-2.010.tar.gz

cd postfix-policyd-spf-perl-2.010

mkdir /usr/lib/postfix

Wednesday, October 2, 2013

Amavisd Clamav Spamassassin with Postfix

Amavis is an interface between MTAs like Postfix, Sendmail or Exim  and mail filters like ClamAV, SpamAssassin. It is efficient to run with amavis than running separate daemons like spamd.

Mailserver installation can be followed from this link postfix-dovecot

First we will start with amavisd installation,

wget http://www.ijs.si/software/amavisd/amavisd-new-2.8.0.tar.gz
tar -zxvf amavisd-new-2.8.0.tar.gz
useradd amavis -m /var/amavis
mkdir /var/amavis/tmp /var/amavis/var /var/amavis/db /var/amavis/home
chown -R amavis:amavis /var/amavis
chmod -R 750 /var/amavis
mkdir /usr/local/src/
cd /usr/local/src/
mv amavisd-new-2.8.0 /usr/local/src/amavisd
cd /usr/local/src/amavisd
cp amavisd /usr/local/sbin/
chown root /usr/local/sbin/amavisd
chmod 755  /usr/local/sbin/amavisd
cp amavisd.conf /etc/
chown root:amavis /etc/amavisd.conf
chmod 640 /etc/amavisd.conf

mkdir /var/virusmails
chown amavis:amavis /var/virusmails
chmod 750 /var/virusmails


Friday, September 27, 2013

Postfix Mysql Dovecot Mail Server Installation

Today I will explain how to configure postfix mysql dovecot mailing system with smtp authentication. For this I am using a debian based system.

First start with mysql installation,

apt-get install mysql-server libmysqlclient-dev

Install latest openssl package.
http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar -zxvf openssl 1.0.1e.tar.gz
cd openssl 1.0.1e
./config shared
make
make install

Saturday, July 6, 2013

Web monitoring with zabbix


A detailed explanation of zabbix server and client installation and its concepts are mentioned in the below links.

 Zabbix Installation
 Basic Concepts

Here I will explain how to monitor a website, Its downloading speed and successful logins.

For web monitoring we need to,
Create a Host from the configuration tab.
create an application for that host and name it as web_sitename or whatever.
Then go to "web" from configuration tab, From there you can create new scenario.

We need to specify,
1. application name
2. Scenario name
3. Update interval
4. Agent (any listed browser)
5. variable ( Can give username and password as variables )
      For example {user}=admin
                            {password}=zabbix

Sunday, June 30, 2013

How to monitor with zabbix

The concept of zabbix is little different, its time consuming to understand its working. You can find the installation procedures of zabbix server and client from the link below.

zabbix installation                                                                                    

After the installation, log in with the admin username and password. From the administration tab we can create new user groups and users.
Next to that in Mediatype tab where we can configure smtp server, sms modems and jabber gateways for each groups and for each users.
And from  the configuration tab we can create new hosts, provide ips and link specfic templates (contains Items for common operating systems checks, such as Linux, Solaris, MAC OS X and Windows systems) and save it. Their will be many built in template from which we can choose or we can import a specific template from xml file.
Each template may contain built in applications like (CPU, Filesystems, Security etc) and under each application their will be built in items which can be considered the "data collectors". Custom scripts can also be created as items.

Friday, June 21, 2013

Zabbix installation on linux

Zabbix is the ultimate open source availability and performance monitoring solution. It is designed to monitor and track the status of various network services, servers, and other network hardware.

Here I will explain how to install zabbix server and client on linux ubuntu based system.

First download the latest zabbix 2.0.6 package from the link below, 
                                                                                                                     

wget http://citylan.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.0.6/zabbix-2.0.6.tar.gz

Before compiling and installing the package, we need to install the below mentioned dependencies.. For that issue the below command,

apt-get install build-essential mysql-server libmysqlclient15-dev php5 php5-gd php5-mysql snmp libsnmp-dev snmpd libcurl4-openssl-dev fping

Sunday, June 16, 2013

openssh server with openssl 1.0.1


Download openssl package from below step
apt-get install make gcc
tar -zxvf openssl-1.0.1.tar.gz                                                                      
cd openssl-1.0.1
./config shared && make && make install
ln -s /usr/local/ssl/bin/openssl /usr/bin/
openssl version

Tuesday, June 4, 2013

ISPConfig Installation on linux

ISPConfig is an open source hosting control panel for Linux based servers and is licensed under BSD. ISPConfig allows administrators to manage websites, e-mail addresses and DNS records through a web-based interface. It also holds other login levels like reseller, client and emailuser.

With ISPConfig we can manage single/multiple servers from one controlpanel. Handle web, mail, dns, clustering, virtualisation management with openvz, website statistics etc.

Here I will explain how to install ISPConfig on a fresh ubuntu based linux system.

First we need to install the openssh server,For that issue the below command,
apt-get install openssh-server

Configure an ip and a hostname for your server and edit /etc/hosts, in my case

192.168.1.100 station1.tech.com

Now,
vim /etc/hostname
station1.tech.com

/etc/init.d/hostname restart

For ISPConfig to install correctly, remove the symlink /bin/sh which point to /bin/dash.
For that
dpkg-reconfigure dash
Install dash as /bin/sh?    <- No

Friday, May 24, 2013

GitLab installation on linux

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Initially designed and developed by Linus Torvalds for Linux kernel development.

Here I will explain how to install,
       
Git - version control system
GitLab - Self hosted Git management software
Gitclient - TortoiseGit

For this I am using a fresh Ubuntu based system and the steps are explained below ..

Install Redis-server

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

Download the latest package from the link below,

wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz

Thursday, May 16, 2013

svn installation on linux


Subversion is an universally recognized and adopted open-source centralized version control system and is used in the development of many software projects.

Here I will explain the installation procedures for the latest subversion software and some configuration related to it along with the installation of web based subversion administration interface.
                                                                                                   
I am going to explain the two methods of subversion installation on a fresh ubuntu server.

First method is the stock installation from ubuntu repository,

Install Subversion, Apache and Subversion server modules for Apache by issuing the below commands,

apt-get install apache2 libapache2-svn subversion

Thats it !!

But I prefer the installing from source, ( Method Two )

Sunday, May 12, 2013

Redmine installation on linux


Redmine is a flexible project management web application written in the Ruby on Rails framework, it is cross-platform and cross-database and is an open source project released under the terms of the GNU General Public License v2 (GPL).

Redmine requires Ruby on Rails support which is an open source web application framework that runs on the Ruby programming language.

Here I am going to explain how to install Redmine 2.3.X with the latest rails (3.2) support in a source compiled method on a fresh ubuntu based linux server.

First we need to install all the dependencies for building ruby on rails, For that issue the following commands,

apt-get update
apt-get install gcc g++ mysql-server libmysqlclient-dev libssl-dev zlibc

Now we can start installing Ruby,
Download the latest package from the link below

ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz

Thursday, May 9, 2013

Openvas installation on linux

OpenVAS is a framework of several services and tools offering a comprehensive and powerful vulnerability scanning and vulnerability management solution.

Here I am going to explain how to install openvas using source complied method on debian lenny flavour,
For that edit the source.list file the /etc/apt folder and add the following line.

deb http://archive.debian.org/debian/ lenny contrib main non-free 

apt-get update
Install the dependencies ..
apt-get install bison flex
tar -zxvf cmake.tar.gz
./configure
make && make install
apt-get install libglib2.0-0  libglib2.0-dev

Wednesday, May 8, 2013

Speed up your webservers


Here I will explain how to optimize a webserver for faster communication between the server and browser clients using compression and caching methods.

APACHE
Apache achives this by gziping the webcontents before transfer using deflate module and by enabling caching of static files at client browsers for a particular period.

For compressing ..

Load deflate module to apache using apxs utility by issuing the following command,

apxs -c -i -a mod_deflate.c

Load header module by issuing the following command,

apxs -c -i -a mod_headers.c

restart apache, and list out the loaded modules

Monday, May 6, 2013

Nagios Installation on Linux


Nagios is an Open Source monitoring solution that started a phenomenon and continues to provide dependable monitoring to hundreds of thousands of organizations worldwide.

Here I will explain how to install nagios server and clients and its various plugins.

Nagios Server Installation

Install the following dependencies ..

apt-get update
apt-get install gcc make apache2 php5

Now download the latest nagios core and plugin from the link below ..
nagios-3.5.0.tar.gz
nagios-plugins-1.4.16.tar.gz

start installation,

Saturday, May 4, 2013

Load balanced mysql cluster installation


MySQL Cluster is a real-time open source transactional database designed for fast, always-on access to data under high throughput conditions.

Here I will explain how to setup a mysql cluster environment in load balanced scenario. For that I am using 3 nodes.
One Management node and Two Data/SQL nodes. I am also using this management node for load balancing.

Management node - 192.168.26.1
SQL nodes - 192.168.26.2/192.168.26.3

Download latest stable linux Generic MySQL Cluster 7.2.12 from the link below.
mysql-cluster-gpl-7.2.12-linux2.6-i686.tar.gz

First we can setup cluster Management node [ server(ndb_mgmd) / client (ndb_mgm) ]

mkdir /usr/src/
cd /usr/src
tar -zxvf mysql-cluster-gpl-7.2.12-linux2.6-i686.tar.gz
cd mysql-cluster-gpl-7.2.12-linux2.6-i686
mv bin/ndb_mgm /usr/bin
mv bin/ndb_mgmd /usr/bin
chmod 755 /usr/bin/ndb_mg*

Thursday, May 2, 2013

openvpn installation on ubuntu

OpenVPN is a Virtual Private Networking (VPN) solution.  It is flexible, reliable and secure. It belongs to the family of SSL/TLSand not IPSec. It uses Public Key Infrastructure (PKI) to encrypt VPN traffic between nodes.

Here I am going to explain how we can install bridged and tunneled openvpn under ubuntu.

Open vpn server installation.
apt-get update

apt-get install openvpn

Now copy the easy-rsa directory to /etc/openvpn folder

mkdir /etc/openvpn/easy-rsa/
cd /usr/share/doc/openvpn/examples/easy-rsa/2.0/
cp -r * /etc/openvpn/easy-rsa/
chown -R root /etc/openvpn/easy-rsa/

Install tomcat native for faster processing

Here we will discuss about giving Tomcat Native support,

Apache 2.4 intallation can be followed from this link
apache 2.4 installation

Tomcat native is a package for using the apache apr libraries for faster processing.

Download the package from this url  tomcat-native-1.1.27-src.tar.gz

tar -zxvf tomcat-native-1.1.27-src.tar.gz

cd tomcat-native-1.1.27-src/jni/native

./configure --with-apr=/usr/local/bin/apr-1-config --with-java-home=/usr/lib/java/ --with-ssl=/usr/local/ssl/ --prefix=/usr/share/tomcat6/


jk_module for source compiled apache 2.4


Apache 2.4 intallation can be followed from this link
apache 2.4 installation

After the successful installation of apache 2.4, we can give jk mount support by following the below steps

Download the tomcat-connector source from the below link

tomcat-connectors-1.2.37-src.tar.gz
then,

tar -zxvf  tomcat-connectors-1.2.37-src.tar.gz
cd  tomcat-connectors-1.2.37-src/native
LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure --with-apxs=/usr/local/bin/apxs
make
make install


Tuesday, April 16, 2013

Apache 2.4 Installation


In this I will explain how to install apache 2.4 on linux based systems.
First, Check httpd is installed or not
rpm -qa | grep httpd
If httpd on the system
rpm -e httpd

 Create a user apache with group apache
# groupadd -g 48 apache
# useradd -u 48 -g 48 -G users -s /bin/nologin -d /dev/null -m apache

 Download http source ball
# cd /opt/src
Compile http from tar ball
# tar -zxvf httpd-2.4.3.tar.gz
# tar -zxvf apr-1.4.6.tar.gz
# mv apr-1.4.6 httpd-2.4.3/srclib/apr
# tar -zxvf apr-util-1.4.1.tar.gz
# mv apr-util-1.4.1 httpd-2.4.3/srclib/apr-util 

Asterisk on linux


vim /etc/apt/source.list
deb http://ftp.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.debian.org/debian/ lenny main contrib non-free
apt-get install linux-headers-`uname -r` libc6-dev zlib1g-dev bison openssl libssl-dev libasound2 libasound2-dev libslang2-dev libnewt-dev libncurses5-dev binutils cpp-4.1 gcc-4.1 libstdc++6-4.1-dev g++ make libpq5 libapr1 libexpat1 libaprutil1 libxml2 fxload libusb-dev libiksemel-dev zlib-bin libc6-dev libbluetooth2-dev libxml2-dev
Downloading necessary packages: LIBPRI, DAHDI, AND ASTERISK
Libpri Installation

Recover a MySQL root password


If we forgot the mysql root password, don't worry. We can update the mysql root passord by following the below mentioned steps ..

Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.
# /etc/init.d/mysql stop
# mysqld_safe –skip-grant-tables &
# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD(“newrootpassword”) where User=’root’;
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql stop
# /etc/init.d/mysql start

Now we can give the  newrootpassword as root passwd for mysql. That is ,

#mysql -u  root -p
#newrootpasswor
 mysql>

How to mount tomcat using mod_jk on linux


Mod jk is a module used in apache for mountinfg the applications running on apache tomcat to apache and also unmounting for its own servings. Mod jk can be configured in ubuntu based systems by following the below steps.

Configure mod_jk with Apache in Ubuntu
1. Install mod_jk: To install mod_jk in ubuntu execute the following command on the command line.
sudo apt-get install libapache2-mod-jk
2. Enable mod_jk loading: Create a link in /etc/apache2/mods-enabled/jk.load which points to /etc/apache2/mods-available/jk.load. This will enable loading mod_jk module in apache when apache is restarted.
3. Create mod_jk conf file: Create a mod_jk conf file and place it in /etc/apache2/mods-available/jk.conf
# Where to find workers.properties
# Update this path to match your conf directory location
JkWorkersFile /etc/apache2/jk_workers.properties
# Where to put jk logs
# Update this path to match your logs directory location
JkLogFile /var/log/apache2/mod_jk.log

Takeout a table from a full mysql database dump


vim MyDumpSplitter.sh
#!/bin/sh
#SPLIT DUMP FILE INTO INDIVIDUAL TABLE DUMPS
# Text color variables
txtund=$(tput sgr 0 1)    # Underline
txtbld=$(tput bold)       # Bold
txtred=$(tput setaf 1)    # Red
txtgrn=$(tput setaf 2)    # Green
txtylw=$(tput setaf 3)    # Yellow
txtblu=$(tput setaf 4)    # Blue
txtpur=$(tput setaf 5)    # Purple
txtcyn=$(tput setaf 6)    # Cyan
txtwht=$(tput setaf 7)    # White
txtrst=$(tput sgr0)       # Text reset

uninstall a perl module in linux

For removing a perl module from your linux system just create a pl file as mentioned below.
vim removeperlmodules.pl
#!/usr/bin/perl
use ExtUtils::Packlist;
use ExtUtils::Installed;
$ARGV[0] or die “Usage: $0 Module::Name\n”;
my $mod = $ARGV[0];
my $inst = ExtUtils::Installed->new();
foreach my $item (sort($inst->files($mod))) {
print “removing $item\n”;
unlink $item;
}
my $packfile = $inst->packlist($mod)->packlist_file();
print “removing $packfile\n”;
unlink $packfile;
usage –>
perl removeperlmodules.pl mod::ule

This will uninstall the  mod::ule from the system.

Perl module version check


vim mod_version.pl
#!/usr/bin/perl
use ExtUtils::Installed;
my ($inst) = ExtUtils::Installed->new();
my (@modules) = $inst->modules();
foreach $mod(@modules)
{
$version = $inst->version($mod);
printf(“%-35s %-15s \n”, $mod , $version);
}
usage –>
perl mod_version.pl mod::ule

Mail sending via perl


vim mail.pl
#!/usr/bin/perl -w
use strict;
use Mail::Sender;
my $filename = $ARGV[0];
my $smtp = “192.168.1.1″;
my $subj = “Hello”;
my $toaddr = ‘totest@test.com;
my $fromaddr = ‘fromtest@test.com’;
my $body = “Hello Administrator, Attached is the report. Thank you.”;

count no of rows in all mysql tables


vim count.sh
#!/bin/bash
db=$1
connect=”mysql -u root $db –skip-column-names”
for tbl in `$connect -e “show tables;”`
do
result=`$connect -e “select count(*) from $tbl;”`
echo -e “$tbl —— $result”
done
usage –>
./count.sh <database>

awstat for web tracking

AWstat is a free real-time logfile analyzer to get advanced statistics ..

Here I will explain how to install it by downloading your version of awstat.

Untar the package by issuing the below command,
tar -zxvf /var/Packages/awstats-7.0.tar.gz
mv awstats-7.0  /usr/local/awstats

Enter a new virtual hosts in the apache configuration,
vim /etc/httpd/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot “/usr/local/awstats/wwwroot”
ServerName awstats.test.com
ErrorLog “logs/awstats-error_log”
CustomLog “logs/awstats-access_log” common

Install PDNS in debian

Here I will explain how to install pdns in linux debian.
apt-get update
apt-get install gcc g++ make libncurses5-dev
Mysql Installation:
groupadd mysql
useradd -g mysql -d  /var/mysql  -m mysql
tar –xvzf  mysql-5.1.62.tar.gz
cd  mysql-5.1.62
./configure –prefix=/usr/local –localstatedir=/var/mysql/data –with-charset=latin1 /
–with-extra-charsets=none –with-tcp-port=3306 –enable-assembler –without-debug /
–with-unix-socket-path=/tmp/mysql/unix.sock–enable-static –with-mysqld-user=mysql \
–enable-thread-safe-client –enable-shared –with -plugins=partition,innobase
make && make install

Mysql 5.1* installation

Check mysql is installed or not
rpm -qa | grep mysql
If mysql on the system
rpm -e mysql
Create a user mysql with group mysql
# groupadd -g 501 mysql
# useradd -u 501 -g 501 -G users -s /bin/bash -d /var/mysql -m mysql
Download Mysql source ball
# mkdir /var/mysql/src
# cd /var/mysql/src/
# wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
# chown -R mysql.mysql /var/mysql/src/

mysql 5.5 in Debian


groupadd mysql
useradd mysql -s /bin/bash -m /var/mysql -g mysql
chown -R mysql.mysql /var/mysql/data
apt-get install cmake gcc g++ automake
tar -zxvf mysql-5.5.24.tar.gz
cd mysql-5.5.24/
cmake . -DMYSQL_DATADIR=/var/mysql/data -DCMAKE_INSTALL_PREFIX=/usr/local/ -DINSTALL_LAYOUT=STANDALONE -DENABLED_PROFILING=ON -DMYSQL_MAINTAINER_MODE=OFF -DWITH_DEBUG=OFF

Install LDAP + SAMBA on linux


First Install Samba
# apt-get install samba samba-doc smbclient
vim smb.conf
[global]
# Domain name ..
workgroup = TECH.COM
# Server name – as seen by Windows PCs ..
netbios name = TECH.COM
# Be a PDC ..
domain logons = Yes
domain master = Yes
# Be a WINS server ..
wins support = true
obey pam restrictions = Yes
dns proxy = No
os level = 35
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
pam password change = Yes