Thursday, January 31, 2013

how to Configure dhcp on RHEL 6.3 & Centos 6.3

#yum install dhcp* -y
# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
cp: overwrite `/etc/dhcp/dhcpd.conf'? yes
#vim /etc/dhcp/dhcpd.conf

47 subnet 192.168.0.0 netmask 255.255.255.0 {
 48   range 192.168.0.3 192.168.0.254;
 49   option domain-name-servers station1.example.com;
 50   option domain-name "station1.example.com";
 51   option routers 192.168.0.1;
 52   option broadcast-address 10.5.5.31;
 53   default-lease-time 600;
 54   max-lease-time 7200;
 55 }
Read More

how to Configure proxy (Squid) on RHEL 6.3 & Centos 6.3

# install squid* -y
# vim /etc/squid/squid.conf


1 visible_hostname Murad Proxy server

30 acl mynetworks src 192.168.0.0/24
31 acl badsite dstdomain "/etc/squid/badsite.conf"
35 http_access deny badsite
36 http_access allow mynetworks
66 http_port 3128 transparent

Read More

Wednesday, January 30, 2013

How to install wine on RHEL 6.3 & Centos 6.3

Install Howto

  1. Download the latest epel-release rpm from
    (a) http://dl.fedoraproject.org/pub/epel/6/SRPMS/epel-release-6-8.src.rpm
    (b) http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  2. Install epel-release rpm:
    # rpm -Uvh epel-release*rpm
  3. Install epel-release rpm package:
    # yum install epel-release
     
    #yum list all;
    #yum update all;
    #yum install wine* -y;
     
     Read More:
    ###################### GET Magic ######################## 

Thursday, January 3, 2013

RHEL 6.3 ,CentOS 6.3,Scientific Linux 6.3 Archives and compressed files

Command
Description
# bunzip2 file1.bz2
decompress a file called 'file1.bz2'  
# bzip2 file1
compress a file called 'file1'  
# gunzip file1.gz
decompress a file called 'file1.gz'  
# gzip file1
compress a file called 'file1'  
[root@server1 ~]#
 tar –cvf archive_name source
[root@server1 ~]# cd /etc/
[root@server1 etc]
# tar -cvf /bakup/resolv.tar resolv.conf
[root@server1 etc]# cd /bakup/
[root@server1 bakup]# ls -l
total 12
-rw-r--r-- 1 root root 10240 Dec 18 18:30 resolv.tar
Create tar extension file
[root@server1 bakup]
# tar -xvf /bakup/resolv.tar
[root@server1 bakup]# ls
resolv.conf  resolv.tar
Extract from tar file
[root@server1 bakup]
# gzip -v /bakup/resolv.tar
/bakup/resolv.tar:          98.6% -- replaced with /bakup/resolv.tar.gz
[root@server1 bakup]# ls
resolv.conf  resolv.tar.gz
For Compress
[root@server1 bakup]
# gunzip -v /bakup/resolv.tar
/bakup/resolv.tar.gz:      98.6% -- replaced with /bakup/resolv.tar
[root@server1 bakup]# ls
resolv.conf  resolv.tar
UnCompress
[root@server1 ~]# ps
Show current Process
[root@server1 ~]# pstree
Show current process with tree
[root@server1 ~]# uptime
How many times are system start
[root@server1 ~]# top
 System process monitor
[root@server1 ~]# pstree | less
Show process with tree
[root@server1 ~]# iostat
Show system process & Idle time
[root@server1 ~]# hostname
server1.example.com
Check Host name
[root@server1 ~]# ntsysv
Show runlevel list
[root@server1 ~]# setup
For network configuration,authentication
[root@server1 ~]#chkconfig vsftpd on
Automaticaly on vsftpd on system reboot

RHEL 6.3,Centos 6.3 ,Scientific Linux 6.3 Shutdown, Restart and Logout of a system Command

 

Command
Description
# init 0
shutdown system
# logout
leaving session  
# reboot
reboot
# shutdown -h now
shutdown system
# shutdown -h 16:30 &
planned shutdown of the system  
# shutdown -c
cancel a planned shutdown of the system  
# shutdown -r now
reboot  
# telinit 0
shutdown system
# halt
 For shutdown system

RHEL 6.3 ,CentOS 6.3 ,Scientific Linux 6.3 Advanced Linux Command

Advanced Command

Command
Description
[root@server1 /]# ls
[root@server1 ~]# ls
anaconda-ks.cfg  Documents  file1  install.log.syslog  Pictures  TemplatesDesktop  Downloads  install.log  Music      Public    Videos
Show list of directory
[root@server1 ~]# ls –a
[root@server1 ~]# su user1
[user1@server1 root]$ cd
[user1@server1 ~]$ ls -a
.  ..  .bash_history  .bash_logout  .bash_profile  .bashrc  .gnome2  .mozilla  .viminfo
 Show hidden content of a directory
[user1@server1 ~]$ su root
Password:
[root@server1 user1]# cd
[root@server1 ~]# ls -l
total 104
-rw-------. 1 root root  2467 Dec 15 20:25 anaconda-ks.cfg
drwxr-xr-x. 2 root root  4096 Dec 18 02:04 Desktop
drwxr-xr-x. 2 root root  4096 Dec 16 00:34 Documents
drwxr-xr-x. 2 root root  4096 Dec 16 00:34 Downloads
Show Content list with Permission
[root@server1 ~]# ls -lh
total 104K
-rw-------. 1 root root 2.5K Dec 15 20:25 anaconda-ks.cfg
drwxr-xr-x. 2 root root 4.0K Dec 18 02:04 Desktop
drwxr-xr-x. 2 root root 4.0K Dec 16 00:34 Documents
drwxr-xr-x. 2 root root 4.0K Dec 16 00:34 Downloads

Show content total & Individual
 Content size.
[root@server1 ~]# ls -lt
total 148
-rw-r--r--  1 root root 46974 Dec 18 04:02 install.log
 List by Modification
[root@server1 ~]# ls
install.log         Music     Public     Videos
anaconda-ks.cfg  Documents  file1      install.log.syslog  Pictures  Templates
[root@server1 ~]# more install.log
 Show content with list
Then press Enter
[root@server1 ~]# clear
Clear Screen
[root@server1 ~]# tree
Content show with tree diagram
[root@server1 ~]# rmdir
[root@server1 ~]# mkdir 1
[root@server1 ~]# rmdir 1
 Remove Emtpy directory
[root@server1 ~]# hwclock
Tue 18 Dec 2012 04:20:34 AM BDT  -0.924766 seconds
  Show DATE & TIME
[root@server1 ~]# history 10
Show content history
[root@server1 ~]# mail
 mail from /var/spool/mail
[root@server1 ~]# locate resolv.conf
/etc/resolv.conf
/etc/sysconfig/networking/profiles/default/resolv.conf
/usr/share/man/man5/resolv.conf.5.gz
Search file or service from full system
Last update #updatedb


Postfix,SMTP Email Server on CentOS 6.3 OR Scientific Linux 6.3,RHEl 6.3

Final  Postfix dovcot Server configure & test

[root@server1 ~]#  service postfix status;service postfix restart;chkconfig postfix on;
master is stopped
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]
[root@server1 Desktop]# service postfix status;service postfix restart;chkconfig postfix on;
master (pid  3261) is running...
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
 service postfix status;service postfix restart;chkconfig postfix on;
master is stopped
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]
[root@server1 ~]#  service postfix status;service postfix restart;chkconfig postfix on;
master (pid  3261) is running...
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
 yum install postfix dovecot squirrelmail -y
Loaded plugins: refresh-packagekit, security
other                                                                                                 | 1.3 kB     00:00 ...
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package dovecot.x86_64 1:2.0.9-2.el6_1.1 will be installed
---> Package postfix.x86_64 2:2.6.6-2.2.el6_1 will be installed
---> Package squirrelmail.noarch 0:1.4.22-3.el6 will be installed
--> Processing Dependency: php for package: squirrelmail-1.4.22-3.el6.noarch
--> Running transaction check
---> Package php.x86_64 0:5.3.3-3.el6_2.8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                        Arch                     Version                                Repository              Size
=============================================================================================================================
Installing:
 dovecot                        x86_64                   1:2.0.9-2.el6_1.1                      base                   1.9 M
 postfix                        x86_64                   2:2.6.6-2.2.el6_1                      base                   2.0 M
 squirrelmail                   noarch                   1.4.22-3.el6                           base                   4.1 M
Installing for dependencies:
 php                            x86_64                   5.3.3-3.el6_2.8                        base                   1.1 M

Transaction Summary
=============================================================================================================================
Install       4 Package(s)

Total download size: 9.2 M
Installed size: 39 M
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         34 MB/s | 9.2 MB     00:00   
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:postfix-2.6.6-2.2.el6_1.x86_64                                                                          1/4
  Installing : php-5.3.3-3.el6_2.8.x86_64                                                                                2/4
  Installing : squirrelmail-1.4.22-3.el6.noarch                                                                          3/4
  Installing : 1:dovecot-2.0.9-2.el6_1.1.x86_64                                                                          4/4
  Verifying  : squirrelmail-1.4.22-3.el6.noarch                                                                          1/4
  Verifying  : 1:dovecot-2.0.9-2.el6_1.1.x86_64                                                                          2/4
  Verifying  : php-5.3.3-3.el6_2.8.x86_64                                                                                3/4
  Verifying  : 2:postfix-2.6.6-2.2.el6_1.x86_64                                                                          4/4

Installed:
  dovecot.x86_64 1:2.0.9-2.el6_1.1        postfix.x86_64 2:2.6.6-2.2.el6_1        squirrelmail.noarch 0:1.4.22-3.el6     

Dependency Installed:
  php.x86_64 0:5.3.3-3.el6_2.8                                                                                             

Complete!
############################### STEP 02 ##################################
[root@server1 ~]#  service postfix status;service postfix restart;chkconfig postfix on;
master is stopped
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]
[root@server1 ~]#  service postfix status;service postfix restart;chkconfig postfix on;
master (pid  3261) is running...
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
 service postfix status;service postfix restart;chkconfig postfix on;
master is stopped
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]
[root@server1 ~]#  service postfix status;service postfix restart;chkconfig postfix on;
master (pid  3261) is running...
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
################################## STEP 03 #####################################
[root@server1 ~]# vim /etc/postfix/main.cf

Change

From

75 #myhostname = host.domain.tld
83 #mydomain = domain.tld
99 #myorigin = $mydomain
113 #inet_interfaces = all
116 inet_interfaces = localhost
164 mydestination = $myhostname, localhost.$mydomain, localhost
165 #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
419 #home_mailbox = Maildir/


To

75 myhostname = mail.example.com
83 mydomain = example.com
99 myorigin = $mydomain
113 inet_interfaces = all
116 #inet_interfaces = localhost
164 #mydestination = $myhostname, localhost.$mydomain, localhost
165 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
419 home_mailbox = Maildir/
:wq save and quit

[root@server1 ~]# service postfix restart;chkconfig postfix on;service postfix status;
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
master (pid  3604) is running...

Read more