Monday, September 9, 2013

Linux Directory Structure

/bin - This directory contains most of your non-privileged system commands such as ls, mkdir, rm, etc.

/boot - Contains the systems boot image, bootloader, and the kernel

/dev - Symbolic links to system devices such as optical and removable drives

/etc - Contains all system configuration files and most configurations for installed packages

/home - Contains a directory for each user and contains profile information

/lib - Contains dynamic libraries and modules for the Linux system and installed packages

/media - Contains mount points for optical drives and removable media

/mnt - Used as a location for mounted drives and shares

/opt - Contains user installed packages and custom software not handled by the system or package manager

/proc - An interface between the kernel and the system, useful for diagnostics and system information

/root - The root superuser's home directory

/sbin - Contains privileged commands that are usually run as superuser (root/sudo)

/sys - An interface between the kernel and the system, used for modifying system settings

/tmp - A location for temporary files such as sessions on a web server

/usr - Contains most installed packages that are not part of the system, user installed programs

/usr/bin - Contains commands related to user installed packages in /usr

/usr/sbin - Contains privileged commands related to user installed packages in /usr

/var - Contains files that change often or accessed frequently

/var/log - Contains all system logs and most logs generated by installed packages

RHEL 5 vs RHEL 6

REDHAT Enterprise Linux server (RHEL) is an Opensource. It is popularly used as Server Operating system.
RHEL6 have a lot of features:-
The advantages are


1-  RHEL6 introduces the use of KVM (Kernel-based Virtual Machine) as its hypervisor. In the earlier releases Xen hypervisor was used. The main advantage of KVM is that a new kernel should not be installed like in Xen. It also supports the installation of many virtual operating systems like Windows, Linux, Solaris,etc. It is easy to manage.


2-  Ext4 is made the default filesystem. Ext4 has many new advantages than Ext3 which is used in earlier versions of RHEL. Ext4 is comparatively faster and easy to manage. It supports supports up to 100TB with the addition of Scalable Filesystem Add-one.


3- Improved level of Security RHEL6 has advanced level of security. SELinux (Security Enhanced Linux) features are improved and a new set of SELinux rules has been added to provide security to virtual machines from hackers and attackers. This new feature is called SVirt.


4- New Networking Features RHEL6 is released with improved and new networking features. It supportsIPv6. It uses NFSv4 (Network File Transfer) for the sharing of files in the network rather than NFSv3. It also supports iSCSI (internet Small Computer System Interface) partitions. The network manager in RHEL6 supports Wi-Capabilities.


5- Use of Drivers RHEL6 has drivers for speeding up operations under KVM, VMware and Xen.


6- Increase in the support period provided by Red Hat. RHEL6 has a long period of support provided by Redhat. It provides updates for 7 years and also a extra 3 years of service as paid service. Therefore it means that its period of support is twice the period of support provided by other linux distributors like Ubuntu , Suse , Mendriva , Debian, etc.


7- Improvements of minor updates
Red Hat releases minor versions such as 6.1, 6.2. These minor versions are the accumulated updates of the major version. The new minor releases will not only contain bug fixes but will also have major changes and new features.

Squid Proxy Server configure in Rhel-6/CentOS-6

                                                           Squid
                                         **************************


Packages- squid
Port No-  3128
daemon-  squid
script-  /etc/init.d/squid
conf file- /etc/squid/squid.conf

[root@station19 Desktop]# yum install squid* -y
oaded plugins: refresh-packagekit, rhnplugin
Running Transaction
  Installing     : 7:squid-3.1.4-1.el6.x86_64                               1/1
Installed:
  squid.x86_64 7:3.1.4-1.el6                                                  

Complete!
2-> Now configur conf file-->>
****************************

[root@station19 Desktop]# vim /etc/squid/squid.conf

#To block a particular Network:
acl my_net src 192.168.0.0/24 192.168.1.0/24
http_access allow my_net

#To block a particular ip:
acl bad_ip src 192.168.0.21
acl bad_ip src 192.168.0.22
http_access deny bad_ip

#To block a particular URL:
acl bad_site dst www.yahoo.com
http_access deny bad_site
#To block only one domain:
acl block_orkut dstdomain .orkut.com
http_access deny block_orkut

#To block a list of sites from / specified in a file:
acl block_list url_regex "/etc/squid/block_list.txt"
http_access deny block_list

#Blocking web access by time:
#acl aclname time [day-abbrevs] [h1:m1-h2:m2]
#h1:m1 must be less than h2:m2
#Day-abbrevs:
#S - Sunday,M - Monday,T – Tuesday,W - Wednesday,H - Thursday,F - Friday,A - Saturday
acl mynetwork src 192.168.0.0/255.255.255.0
acl Break time MTWHFA 02:32-03:00
http_access deny mynetwork Break


#To block the URLs contains the word "word":
acl block_word_url url_regex sex
http_access deny block_word_url

#To prevent downloading files:
acl block_exe url_regex .*\.exe$
http_access deny block_exe

#To block access to some TLDs:
acl block_tld dstdom_regex \.uk$
http_access deny block_tld

3-> Now create block file and service restart

[root@station19 Desktop]# cat >/etc/squid/block_list.txt
www.hotmail.com
www.ibm.com
www.hp.com

[root@station19 Desktop]# /etc/init.d/squid restart
Stopping squid:                                            [FAILED]
Starting squid: .                                          [  OK  ]
[root@station19 Desktop]# chkconfig squid on

                                                         now configure client
                if you want to more knowledge about squid send me your query
                        Email :- saikiran.chikati@gmail.com