Hi friends
This article explains the basic configuration of sendmail. In this example, i use the sendmail package from the RHEL 5 and use mailserver.example.com(192.168.10.2) and dns1.example.com(192.168.10.1) as fqdn for this mail server and dns server. Lemme give you the step by step procedure for building the sendmail server.
1. Install the sendmail package:
# yum install sendmail
2. Check the Existence of package:
# rpm -qa | grep sendmail
sendmail-cf-8.13.8-2.el5
sendmail-.13.8-2.el5
3. Services:
# chkconfig --level 345 sendmail on
# service sendmail start|stop|restart|status or
# /etc/init.d/sendmail start|stop|restart|status
4. Sendmail configuration file :
# /etc/mail/sendmail.cf //main sendmail config file
# /etc/mail/sendmail.mc //file used to edit and push the updates to the main file
All configuration changes can be done only at /etc/mail/sendmail.mc and with the help of macro push it to the file /etc/mail/sendmail.cf
5. Macro m4 :
To find the macro path
# locate cf.m4
/usr/share/sendmail-cf/m4/cf.m4
#m4 /usr/share/sendmail-cf/m4/cf.m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
and then restart to make the changes to take effect.
6. Disabling line in /etc/mail/sendmail.mc file:
These statements are disabled by dnl commenting.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
This statement is incorrectly disabled:
# DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
This statement is active:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
7. DNS Server
The proper implementation of DNS server is important before configuring the sendmail. Please test the dns name resoultion with the tools like nslookup, host and dig tool.In this eg, consider the dns1.example.com (192.168.10.1) as primary dns server.
# host dns1.example.com
dns1.example.com has address 192.168.10.1
#host mailserver.example.com
mailserver.example.com address 192.168.10.2
8. Check /etc/resolv.conf file:
make sure /etc/resolv.conf file contains the correct dns server details
# vi /etc/resolv.conf
localdomain example.com
nameserver 192.168.10.1
9. Check /etc/hosts file:
# vi /etc/hosts
127.0.0.1 mailserver.example.com localhost.localdomain localhost mailserver
10. Edit /etc/mail/sendmail.mc file:
First, using dnl disable the line like
dnl "DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')"
Second, disable the smarthost option
dnl define(`SMART_HOST',`mail.my-site.com')
Use macro and restart the sendmail daemon
Check the local NIC card is enabled for receive all packets by
# netstat -an | grep :25 | grep tcp
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
11. Edit /etc/mail/access file:
# vi /etc/mail/access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.30 REJECT // rejects the mails from 192.168.30.0 n/w
192.168.20.5 RELAY // relay the mails from the host 192.168.20.5
192.168.10 RELAY // relay the mails from 192.168.10.0 n/w
example.com RELAY // relay the mails from the suffix example.com
12. Edit /etc/mail/local-host-names file:
add hostnames or domain names for which the sendmail accept mail for local delivery.
# vi /etc/mali/local-host-names
example.com
otherdomain.com
13. Edit /etc/mail/virtusertable file:
# vi /etc/mail/virtusertable
// first column is the target email address
// second column may be created user mailbox in the mailserver, aliase name or groupname created in the /etc/aliase or even remote email address.
logu@example.com logu // logu - local user
sonia@example.com sonia
test@example.com test
testaliase@example.com testaliase // testaliase entry created in /etc/aliase
@example.com error:nouser User Unknown // answer for other than the above user
14. Edit /etc/aliases file:
add the below lines at the bottom of the file
# vi /etc/aliases
..........
..........
#setting new aliase
testaliase: logu,test
As per virtusertable above, the mail to testaliase@example.com will go to logu@example.com and sonia@example.com.
15. Configuring POP3/IMAP :
By configuring the sendmail for pop3/imap, we will be able to acces mail from thunderbird, evolution, Outlook, etc.
First, check the existence of dovecot and services using
# chkconfig --level 345 dovecot on
# service dovecot start|stop|restart|status or
# /etc/init.d/dovecot start|stop|restart|status
Second, edit the /etc/dovecot.conf file
# vi /etc/dovecot.conf
........
//search for protocols
//protocols = imap imaps pop3 pop3s
protocols = pop3 // configure pop3 or imap as per your need
........
........
Third, test the NIC listening for pop3 using,
# netstat -a | egrep -i 'pop|imap'
tcp 0 0 *:pop3 *:* LISTEN
Fourth, use Outlook or any client tool to test the mail flow.
16. Troubleshooting via telnet:
Please refer this article in my blog.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Showing posts with label Linux - Fedora and Redhat. Show all posts
Showing posts with label Linux - Fedora and Redhat. Show all posts
Saturday, November 24, 2007
Thursday, November 22, 2007
Bugzilla
Bugzilla is server software designed to help you manage software development. It is a bug tracking tool.
1. Download
Download the bugzilla tar ball from the link http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.0.2.tar.gz.
2. Install Perl and some dependent modules.
Install Perl v5.6.0 and above. The perl comprises large number of modules and deploying the bugzilla need some modules to be configured prior.
Required Perl modules:
1. CGI 2.93 or CGI 3.11 if using mod_perl
2. Date::Format (2.21)
3. DBI (1.41)
4. DBD::mysql (2.9003) if using MySQL
5. DBD::Pg (1.45) if using PostgreSQL
6. File::Spec (0.84)
7. Template (2.12)
8. Email::Send (2.00)
9. Email::MIME::Modifier (any)
Optional Perl modules:
1. GD (1.20) for bug charting
2. Template::Plugin::GD::Image (1.20) for Graphical Reports
3. Chart::Base (1.0) for bug charting
4. GD::Graph (any) for bug charting
5. GD::Text (any) for bug charting
6. XML::Twig (any) for bug import/export
7. MIME::Parser (5.406) for bug import/export
8. LWP::UserAgent (any) for Automatic Update Notifications
9. PatchReader (0.9.4) for pretty HTML view of patches
10. Image::Magick (any) for converting BMP image attachments to PNG
11. Net::LDAP (any) for LDAP Authentication
12. SOAP::Lite (any) for the web service interface
13. HTML::Parser (3.40) for More HTML in Product/Group Descriptions
14. HTML::Scrubber (any) for More HTML in Product/Group Descriptions
15. Email::MIME::Attachment::Stripper (any) for Inbound Email
16. Email::Reply (any) for Inbound Email
17. mod_perl2 (1.999022) for mod_perl
18. CGI (2.93) for mod_perl
19. Apache::DBI (0.96) for mod_perl2
CPAN is the best tool for installing the perl modules.
# perl -MCPAN -e shell
Once the Perl interpreter has loaded (and been configured), you can install modules by issuing the command install MODULENAME.please use /var/spool/CPAN as the primary location for building the CPAN repository. The interpreter will ask for more options and preferably provide with the default values. After getting lot of inputs, it ends with the prompt "cpan>".
The first thing you should do is upgrade your CPAN:
cpan> install Bundle::CPAN (take's time to complete)
Once it's done, type:
cpan> reload cpan
Now, enter the following command to retrieve all of the required modules:
cpan> install MODULENAME
eg.,
cpan> install DBI
cpan> install DBD::mysql
2. Install MySQL version 3.23.41 or later.
3. Install Apache Webserver - "httpd".
4. Install Sendmail 8.7 or later.
5. Final Check for prerequisites before deploying bugzilla source
Start mysql,sendmail and apache service
#perl -v
#mysql -V
In browser : http://localhost (should have apache test page)
At this point, conclude that prerequisites for bugzilla installation is done.
6. Unpack bugzilla
# cd /var/www/html/
# tar zxvf bugzilla-2.18rc3.tgz
# mv bugzilla-2.18rc3/ bugzilla/ (for simplicity purpose)
7. Checking the perl modules by script
# cd /var/www/html/bugzilla
# ./checksetup.pl
Executing the script gives the status of the perl modules installed.Try to install the modules that failed the test and rerun the script.(Even after installing some modules, it may show failed test for some optional perl modules.There is no problem start continuing the next step)
8. Create a DB account for bugzilla user
# mysql
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY 'enterpassword';
mysql> FLUSH PRIVILEGES;
9. Edit the bugzilla config file:
# vi /var/www/html/bugzilla/localconfig
search for $db_pass and replace with 'enterpassword'
10. Last Compile ./checksetup.pl (it will ask for bugzilla's administrative account details at the end)
11. Edit apache configuration file:
# vi /etc/httpd/conf/httpd.conf
a. uncomment the line "AddHandler cgi-script .cgi"
b. add the below two lines.
Document root
.......
Options ExecCGI FollowSymLinks <---- add this line.
AllowOverride Limit <---- add this line.
.......
/document root
c. add "index.cgi" in the below line
DirectoryIndex index.html index.html.var index.cgi
#/etc/init.d/httpd restart
12. Open browser http://localhost/bugzilla , gives you the home page of the bugzilla application successfully.
Please mail me if you have any questions.
Logu
logu_microsoft@hotmail.com
91-98414-99143
1. Download
Download the bugzilla tar ball from the link http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.0.2.tar.gz.
2. Install Perl and some dependent modules.
Install Perl v5.6.0 and above. The perl comprises large number of modules and deploying the bugzilla need some modules to be configured prior.
Required Perl modules:
1. CGI 2.93 or CGI 3.11 if using mod_perl
2. Date::Format (2.21)
3. DBI (1.41)
4. DBD::mysql (2.9003) if using MySQL
5. DBD::Pg (1.45) if using PostgreSQL
6. File::Spec (0.84)
7. Template (2.12)
8. Email::Send (2.00)
9. Email::MIME::Modifier (any)
Optional Perl modules:
1. GD (1.20) for bug charting
2. Template::Plugin::GD::Image (1.20) for Graphical Reports
3. Chart::Base (1.0) for bug charting
4. GD::Graph (any) for bug charting
5. GD::Text (any) for bug charting
6. XML::Twig (any) for bug import/export
7. MIME::Parser (5.406) for bug import/export
8. LWP::UserAgent (any) for Automatic Update Notifications
9. PatchReader (0.9.4) for pretty HTML view of patches
10. Image::Magick (any) for converting BMP image attachments to PNG
11. Net::LDAP (any) for LDAP Authentication
12. SOAP::Lite (any) for the web service interface
13. HTML::Parser (3.40) for More HTML in Product/Group Descriptions
14. HTML::Scrubber (any) for More HTML in Product/Group Descriptions
15. Email::MIME::Attachment::Stripper (any) for Inbound Email
16. Email::Reply (any) for Inbound Email
17. mod_perl2 (1.999022) for mod_perl
18. CGI (2.93) for mod_perl
19. Apache::DBI (0.96) for mod_perl2
CPAN is the best tool for installing the perl modules.
# perl -MCPAN -e shell
Once the Perl interpreter has loaded (and been configured), you can install modules by issuing the command install MODULENAME.please use /var/spool/CPAN as the primary location for building the CPAN repository. The interpreter will ask for more options and preferably provide with the default values. After getting lot of inputs, it ends with the prompt "cpan>".
The first thing you should do is upgrade your CPAN:
cpan> install Bundle::CPAN (take's time to complete)
Once it's done, type:
cpan> reload cpan
Now, enter the following command to retrieve all of the required modules:
cpan> install MODULENAME
eg.,
cpan> install DBI
cpan> install DBD::mysql
2. Install MySQL version 3.23.41 or later.
3. Install Apache Webserver - "httpd".
4. Install Sendmail 8.7 or later.
5. Final Check for prerequisites before deploying bugzilla source
Start mysql,sendmail and apache service
#perl -v
#mysql -V
In browser : http://localhost (should have apache test page)
At this point, conclude that prerequisites for bugzilla installation is done.
6. Unpack bugzilla
# cd /var/www/html/
# tar zxvf bugzilla-2.18rc3.tgz
# mv bugzilla-2.18rc3/ bugzilla/ (for simplicity purpose)
7. Checking the perl modules by script
# cd /var/www/html/bugzilla
# ./checksetup.pl
Executing the script gives the status of the perl modules installed.Try to install the modules that failed the test and rerun the script.(Even after installing some modules, it may show failed test for some optional perl modules.There is no problem start continuing the next step)
8. Create a DB account for bugzilla user
# mysql
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY 'enterpassword';
mysql> FLUSH PRIVILEGES;
9. Edit the bugzilla config file:
# vi /var/www/html/bugzilla/localconfig
search for $db_pass and replace with 'enterpassword'
10. Last Compile ./checksetup.pl (it will ask for bugzilla's administrative account details at the end)
11. Edit apache configuration file:
# vi /etc/httpd/conf/httpd.conf
a. uncomment the line "AddHandler cgi-script .cgi"
b. add the below two lines.
.......
Options ExecCGI FollowSymLinks <---- add this line.
AllowOverride Limit <---- add this line.
.......
/document root
c. add "index.cgi" in the below line
DirectoryIndex index.html index.html.var index.cgi
#/etc/init.d/httpd restart
12. Open browser http://localhost/bugzilla , gives you the home page of the bugzilla application successfully.
Please mail me if you have any questions.
Logu
logu_microsoft@hotmail.com
91-98414-99143
Basic DNS Server - BIND
Hi friends,
This article gives you the basic configuration of Dns-bind server in linux distribution. In this example i have used the chroot bind package.
1. Install the DNS Package (either regular BIND or with BIND chroot):
Check the existence with the command
# rpm -qa | grep bind
ypbind-1.19-7.el5
bind-chroot-9.3.3-7.el5
bind-libs-9.3.3-7.el5
bind-utils-9.3.3-7.el5
bind-9.3.3-7.el5
2. Services:
# chkconfig --list | grep named
# chkconfig --level 345 named on
# /etc/init.d/named start|stop|status|restart or
# service named start|stop|status|restart
3. Firewall - open dns Port:
Open the tcp & udp port 53 from the firewall for the inbound DNS name resolution.
4. vi /etc/hosts:
Set proper name for the dns server host as shown below
127.0.0.1 dns1 localdomain.loalhost localhost dns1.example.com
5. Common location of dns configuration files:
In regular BIND server
named.conf file --> /etc/named.conf
zone files --> /var/named/
In chroot BIND server
named.conf file --> /var/named/chroot/etc/named.conf
zone files --> /var/named/chroot/var/named/
6. Getting the Test Sample File:
Find test sample file configuration using the locate command.
for eg.,
# locate named.conf
# locate .zone
7. For simpler configuration create a symbolic link as
# ln -s /var/named/chroot/etc/named.conf /etc/named.conf
8. configuring : /etc/named.conf
// options for configuring the forwarders
options {
forwarders { 200.200.200.200; };
statistics-file "/var/named/data/named_stats.txt" ;
dump-file "/var/named/data/cache_dump.db" ;
directory "/var/named" ;
};
// root hints details
zone "." {
file "/var/named/named.root";
type hint;
};
// Forward lookup zone details
zone "example.com" IN {
type master;
file "example.com.zone";
allow-update { none; };
};
// reverse lookup zone details
zone "10.168.192.in-addr.arpa" IN {
type master;
file "10.168.192.zone";
allow-update { none; };
};
9. configuring : /var/named/chroot/var/named/example.com.zone
# vi /var/named/chroot/var/named/example.com.zone
ORIGIN example.com.
$TTL 86400
@ IN SOA dns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns1.example.com.
IN MX 10 mail.example.com.
IN A 192.168.10.1
dns1 IN A 192.168.10.1
server2 IN A 192.168.10.2
client1 IN A 192.168.10.3
server1 IN CNAME dns1
mail IN CNAME server2
10. configuring : /var/named/chroot/var/named/10.168.192.zone
# vi /var/named/chroot/var/named/10.168.192.zone
$ORIGIN 10.168.192.in-addr.arpa.
$TTL 86400
@ IN SOA dns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns1.example.com.
1 IN PTR dns1.example.com.
2 IN PTR server2.example.com
3 IN PTR client1.example.com
11. Restart the "named" Services.
12. Client side configuration :
In Linux Client:
# vi /etc/resolv.conf
nameserver 192.168.10.1
domain example.com
In Windows Client:
Configure the preferred DNS server with DNS server ip address (192.168.10.1).
13. Check the name resolution with the following tool
nslookup
host
dig
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
This article gives you the basic configuration of Dns-bind server in linux distribution. In this example i have used the chroot bind package.
1. Install the DNS Package (either regular BIND or with BIND chroot):
Check the existence with the command
# rpm -qa | grep bind
ypbind-1.19-7.el5
bind-chroot-9.3.3-7.el5
bind-libs-9.3.3-7.el5
bind-utils-9.3.3-7.el5
bind-9.3.3-7.el5
2. Services:
# chkconfig --list | grep named
# chkconfig --level 345 named on
# /etc/init.d/named start|stop|status|restart or
# service named start|stop|status|restart
3. Firewall - open dns Port:
Open the tcp & udp port 53 from the firewall for the inbound DNS name resolution.
4. vi /etc/hosts:
Set proper name for the dns server host as shown below
127.0.0.1 dns1 localdomain.loalhost localhost dns1.example.com
5. Common location of dns configuration files:
In regular BIND server
named.conf file --> /etc/named.conf
zone files --> /var/named/
In chroot BIND server
named.conf file --> /var/named/chroot/etc/named.conf
zone files --> /var/named/chroot/var/named/
6. Getting the Test Sample File:
Find test sample file configuration using the locate command.
for eg.,
# locate named.conf
# locate .zone
7. For simpler configuration create a symbolic link as
# ln -s /var/named/chroot/etc/named.conf /etc/named.conf
8. configuring : /etc/named.conf
// options for configuring the forwarders
options {
forwarders { 200.200.200.200; };
statistics-file "/var/named/data/named_stats.txt" ;
dump-file "/var/named/data/cache_dump.db" ;
directory "/var/named" ;
};
// root hints details
zone "." {
file "/var/named/named.root";
type hint;
};
// Forward lookup zone details
zone "example.com" IN {
type master;
file "example.com.zone";
allow-update { none; };
};
// reverse lookup zone details
zone "10.168.192.in-addr.arpa" IN {
type master;
file "10.168.192.zone";
allow-update { none; };
};
9. configuring : /var/named/chroot/var/named/example.com.zone
# vi /var/named/chroot/var/named/example.com.zone
ORIGIN example.com.
$TTL 86400
@ IN SOA dns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns1.example.com.
IN MX 10 mail.example.com.
IN A 192.168.10.1
dns1 IN A 192.168.10.1
server2 IN A 192.168.10.2
client1 IN A 192.168.10.3
server1 IN CNAME dns1
mail IN CNAME server2
10. configuring : /var/named/chroot/var/named/10.168.192.zone
# vi /var/named/chroot/var/named/10.168.192.zone
$ORIGIN 10.168.192.in-addr.arpa.
$TTL 86400
@ IN SOA dns1.example.com. hostmaster.example.com. (
2002022401 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns1.example.com.
1 IN PTR dns1.example.com.
2 IN PTR server2.example.com
3 IN PTR client1.example.com
11. Restart the "named" Services.
12. Client side configuration :
In Linux Client:
# vi /etc/resolv.conf
nameserver 192.168.10.1
domain example.com
In Windows Client:
Configure the preferred DNS server with DNS server ip address (192.168.10.1).
13. Check the name resolution with the following tool
nslookup
host
dig
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Sunday, November 18, 2007
Linux/UNIX Basic Commands - Part 2
Hi Friends,
Here is the continuation of the topic Linux/UNIX Basic Commands Part 1.
SSH:
ssh user@host – connect to host as user
ssh -p port user@host – connect to host on port as user
ssh-copy-id user@host – add your key to host for user to enable a keyed or passwordless login
Searching:
grep pattern files – search for pattern in files
grep -r pattern dir – search recursively for pattern in dir
command | grep pattern – search for pattern in the output of command
locate file – find all instances of file
Compression:
tar cf file.tar files – create a tar named file.tar containing files
tar xf file.tar – extract the files from file.tar
tar czf file.tar.gz files – create a tar with Gzip compression
tar xzf file.tar.gz – extract a tar using Gzip
tar cjf file.tar.bz2 – create a tar with Bzip2 compression
tar xjf file.tar.bz2 – extract a tar using Bzip2
gzip file – compresses file and renames it to file.gz
gzip -d file.gz – decompresses file.gz back to file
Network:
ping host – ping host and output results
whois domain – get whois information for domain
dig domain – get DNS information for domain
dig -x host – reverse lookup host
wget file – download file
wget -c file – continue a stopped download
Installation
Install from source:
./configure
make
make install
dpkg -i pkg.deb – install a package (Debian)
rpm -ivh pkg.rpm – install a package (RPM)
yum install pkgname - using the yum tool
Shortcuts:
Ctrl+C – halts the current command
Ctrl+Z – stops the current command, resume with fg in the foreground or bg in the background
Ctrl+D – log out of current session, similar to exit
Ctrl+W – erases one word in the current line
Ctrl+U – erases the whole line
Ctrl+R – type to bring up a recent command
!! - repeats the last command
exit – log out of current session
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Here is the continuation of the topic Linux/UNIX Basic Commands Part 1.
SSH:
ssh user@host – connect to host as user
ssh -p port user@host – connect to host on port as user
ssh-copy-id user@host – add your key to host for user to enable a keyed or passwordless login
Searching:
grep pattern files – search for pattern in files
grep -r pattern dir – search recursively for pattern in dir
command | grep pattern – search for pattern in the output of command
locate file – find all instances of file
Compression:
tar cf file.tar files – create a tar named file.tar containing files
tar xf file.tar – extract the files from file.tar
tar czf file.tar.gz files – create a tar with Gzip compression
tar xzf file.tar.gz – extract a tar using Gzip
tar cjf file.tar.bz2 – create a tar with Bzip2 compression
tar xjf file.tar.bz2 – extract a tar using Bzip2
gzip file – compresses file and renames it to file.gz
gzip -d file.gz – decompresses file.gz back to file
Network:
ping host – ping host and output results
whois domain – get whois information for domain
dig domain – get DNS information for domain
dig -x host – reverse lookup host
wget file – download file
wget -c file – continue a stopped download
Installation
Install from source:
./configure
make
make install
dpkg -i pkg.deb – install a package (Debian)
rpm -ivh pkg.rpm – install a package (RPM)
yum install pkgname - using the yum tool
Shortcuts:
Ctrl+C – halts the current command
Ctrl+Z – stops the current command, resume with fg in the foreground or bg in the background
Ctrl+D – log out of current session, similar to exit
Ctrl+W – erases one word in the current line
Ctrl+U – erases the whole line
Ctrl+R – type to bring up a recent command
!! - repeats the last command
exit – log out of current session
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Linux/UNIX Basic Commands - Part 1
Hi friends
Please find the Basic linux/Unix commands below for your reference
File Commands:
ls – directory listing
ls -al – formatted listing with hidden files
cd dir - change directory to dir
cd – change to home
pwd – show current directory
mkdir dir – create a directory dir
rm file – delete file
rm -r dir – delete directory dir
rm -f file – force remove file
rm -rf dir – force remove directory dir *
cp file1 file2 – copy file1 to file2
cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn't exist
mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2
ln -s file link – create symbolic link link to file
touch file – create or update file
cat > file – places standard input into file
more file – output the contents of file
head file – output the first 10 lines of file
tail file – output the last 10 lines of file
tail -f file – output the contents of file as it grows, starting with the last 10 lines.
System Info:
date – show the current date and time
cal – show this month's calendar
uptime – show current uptime
w – display who is online
whoami – who you are logged in as
finger user – display information about user
uname -a – show kernel information
cat /proc/cpuinfo – cpu information
cat /proc/meminfo – memory information
man command – show the manual for command
df – show disk usage
du – show directory space usage doesn't exist
free – show memory and swap usage
whereis app – show possible locations of app
which app – show which app will be run by default
locate filename - to find the location of the file
find / -name filename or namespace - to find the file with some namespace
Process Management:
ps – display your currently active processes
top – display all running processes
kill pid – kill process id pid
killall proc – kill all processes named proc *
bg – lists stopped or background jobs; resume a stopped job in the background
fg – brings the most recent job to foreground
fg n – brings job n to the foreground
File Permissions:
chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and world by adding:
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
For more options, see man chmod.
Please read Linux/UNIX Basic Commands - Part 2 also.
Thanks
Logu
logu_microsoft@hotmail.com
91-9841499143
Please find the Basic linux/Unix commands below for your reference
File Commands:
ls – directory listing
ls -al – formatted listing with hidden files
cd dir - change directory to dir
cd – change to home
pwd – show current directory
mkdir dir – create a directory dir
rm file – delete file
rm -r dir – delete directory dir
rm -f file – force remove file
rm -rf dir – force remove directory dir *
cp file1 file2 – copy file1 to file2
cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn't exist
mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2
ln -s file link – create symbolic link link to file
touch file – create or update file
cat > file – places standard input into file
more file – output the contents of file
head file – output the first 10 lines of file
tail file – output the last 10 lines of file
tail -f file – output the contents of file as it grows, starting with the last 10 lines.
System Info:
date – show the current date and time
cal – show this month's calendar
uptime – show current uptime
w – display who is online
whoami – who you are logged in as
finger user – display information about user
uname -a – show kernel information
cat /proc/cpuinfo – cpu information
cat /proc/meminfo – memory information
man command – show the manual for command
df – show disk usage
du – show directory space usage doesn't exist
free – show memory and swap usage
whereis app – show possible locations of app
which app – show which app will be run by default
locate filename - to find the location of the file
find / -name filename or namespace - to find the file with some namespace
Process Management:
ps – display your currently active processes
top – display all running processes
kill pid – kill process id pid
killall proc – kill all processes named proc *
bg – lists stopped or background jobs; resume a stopped job in the background
fg – brings the most recent job to foreground
fg n – brings job n to the foreground
File Permissions:
chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and world by adding:
- 4 – read (r)
- 2 – write (w)
- 1 – execute (x)
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
For more options, see man chmod.
Please read Linux/UNIX Basic Commands - Part 2 also.
Thanks
Logu
logu_microsoft@hotmail.com
91-9841499143
Sunday, November 4, 2007
Installing Ruby on Rails
Hi friends,
This article explains the step by step procedure for installing the ruby on rails application in the Linux machines. The installation guidelines are found in the ruby on rail's home site. Please follow the below steps for deploying this developer suite.
Step1: Installing ruby-1.8.6
Download from the ruby on rail's home site or use
# wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
# tar -xzf ruby-1.8.6.tar.gz
# cd ruby-1.8.6
# ./configure
# make
# make install
# ruby -v or # ruby --version (to check the installed version)
Note: make sure the availability of any c compiler, if not please use "# yum install gcc" to install the compiler.
Step2: Installing rubygems
Download from the ruby on rail's home site or use
# wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
# tar -zxvf rubygems-0.8.11.tgz
# cd rubygems-0.8.11
# ruby setup.rb
Step3: Install rails using gem
# gem install rails
Step4: test
Please check the installation logs for successfully completion. Can use the following command also
# rails test
# cd rails
# ruby script/server
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
This article explains the step by step procedure for installing the ruby on rails application in the Linux machines. The installation guidelines are found in the ruby on rail's home site. Please follow the below steps for deploying this developer suite.
Step1: Installing ruby-1.8.6
Download from the ruby on rail's home site or use
# wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
# tar -xzf ruby-1.8.6.tar.gz
# cd ruby-1.8.6
# ./configure
# make
# make install
# ruby -v or # ruby --version (to check the installed version)
Note: make sure the availability of any c compiler, if not please use "# yum install gcc" to install the compiler.
Step2: Installing rubygems
Download from the ruby on rail's home site or use
# wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
# tar -zxvf rubygems-0.8.11.tgz
# cd rubygems-0.8.11
# ruby setup.rb
Step3: Install rails using gem
# gem install rails
Step4: test
Please check the installation logs for successfully completion. Can use the following command also
# rails test
# cd rails
# ruby script/server
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Saturday, October 20, 2007
Subversion
Subversion is a free/open-source version control system. That is, Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data, or examine the history of how your data changed. Subversion can operate across networks, which allows it to be used by people on different computers. At some level, the ability for various people to modify and manage the same set of data from their respective locations fosters collaboration.
The goal of the Subversion project is to build a version control system that is a compelling replacement for CVS in the open source community
Install Subversion:
rpm –qa | grep subversion
yum install subversion
Plan and create the Repository Location:
Create directory for the repository
#mkdir /home/subversion
To create a repository use the below command
#svnadmin create /home/subversion
Importing Initial data into the Repository:
1. Import from local machine
svn import /home/loguinfo.com file:///home/subversion/loguinfo.com/trunk -m “Initial load for loguinfo.com by logu”
2. Import from Remote machine using Subversion client
svn import /home/loguinfo.com svn+ssh://username@server.com/loguinfo.com/trunk –m “Initial import for loguinfo.com by logu”
3. Import from Remote machine using TortoiseSVN
a. Select folder with project files
b. Right-click and select the TortoiseSVN Import option
c. Specify path of new project repository
Now, the repository has some project folders.
Getting working Copy for editing (For eg changing/editing the website code)
svn checkout svn+ssh://username@server.com/loguinfo.com/trunk /localhome/myproject/loguinfo.com
So now you have a local copy of the project code. Enter your working copy and edit a file's contents.
Run svn commit to commit the new version of your file to the repository.
Run svn update to bring your working copy “up-to-date” with the repository.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
The goal of the Subversion project is to build a version control system that is a compelling replacement for CVS in the open source community
Install Subversion:
rpm –qa | grep subversion
yum install subversion
Plan and create the Repository Location:
Create directory for the repository
#mkdir /home/subversion
To create a repository use the below command
#svnadmin create /home/subversion
Importing Initial data into the Repository:
1. Import from local machine
svn import /home/loguinfo.com file:///home/subversion/loguinfo.com/trunk -m “Initial load for loguinfo.com by logu”
2. Import from Remote machine using Subversion client
svn import /home/loguinfo.com svn+ssh://username@server.com/loguinfo.com/trunk –m “Initial import for loguinfo.com by logu”
3. Import from Remote machine using TortoiseSVN
a. Select folder with project files
b. Right-click and select the TortoiseSVN Import option
c. Specify path of new project repository
Now, the repository has some project folders.
Getting working Copy for editing (For eg changing/editing the website code)
svn checkout svn+ssh://username@server.com/loguinfo.com/trunk /localhome/myproject/loguinfo.com
So now you have a local copy of the project code. Enter your working copy and edit a file's contents.
Run svn commit to commit the new version of your file to the repository.
Run svn update to bring your working copy “up-to-date” with the repository.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Thursday, October 18, 2007
More SWAP space with a SWAP file
Hi Friends,
There is a possibility for adding extra swap space even after installation. The swap space is nothing but a virtual memory (Hard disk space acting as a RAM space). Any linux distribution requires the swap space for deploying the kernel. The recommended swap space is to be twice that of the RAM size. In case, you are starting from a scratch or forget to allocate the required space for the /swap partition at the time of installation, no harm it can be extended easily.
The trick is to make a file and then tell the swapon program to use it. Here's how to create, for example, a 64
megs swap file on your root partition (of course make sure you have at least 64 megs free):
dd if=/dev/zero of=/swapfile bs=1024 count=65536
This will make a 64 megs (about 67 millions bytes) file on your hard drive. You now need to initialize it:
mkswap /swapfile 65536
sync
And you can then add it to your swap pool:
swapon /swapfile
With that you have 64 megs of swap added. Don't forget to add the swapon command to your startup files (chkconfig --list) so that the command will be repeated at each reboot.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
There is a possibility for adding extra swap space even after installation. The swap space is nothing but a virtual memory (Hard disk space acting as a RAM space). Any linux distribution requires the swap space for deploying the kernel. The recommended swap space is to be twice that of the RAM size. In case, you are starting from a scratch or forget to allocate the required space for the /swap partition at the time of installation, no harm it can be extended easily.
The trick is to make a file and then tell the swapon program to use it. Here's how to create, for example, a 64
megs swap file on your root partition (of course make sure you have at least 64 megs free):
dd if=/dev/zero of=/swapfile bs=1024 count=65536
This will make a 64 megs (about 67 millions bytes) file on your hard drive. You now need to initialize it:
mkswap /swapfile 65536
sync
And you can then add it to your swap pool:
swapon /swapfile
With that you have 64 megs of swap added. Don't forget to add the swapon command to your startup files (chkconfig --list) so that the command will be repeated at each reboot.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Saturday, September 29, 2007
Apache Web server – Virtual Host:
Hi friends,
This article gives you the basic configuration of how to host multiple web sites within a single apache web server. Recent survey reports say that almost 65% of internet websites are hosted on apache web servers only. The recent version of apache web servers provides improved multiple options like both name and IP virtual hosting, supports large number of different development modules, enabled logging, graphic tool for configuration, etc. This article explains about setting up virtual host in a Linux server.
1. Installing the package:
Check for existence
#rpm –qa | grep httpd
Else install using rpm or yum.
2. Service daemon - httpd
#chkconfig –level 345 on httpd
#service httpd restart
#/etc/init.d/httpd restart
#apachectl restart
3. Edit /etc/httpd/conf/httpd.conf:
Port for which this Web server should listen and respond
Listen 80
User/group to run httpd daemon
User nobody
Group nobody
Pass the real server name in the /etc/hosts file top:
ServerName webserver
Assign virtual host IP (may be public/private)
NameVirtualHost 200.200.200.200
Enter the virtual host details:
This is the core area for setting up your web page. Virtualhost parameter should be passed with your assigned IP and port number can also be added followed with semi colon. ServerAdmin parameter sends the mail in case of errors (don’t worry for the existence). Documentroot is the place from which the site flourishes; make sure the path is correct and also set permission as 755 recursively to the designated user. For testing create index.html inside the document with some meaningful message. Servername is the URL used for calling your website and just an DNS pointed namespace. Serveralias for short name and subdomain names. Four type of log format is available in the same httpd.conf file, choose any one as you wish (not mandatory). Errorlog and transferlog parameter specifies the path for storing the website logs(make sure the path is valid).
ServerAdmin root@loguinfo.com
DocumentRoot /www/loguinfo.com
ServerName www.loguinfo.com
ServerAlias loguinfo.com *.loguinfo.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLog /misc/wwwlogs/loguinfo_error.log
TransferLog /misc/wwwlogs/loguinfo_access.log
ServerAdmin root@loguworld.com
DocumentRoot /www/loguworld.com
ServerName www.loguworld.com
ServerAlias loguworld.com *.loguworld.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLog /misc/wwwlogs/loguworld_error.log
TransferLog /misc/wwwlogs/loguworld_access.log
4. Name resolution
Local name resolve: Edit /etc/hosts
127.0.0.1 webserver localhost.localdomain localhost
200.200.200.200 www.loguinfo.com
200.200.200.200 www.loguworld.com
For resolving the namespace in open, add the DNS entry as below
IP ADDR:200.200.200.200 - Namespace:www.loguinfo.com
IP ADDR:200.200.200.200 - Namespace:www.loguworld.com
5. Restart the dependent service and reboot the system
Ok…In server, open your browser try www.loguinfo.com and www.loguworld.com , if it result with the correct index.html content respectively ………. Cheers… you have hosted a website… good job…
Logu
logu_microsoft@hotmail.com
9841499143
This article gives you the basic configuration of how to host multiple web sites within a single apache web server. Recent survey reports say that almost 65% of internet websites are hosted on apache web servers only. The recent version of apache web servers provides improved multiple options like both name and IP virtual hosting, supports large number of different development modules, enabled logging, graphic tool for configuration, etc. This article explains about setting up virtual host in a Linux server.
1. Installing the package:
Check for existence
#rpm –qa | grep httpd
Else install using rpm or yum.
2. Service daemon - httpd
#chkconfig –level 345 on httpd
#service httpd restart
#/etc/init.d/httpd restart
#apachectl restart
3. Edit /etc/httpd/conf/httpd.conf:
Port for which this Web server should listen and respond
Listen 80
User/group to run httpd daemon
User nobody
Group nobody
Pass the real server name in the /etc/hosts file top:
ServerName webserver
Assign virtual host IP (may be public/private)
NameVirtualHost 200.200.200.200
Enter the virtual host details:
This is the core area for setting up your web page. Virtualhost parameter should be passed with your assigned IP and port number can also be added followed with semi colon. ServerAdmin parameter sends the mail in case of errors (don’t worry for the existence). Documentroot is the place from which the site flourishes; make sure the path is correct and also set permission as 755 recursively to the designated user. For testing create index.html inside the document with some meaningful message. Servername is the URL used for calling your website and just an DNS pointed namespace. Serveralias for short name and subdomain names. Four type of log format is available in the same httpd.conf file, choose any one as you wish (not mandatory). Errorlog and transferlog parameter specifies the path for storing the website logs(make sure the path is valid).
ServerAdmin root@loguinfo.com
DocumentRoot /www/loguinfo.com
ServerName www.loguinfo.com
ServerAlias loguinfo.com *.loguinfo.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLog /misc/wwwlogs/loguinfo_error.log
TransferLog /misc/wwwlogs/loguinfo_access.log
ServerAdmin root@loguworld.com
DocumentRoot /www/loguworld.com
ServerName www.loguworld.com
ServerAlias loguworld.com *.loguworld.com
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
ErrorLog /misc/wwwlogs/loguworld_error.log
TransferLog /misc/wwwlogs/loguworld_access.log
4. Name resolution
Local name resolve: Edit /etc/hosts
127.0.0.1 webserver localhost.localdomain localhost
200.200.200.200 www.loguinfo.com
200.200.200.200 www.loguworld.com
For resolving the namespace in open, add the DNS entry as below
IP ADDR:200.200.200.200 - Namespace:www.loguinfo.com
IP ADDR:200.200.200.200 - Namespace:www.loguworld.com
5. Restart the dependent service and reboot the system
Ok…In server, open your browser try www.loguinfo.com and www.loguworld.com , if it result with the correct index.html content respectively ………. Cheers… you have hosted a website… good job…
Logu
logu_microsoft@hotmail.com
9841499143
Setting up Grub Password
Hi Friends,
Nowadays, I get less time for writing a blog. So I try to write some article at frequent intervals. This article explains about setting up the grub password. Initially the users can able to change the root user password by entering in the single user mode. This can result in changing the root password as granted. The following gives you the step by step procedure for setting up the password for entering into the single mode or fiddling into the command boot option.
Setting up GRUB password:
Login as root
Enter grub mode:
# grub
Use md5crypt to encrypt password:
grub> md5crypt
Password: ******
Encrypted: $1$jxcdN0$hVHViq1aiPf8FziuGJGZp0
Copy down encrypted password:
$1$jxcdN0$hVHViq1aiPf8FziuGJGZp0
Exit grub mode:
grub> quit
Modify file /etc/grub.conf:
Insert encrypted password in between "splashimage..." and "title..."
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
password --md5 $1$jxcdN0$hVHViq1aiPf8FziuGJGZp0
title BIZ DESK (2.4.20-8elx)
Save edited file
Boom!!!!! , now if you try to enter into the command single user mode, it will ask for the password by the switch “p”.
Thanks
Logu
logu_microsoft@hotmail.com
9841499143
Wednesday, September 12, 2007
NIS SERVER
Hi friends,
This articles helps you to setup a NIS server and client in your network. In active directory environment we create all user account in the server and user can login in any domain pc and also configured with roaming profile to have their profile loaded from some shared location. Likewise in Linux environment, this setup is possible by setting up the NIS server. This enables us to have the user created in the server premise and allow to login in the client machines and stores their home directory in the server. Please find the steps below for implementing the NIS server and client.
Package Information :
Related packages - ypbind, ypserv and yp-tools.
Check for
#rpm -qa | grep yp
or install the respective package.
Let us consider
NIS SERVER : 192.168.1.5
NIS CLIENT : 192.168.1.50
LAN NETWORK : 192.168.1.0/24
In NIS server :
1. Install the packages
2. Create a share for storing their home directories.
#mkdir /share
3. #vi /etc/exports [add the below entry]
/share/username *.example.com(rw,sync)
4. #useradd username -d /share/username
5. #passwd -d username [empty password] or
#passwd username [set some password]
6. set the domain name for NIS
#domainname REDHAT
7. Install yp
#cd /var/yp
#make
8. Restart all dependent services.
#service nfs restart
#service portmap restart
#service ypserv restart
#service yppasswdd restart
In NIS client :
1. #mkdir /share
2. #vi /etc/auto.master
/share /etc/auto.misc --timeout=60
3. #vi /etc/auto.misc
username rw,soft,init 192.168.1.5:/share/username
4. #authconfig [Select NIS server and give next enter the server name and ipaddress]
5. Restart the service
#service autofs restart
Thats the end , in the clent machine open the new console and enter the username and password created in the NIS server and you will be able to login now with that credentials and their respective home directory data are stored in the server share location.
Please let me know if you have any queastions.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
This articles helps you to setup a NIS server and client in your network. In active directory environment we create all user account in the server and user can login in any domain pc and also configured with roaming profile to have their profile loaded from some shared location. Likewise in Linux environment, this setup is possible by setting up the NIS server. This enables us to have the user created in the server premise and allow to login in the client machines and stores their home directory in the server. Please find the steps below for implementing the NIS server and client.
Package Information :
Related packages - ypbind, ypserv and yp-tools.
Check for
#rpm -qa | grep yp
or install the respective package.
Let us consider
NIS SERVER : 192.168.1.5
NIS CLIENT : 192.168.1.50
LAN NETWORK : 192.168.1.0/24
In NIS server :
1. Install the packages
2. Create a share for storing their home directories.
#mkdir /share
3. #vi /etc/exports [add the below entry]
/share/username *.example.com(rw,sync)
4. #useradd username -d /share/username
5. #passwd -d username [empty password] or
#passwd username [set some password]
6. set the domain name for NIS
#domainname REDHAT
7. Install yp
#cd /var/yp
#make
8. Restart all dependent services.
#service nfs restart
#service portmap restart
#service ypserv restart
#service yppasswdd restart
In NIS client :
1. #mkdir /share
2. #vi /etc/auto.master
/share /etc/auto.misc --timeout=60
3. #vi /etc/auto.misc
username rw,soft,init 192.168.1.5:/share/username
4. #authconfig [Select NIS server and give next enter the server name and ipaddress]
5. Restart the service
#service autofs restart
Thats the end , in the clent machine open the new console and enter the username and password created in the NIS server and you will be able to login now with that credentials and their respective home directory data are stored in the server share location.
Please let me know if you have any queastions.
Thanks
Logu
logu_microsoft@hotmail.com
91-98414-99143
Thursday, August 30, 2007
Rsync for synchronizing directories b/w remote machines
Hi friends
Since having a file stores for accessing the files is common in organization. Obviously ftp, samba or some shared repository plays the role of above one. Nowadays company are multi-branched and also located at different geographical location. My case is to have a common filestore that should be accessed by both instance say Los angels lan and Dubai lan and this store is purely for internal access alone. The simple and effective answer for the above case is to have two servers in respective location and to enable synchronization b/w shares. Synchronization can be one way and can be used to pull or push. But we can configure this at both end and first time sync alone takes much time and successive sync is just updates and more over like incremental stuff.
Lets us consider
Los angels server IP - 200.200.200.201 (Command prompt S1#)
Share location say /home/commonfiles
Dubai server IP - 200.200.200.202 (Command prompt S2#)
Share location say /home/commonfiles
Password-less SSH authentication:
why suddenly to authentication? The answer is we need to provide the password for synchronizing data from one server to other remote server over ssh and also i need to schedule this synchronization for regular intervals.Henceforth i need to suppress this password prompting and at the same time to have secure way to use ssh. Lets do this with rsa generated public/private key option.
S1#ssh-keygen -t dsa [allow default]
S1#scp /root/.ssh/id_rsa.pub root@200.200.200.202:/root/.ssh/authorized_keys [or]
S1#scp /root/.ssh/id_rsa.pub root@200.200.200.202:/tmp
S2#cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys
S1#ssh root@200.200.200.202 [result automatically logs in without asking for password]
Shell script for rsync command execution:
S1#vi /root/script.sh [with the content below]
#!/bin/sh
rsync -e ssh -avuzp /home/commonfiles root@200.200.200.202:/home/commonfiles > /var/log/crontab.log
S1#chmod ugo+x /root/script.sh [to make executable]
Scheduling using crontab
S1#crontab -e [create as per your need]
* 0,5,10,15,20 * * * root /root/script.sh [daily midnight,5 am,10 am, 3 pm, 8 pm]
finally we have done... boom.... its sync the folders from Los angels to Dubai.If you need to update the entries added in the Dubai server to Los angels do the same as in the opposite server and schedule for alternate timing and make sure that the interval time is enough.
Please do post if you have any queries.
Logu
logu_microsoft@hotmail.com
Since having a file stores for accessing the files is common in organization. Obviously ftp, samba or some shared repository plays the role of above one. Nowadays company are multi-branched and also located at different geographical location. My case is to have a common filestore that should be accessed by both instance say Los angels lan and Dubai lan and this store is purely for internal access alone. The simple and effective answer for the above case is to have two servers in respective location and to enable synchronization b/w shares. Synchronization can be one way and can be used to pull or push. But we can configure this at both end and first time sync alone takes much time and successive sync is just updates and more over like incremental stuff.
Lets us consider
Los angels server IP - 200.200.200.201 (Command prompt S1#)
Share location say /home/commonfiles
Dubai server IP - 200.200.200.202 (Command prompt S2#)
Share location say /home/commonfiles
Password-less SSH authentication:
why suddenly to authentication? The answer is we need to provide the password for synchronizing data from one server to other remote server over ssh and also i need to schedule this synchronization for regular intervals.Henceforth i need to suppress this password prompting and at the same time to have secure way to use ssh. Lets do this with rsa generated public/private key option.
S1#ssh-keygen -t dsa [allow default]
S1#scp /root/.ssh/id_rsa.pub root@200.200.200.202:/root/.ssh/authorized_keys [or]
S1#scp /root/.ssh/id_rsa.pub root@200.200.200.202:/tmp
S2#cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys
S1#ssh root@200.200.200.202 [result automatically logs in without asking for password]
Shell script for rsync command execution:
S1#vi /root/script.sh [with the content below]
#!/bin/sh
rsync -e ssh -avuzp /home/commonfiles root@200.200.200.202:/home/commonfiles > /var/log/crontab.log
S1#chmod ugo+x /root/script.sh [to make executable]
Scheduling using crontab
S1#crontab -e [create as per your need]
* 0,5,10,15,20 * * * root /root/script.sh [daily midnight,5 am,10 am, 3 pm, 8 pm]
finally we have done... boom.... its sync the folders from Los angels to Dubai.If you need to update the entries added in the Dubai server to Los angels do the same as in the opposite server and schedule for alternate timing and make sure that the interval time is enough.
Please do post if you have any queries.
Logu
logu_microsoft@hotmail.com
Sunday, August 26, 2007
SQUID PROXY - Configuration
Hi
If someone asks me for putting up a proxy server for small network/office to control their internet usage, i will opt for implementing the squid proxy as my first choice.Squid server actually lots of options like content control, speed, cache option and so on. Squid can be implemented and managed with ease. So this article gonna give you the quick start for installing and configuring squid proxy server.
Installing squid
Check for existence
#rpm -qa | grep squid
Installing the package
#rpm -ivh squid* or #yum install squid
Starting service and runlevel service status
#/etc/init.d/squid restart or #service squid restart
#chkconfig --levels 345 squid on
Configuring squid.conf
Source file path
#/etc/squid/squid.conf
Please add the following lines appropriately
Under access control section
acl SSL_ports port 443 563
acl safeports port 80
acl safeports port 21
acl safeports port 443 563
acl safeports port 70
acl safeports port 210
acl safeports port 280
acl safeports port 488 591 777
acl safeports port 5269 5222 5223
acl CONNECT method CONNECT
acl blacklist dstdomain .youtube.com .fmradio.com playstation.com
acl noexe url_regex -i exe$
acl nodown url_regex -i \.rar$ \.zip$ \.mp3$ \.wmv$
acl noporn url_regex -i sex dating porn
acl internal src 192.168.2.0/26
Calling constructed acl - Under Http access section
http_access deny !safeports
http_access deny Connect !SSL_ports
http_access deny blacklist
http_access deny noexe
http_access deny nodown
http_access deny noporn
http_access deny !internal
http_access allow all
and then save the file and restart the service. Here we go , open your browser set the internet connection setting to correct proxy server address and port number. try out the different combination to check whether applied set of acl works.
This article will just give you the basic stuff, apart from the above configuration lots are there to be considered.
Please do post / comment if you any queastions.
Thanks
Logu
logu_microsoft@hotmail.com
If someone asks me for putting up a proxy server for small network/office to control their internet usage, i will opt for implementing the squid proxy as my first choice.Squid server actually lots of options like content control, speed, cache option and so on. Squid can be implemented and managed with ease. So this article gonna give you the quick start for installing and configuring squid proxy server.
Installing squid
Check for existence
#rpm -qa | grep squid
Installing the package
#rpm -ivh squid* or #yum install squid
Starting service and runlevel service status
#/etc/init.d/squid restart or #service squid restart
#chkconfig --levels 345 squid on
Configuring squid.conf
Source file path
#/etc/squid/squid.conf
Please add the following lines appropriately
Under access control section
acl SSL_ports port 443 563
acl safeports port 80
acl safeports port 21
acl safeports port 443 563
acl safeports port 70
acl safeports port 210
acl safeports port 280
acl safeports port 488 591 777
acl safeports port 5269 5222 5223
acl CONNECT method CONNECT
acl blacklist dstdomain .youtube.com .fmradio.com playstation.com
acl noexe url_regex -i exe$
acl nodown url_regex -i \.rar$ \.zip$ \.mp3$ \.wmv$
acl noporn url_regex -i sex dating porn
acl internal src 192.168.2.0/26
Calling constructed acl - Under Http access section
http_access deny !safeports
http_access deny Connect !SSL_ports
http_access deny blacklist
http_access deny noexe
http_access deny nodown
http_access deny noporn
http_access deny !internal
http_access allow all
and then save the file and restart the service. Here we go , open your browser set the internet connection setting to correct proxy server address and port number. try out the different combination to check whether applied set of acl works.
This article will just give you the basic stuff, apart from the above configuration lots are there to be considered.
Please do post / comment if you any queastions.
Thanks
Logu
logu_microsoft@hotmail.com
Saturday, August 4, 2007
Fedora - YUM
Hi
Open source is known for its excellency in the field of operating systems.We have different flavors of open source available in the market.This articles explains the importance and usage of yum.Yum is a tool for automating package maintenance for a network or workstations running any operating system that use the Red Hat Package Management (RPM) system for distributing packaged tools and applications. Yum is derived from yup, an automated package updater originally developed for Yellowdog Linux, hence its name Yum is "Yellowdog Updater, Modified".Yum works from a constellation of repositories around the world to provide you the latest versions of packages. It installs, updates, and removes packages based on what is installed on your system and what is available in the repository.Yum is the successor of rpm command,it overcomes the burden of usage of rpm command options like -ivh,dependency,force and more.Yum makes the installation,updates,removal,etc far easier than rpm command environment.
Yum is a free tool available for download at http://rpmfind.net/linux/RPM/index.html
Features of Yum:
1.Simple interface
2.Simple configuration
3.Fast operation
4.Dependency calculation
5.Multiple repositories
6.Graphical interfaces(pirut)
Useful syntax:
To install package
yum install package1 [package2..]
To update package
yum updatepackage1 [package2..]
To uninstall package
yum remove | erase package1 [package2..]
To list the package
yum list options (options= all | available | updates | installed | extras | recent | etc)
To clean the packages completely
yum clean options (options= packages | headers| metadata | dbcache | all)
To install yum GUI
yum install yumex
yum install kyum
Please comment your valid suggestions
Thanks
Logu
Open source is known for its excellency in the field of operating systems.We have different flavors of open source available in the market.This articles explains the importance and usage of yum.Yum is a tool for automating package maintenance for a network or workstations running any operating system that use the Red Hat Package Management (RPM) system for distributing packaged tools and applications. Yum is derived from yup, an automated package updater originally developed for Yellowdog Linux, hence its name Yum is "Yellowdog Updater, Modified".Yum works from a constellation of repositories around the world to provide you the latest versions of packages. It installs, updates, and removes packages based on what is installed on your system and what is available in the repository.Yum is the successor of rpm command,it overcomes the burden of usage of rpm command options like -ivh,dependency,force and more.Yum makes the installation,updates,removal,etc far easier than rpm command environment.
Yum is a free tool available for download at http://rpmfind.net/linux/RPM/index.html
Features of Yum:
1.Simple interface
2.Simple configuration
3.Fast operation
4.Dependency calculation
5.Multiple repositories
6.Graphical interfaces(pirut)
Useful syntax:
To install package
yum install package1 [package2..]
To update package
yum updatepackage1 [package2..]
To uninstall package
yum remove | erase package1 [package2..]
To list the package
yum list options (options= all | available | updates | installed | extras | recent | etc)
To clean the packages completely
yum clean options (options= packages | headers| metadata | dbcache | all)
To install yum GUI
yum install yumex
yum install kyum
Please comment your valid suggestions
Thanks
Logu
Subscribe to:
Posts (Atom)
