~choose fonts and sizes~

How to Configure DNS on CentOS 6.3 & RHEL 6.3,Scientific Linux 6.3

############################# STEP-01 ##########################
[root@localhost ~]# hostname
localhost.localdomain
root@localhost ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server1.example.com

[root@server1 Desktop]# yum install bind -y
Loaded plugins: refresh-packagekit, security
other                                                                                                                  20/20
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 bind.x86_64 32:9.8.2-0.10.rc1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                 Arch                      Version                                     Repository               Size
=============================================================================================================================
Installing:
 bind                    x86_64                    32:9.8.2-0.10.rc1.el6                       base                    4.0 M

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

Total download size: 4.0 M
Installed size: 7.2 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 32:bind-9.8.2-0.10.rc1.el6.x86_64                                                                         1/1
  Verifying  : 32:bind-9.8.2-0.10.rc1.el6.x86_64                                                                         1/1

Installed:
  bind.x86_64 32:9.8.2-0.10.rc1.el6                                                                                        

Complete!


################################ STEP-02 ########################################

[root@server1 Desktop]# mkdir -p /bakup/dns
[root@server1 Desktop]# cp /etc/named.conf /bakup/dns/named.conf.original
[root@server1 Desktop]# cp /etc/named.rfc1912.zones /bakup/dns/named.rfc1912.zones.original
[root@server1 Desktop]# vim /etc/named.conf
From

11         listen-on port 53 { 127.0.0.1; };

            To

11         listen-on port 53 { 192.168.0.254; };

17         allow-query     { any; };

Save&exit
[root@server1 Desktop]# vim /etc/named.rfc1912.zones

From

 13 zone "localhost.localdomain" IN {
 14         type master;
 15         file "named.localhost";
 16         allow-update { none; };
 17 };

31 zone "1.0.0.127.in-addr.arpa" IN {
 32         type master;
 33         file "named.loopback";
 34         allow-update { none; };
 35 };


To

13 zone "example.com" IN {
 14         type master;
 15         file "forward.zone";
 16         allow-update { none; };
 17 };

31 zone "0.168.192.in-addr.arpa" IN {
 32         type master;
 33         file "reverse.zone";
 34         allow-update { none; };
 35 };
Read More

How to configure Proxy Server on RHEL 6.3 or Scientific Linux 6.3 or CentOS 6.3

[root@server1 ~] vim /etc/sysctl.con
net.ipv4.ip_forward = 1

[root@server1 ~]iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

your client will be internet via Proxy

############################################## Transparent Proxy ###################################################
# vim /etc/squid/squid.conf
visible_hostname murad
http_port 3128 transparent
############## Inser Acl Section ########################

# Allow My Networks
acl mynetworks src 192.168.0.0/24

# from where browsing should be allowed
http_access allow mynetworks

[root@server1 ~]# iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 3128 -j ACCEPT
[root@server1 ~]# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
[root@server1 ~]# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-ports 3128

[root@server1 ~]# service squid restart
Stopping squid: ................                           [  OK  ]
Starting squid: .                                          [  OK  ]

############################ Block Website ################################
# vim /etc/squid/badsite.conf

www.facebook.com
www.google.com
www.yahoo.com

# Allow My Networks
acl mynetworks src 192.168.0.0/24

##Add acl Badsites##
acl badsite dstdomain "/etc/squid/badsite.conf"
# Deny IP Address Range
acl denyip src 192.168.0.14
# Allow IP Address Range
acl allowip src 192.168.0.1-10
# Download Limit
acl Group1 src 192.168.0.1-192.168.0.10/24
reply_body_max_size 64 KB Group1
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager
http_access deny manager
# Deny IP Address Range
http_access deny denyip
# Allow IP Address Range
http_access allow allowip
##Deny access to badsites##
http_access deny badsite

Read More

How to NAT or Masquerade on RHEL 6.3 or Scientific Linux 6 or Centos 6.3

[root@server1 ~] vim /etc/sysctl.con
net.ipv4.ip_forward = 1

[root@server1 ~]iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

How to Configure Web Server on RHEL 6.3 or CentOS 6.3 or Scientific linux 6.3

[root@server1 ~]# yum install httpd
Loaded plugins: refresh-packagekit, security
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 httpd.x86_64 0:2.2.15-15.sl6.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                    Arch                        Version                              Repository                 Size
=============================================================================================================================
Installing:
 httpd                      x86_64                      2.2.15-15.sl6.1                      base                      812 k

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

Total download size: 812 k
Installed size: 2.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : httpd-2.2.15-15.sl6.1.x86_64                                                                              1/1
  Verifying  : httpd-2.2.15-15.sl6.1.x86_64                                                                              1/1

Installed:
  httpd.x86_64 0:2.2.15-15.sl6.1                                                                                           

Complete!
[root@server1 ~]# service httpd restart;chkconfig httpd on
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@server1 ~]# vim /etc/httpd/conf/httpd.conf
change
    From
262 ServerAdmin root@localhost
276 #ServerName www.example.com:80
402 DirectoryIndex index.html index.html.var


                To
262 ServerAdmin root@server1.example.com
276 ServerName server1.example.com:80
402 DirectoryIndex index.html index.html.var index.php
[root@server1 ~]# touch /var/www/html/index.html
[root@server1 ~]# vim index.html

<html>
<head>
<title>
This is My Test mail
</title>
</head>
<body bgcolor=pink>
<center>Welcome to Technologybd.net</center>
</body>
</html>


[root@server1 ~]# service httpd restart;chkconfig httpd on
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
Read More

How to Multiple IP on ONE NIC on RHEL 6.3 ,CentOS 6.3 or Scientific Linux 6.3

[root@server1 ~]# cd /etc/sysconfig/network-scripts/
[root@server1 network-scripts]# ls
[root@server1 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:e0:4c:04:7d:2b
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="587b9935-5b28-45e3-8d45-ae3e179f9ad0"
IPADDR=192.168.0.254
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
DNS1=192.168.0.254
IPV6INIT=no
USERCTL=no

[Note:Before editing network configuration file, take backup of it.]

eth0:1 is an alias of the eth0 interface. Now, let’s assign a different IP address to eth0:1. Other NIC aliases could be named eth0:2, eth0:3 etc.

[root@server1 network-scripts]# cp ifcfg-eth0 ifcfg-eth0:1
[root@server1 network-scripts]# vim ifcfg-eth0:1
DEVICE=eth0:1
BOOTPROTO=static
HWADDR=00:e0:4c:04:7d:2b
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="587b9935-5b28-45e3-8d45-ae3e179f9ad0"
IPADDR=192.168.0.2
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
DNS1=192.168.0.254
IPV6INIT=no
USERCTL=no
Read More

Dial OUT Server on Scientific Linux 6.3 or CentOS 6.3

[root@localhost ~]# rpm -q wvdial
package wvdial is not installed
[root@localhost ~]# yum install wvdial -y
Loaded plugins: refresh-packagekit, security
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 wvdial.x86_64 0:1.60-12.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================
 Package              Arch                 Version                    Repository          Size
===============================================================================================
Installing:
 wvdial               x86_64               1.60-12.el6                base                91 k

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

Total download size: 91 k
Installed size: 218 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : wvdial-1.60-12.el6.x86_64                                                   1/1
  Verifying  : wvdial-1.60-12.el6.x86_64                                                   1/1

Installed:
  wvdial.x86_64 0:1.60-12.el6                                                                

Complete!
[root@localhost ~]# rpm -q wvdial
wvdial-1.60-12.el6.x86_64
[root@localhost ~]# wvdialconf
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan<*1>: S1   S2   S3 
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyACM0<*1>: Modem Identifier: ATI -- Nokia
ttyACM0<*1>: Speed 4800: AT -- OK
ttyACM0<*1>: Speed 9600: AT -- OK
ttyACM0<*1>: Speed 19200: AT -- OK
ttyACM0<*1>: Speed 38400: AT -- OK
ttyACM0<*1>: Speed 57600: AT -- OK
ttyACM0<*1>: Speed 115200: AT -- OK
ttyACM0<*1>: Speed 230400: AT -- OK
ttyACM0<*1>: Speed 460800: AT -- OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found an USB modem on /dev/ttyACM0.
Modem configuration written to /etc/wvdial.conf.
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
Read More

FTP SERVER ON SCIENTIFIC LINUX 6.3 & CENTOS 6.3


[root@server1 ~]# yum install ftp vsftpd -y
Loaded plugins: refresh-packagekit, security
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 ftp.x86_64 0:0.17-51.1.el6 will be installed
---> Package vsftpd.x86_64 0:2.2.2-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================
 Package       Arch          Version                 Repository   Size
=======================================================================
Installing:
 ftp           x86_64        0.17-51.1.el6           base         56 k
 vsftpd        x86_64        2.2.2-11.el6            base        150 k

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

Total download size: 206 k
Installed size: 426 k
Downloading Packages:
-----------------------------------------------------------------------
Total                                   22 MB/s | 206 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ftp-0.17-51.1.el6.x86_64                            1/2
  Installing : vsftpd-2.2.2-11.el6.x86_64                          2/2
  Verifying  : vsftpd-2.2.2-11.el6.x86_64                          1/2
  Verifying  : ftp-0.17-51.1.el6.x86_64                            2/2

Installed:
  ftp.x86_64 0:0.17-51.1.el6        vsftpd.x86_64 0:2.2.2-11.el6      

Complete!
[root@server1 ~]# rpm -q vsftpd;rpm -q ftp;
vsftpd-2.2.2-11.el6.x86_64
ftp-0.17-51.1.el6.x86_64
[root@server1 ~]# setenforce
usage:  setenforce [ Enforcing | Permissive | 1 | 0 ]
[root@server1 ~]# getenforce
Enforcing
[root@server1 ~]# setenforce 0
[root@server1 ~]# getenforce
Permissive