About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Wednesday, October 30, 2013

YUM CONFIGURATION & INSTALLATION ON REDHAT LINUX

YUM CONFIGURATION & INSTALLATION ON REDHAT LINUX

Requirements:
1. Need to copy all linux rpm packages in one directory (if you have ftp/httpd then copy /var/www/html or /var/ftp/pub direcotry, also you can keep anywhere in your linux box but you can't use this server for other linux clients for yum installation...)

2. Need to install createrepo rpm on server side...

3. yum packages (This package will installed default)

Copy All RPM to your linux location:
keep RHEL DVD in dvd rom and copy /Server directory to your selected location, In my server its running httpd service and vsftpd service so I am keep all copied file under httpd location /var/www/html/yumpack/

[root@proxy1 RHEL5]# cp -R Server/ /var/www/html/yumpack/
[root@proxy1 RHEL5]#
[root@proxy1 Server]# pwd
/var/www/html/yumpack/Server
[root@proxy1 Server]#

Installation of createrepo rpm:
[root@proxy1 Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@proxy1 Server]#

Copy comps-rhel5-server-core.xml file to /var/www/html/yumpack/Server location from /var/www/html/yumpack/Server/repodata/

[root@proxy1 Server]# cd repodata/
[root@proxy1 repodata]# ls -ltr
total 10144
-rw-r--r-- 1 root root    1139 Oct 29 17:33 TRANS.TBL
-rw-r--r-- 1 root root 1010906 Oct 29 17:33 comps-rhel5-server-core.xml
-rw-r--r-- 1 root root 2400291 Oct 29 17:33 filelists.xml.gz
-rw-r--r-- 1 root root    1314 Oct 29 17:33 repomd.xml
-rw-r--r-- 1 root root  733418 Oct 29 17:33 primary.xml.gz
-rw-r--r-- 1 root root 6199888 Oct 29 17:33 other.xml.gz
[root@proxy1 repodata]#

[root@proxy1 repodata]# cp comps-rhel5-server-core.xml /var/www/html/yumpack/Server/
[root@proxy1 repodata]# cd ..
[root@proxy1 Server]#

[root@proxy1 Server]# ls -ltr |grep comp
-rw-r--r-- 1 root root    79270 Oct 29 17:33 compat-dapl-utils-2.0.13-4.el5.i386.rpm
-rw-r--r-- 1 root root  1010906 Oct 29 17:43 comps-rhel5-server-core.xml
[root@proxy1 Server]#

compat-dapl-utils-2.0.13-4.el5.i386.rpm this file content all rpm updates, that we have to update with group with that directory, follow below steps...
[root@proxy1 Server]# createrepo -vg comps-rhel5-server-core.xml /var/www/html/yumpack/Server/
1/2255
...
2254/2255 - esc-1.0.0-39.el5.i386.rpm
2255/2255 - xml-common-0.6.3-18.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@proxy1 Server]#

In this file updation it will update all /Server rpm packs, see above it has updated 2255/2255 packages

Modify /etc/yum.repos.d/rhel-debuginfo.repo file (This steps you can do in server as well as in client machine)
[root@proxy1 Server]# cd /etc/yum.repos.d/
[root@proxy1 yum.repos.d]#
Keep original file copy for your safety purpose
[root@proxy1 yum.repos.d]# ls -ltr
total 8
-rw-r--r-- 1 root root 254 Dec 16  2008 rhel-debuginfo.repo
[root@proxy1 yum.repos.d]# cp rhel-debuginfo.repo rhel-debuginfo.repo.org
[root@proxy1 yum.repos.d]#

[root@proxy1 yum.repos.d]# vi rhel-debuginfo.repo
[my_Server]
name=my_Yum_Server
baseurl=http://172.16.4.205:9542/yumpack/Server/
enabled=1
gpgcheck=0

###clear yum cache### (This step need to do only in server side)

[root@proxy1 yum.repos.d]# yum clean all
Loaded plugins: rhnplugin, security
Cleaning up Everything
[root@proxy1 yum.repos.d]#

###update the yum####  (This step need to do only in server side)
[root@proxy1 yum.repos.d]# yum update
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
my_Server                                                                                                        | 1.1 kB    
00:00    
primary.xml.gz                                                                                                         | 791
kB     00:00    
my_Server                                                2255/2255
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
[root@proxy1 yum.repos.d]#

###Test Yum Working or not (This step you can check with Server or client [if client /etc/yum.repos.d/rhel-debuginfo.repo modified])

[root@proxy1 ~]# yum install nfs-utils
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.i386 1:1.0.9-40.el5 set to be updated
--> Processing Dependency: nfs-utils-lib >= 1.0.8-2 for package: nfs-utils
--> Processing Dependency: librpcsecgss.so.2 for package: nfs-utils
--> Processing Dependency: libnfsidmap.so.0 for package: nfs-utils
--> Running transaction check
---> Package nfs-utils-lib.i386 0:1.0.8-7.2.z2 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
 Package                            Arch                      Version                              Repository                
           Size
=============================================================================================================================
Installing:
 nfs-utils                          i386                      1:1.0.9-40.el5                       my_Server                 
    380 k
Installing for dependencies:
 nfs-utils-lib                      i386                      1.0.8-7.2.z2                         my_Server                 
     55 k
Transaction Summary
=============================================================================================================================
Install      2 Package(s)        
Update       0 Package(s)        
Remove       0 Package(s)        
Total download size: 434 k
Is this ok [y/N]: yes
Downloading Packages:
(1/2): nfs-utils-lib-1.0.8-7.2.z2.i386.rpm                                                                             |  55
kB     00:00    
(2/2): nfs-utils-1.0.9-40.el5.i386.rpm                                                                                 | 380
kB     00:00    
----------------------------------------------------------------------------------------------------------------------------
Total                                                                                                         3.7 MB/s | 434
kB     00:00    
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : nfs-utils-lib                                     [1/2]
  Installing     : nfs-utils                                         [2/2]
Installed: nfs-utils.i386 1:1.0.9-40.el5
Dependency Installed: nfs-utils-lib.i386 0:1.0.8-7.2.z2
Complete!
[root@proxy1 ~]#

Thanks and Regards,
Sandeep CC

Wednesday, October 23, 2013

Install & Configure VNCSERVER on REDHAT LINUX-5


INSTALLATION & CONFIGURATION OF VNCSERVER ON REDHAT LINUX


Requirement: VNCSERVER package (server end) & Client version for client side...

INSTALL PACKAGE:

[root@proxy2 ~]# rpm -ivh vnc-server-4.1.1-10.1.0.0.1.i386.rpm
Preparing...                ########################################### [100%]
        package vnc-server-4.1.2-9.el5 (which is newer than vnc-server-4.1.1-10.1.0.0.1) is already installed
        file /etc/rc.d/init.d/vncserver from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /etc/sysconfig/vncservers from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/bin/Xvnc from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/bin/vncconfig from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/bin/vncpasswd from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/bin/vncserver from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/bin/x0vncserver from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/share/man/man1/vncserver.1.gz from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
        file /usr/share/vnc/classes/vncviewer.jar from install of vnc-server-4.1.1-10.1.0.0.1 conflicts with file from package vnc-server-4.1.2-9.el5
[root@proxy2 ~]#

ADD ONE USER FOR VNCSERVER (For security purpose don't use root user)
[root@proxy2 ~]# useradd vncserver

GO TO VNCSERVER USER (ALSO YOU CAN CREATE PASSWORD FOR LOCAL USERLOGIN BY USING "PASSWD USERNAME" COMMAND)
[root@proxy2 ~]# su -l vncserver

CREATE VNC SERVER PASSWORD FOR CREATED USER (this password is must required for remote login)
[vncserver@proxy2 root]$ vncpasswd
Password:
Verify:
[vncserver@proxy2 root]$

ALLOW CREATED USER TO VNCSERVER (Uncomment last 2 lines & give user session , like 1st user '1:myuser')
[root@proxy2 ~]# cd /etc/sysconfig/
[root@proxy2 sysconfig]# ls -ltr |grep vncser
-rw-r--r-- 1 root root   847 Jan 15  2007 vncservers
[root@proxy2 sysconfig]# cp vncservers vncservers.org
[root@proxy2 sysconfig]#
[root@proxy2 sysconfig]# vi vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# .
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:vncserver" ------------------------------------------------------> ADD CREATED USER HERE
VNCSERVERARGS[1]="-geometry 1600x1200" ----------------------------------------> GIVE REQUIRED RESULATION TO VIEW

"vncservers" 23L, 911C written

#####MAKE ON VNCSERVER WHILE BOOTING SERVER#####
[root@proxy2 ~]# chkconfig --list |grep vncserver
vncserver       0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@proxy2 ~]# chkconfig --level 35 vncserver on
[root@proxy2 ~]# chkconfig --list |grep vncserver
vncserver       0:off   1:off   2:off   3:on    4:off   5:on    6:off
[root@eduproxy2 ~]#
[root@proxy2 sysconfig]#

##########SERVICE START############
[root@proxy2 sysconfig]# service vncserver start
Starting VNC server: 1:vncserver xauth:  creating new authority file /home/vncserver/.Xauthority
xauth: (stdin):1:  bad display name "proxy2.com:1" in "add" command
New 'proxy2.com:1 (vncserver)' desktop is proxy2.com:1
Creating default startup script /home/vncserver/.vnc/xstartup
Starting applications specified in /home/vncserver/.vnc/xstartup
Log file is /home/vncserver/.vnc/proxy2.com:1.log
                                                           [  OK  ]
[root@proxy2 sysconfig]#

### Go to Client machine###
Note: We can install vnc client version in any OS, I have installed and tried in XP platform...also we can open this vnc server on any java updated browser, you can see 2 steps also below...

Step-1: With VNC Client exe...




Step-2: Open in any java updated browser with default port 5801



Monday, September 23, 2013

SPLIT INTERNET SPEED/BANDWIDTH IN SQUID REDHAT LINUX-5

        Split Internet Speed/Bandwidth Limit on Squid REDHAT LINUX -5

Requirements :
1. Squid Installed and configured on Linux Machine.

2. --enable-delay-pools (This is mandatory, To check its enabled or not)
[[root@proxy1 ~]# squid -v
Squid Cache: Version 2.6.STABLE21
configure options:  '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--exec_prefix=/usr' '--bindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--localstatedir=/var' '--datadir=/usr/share' '--sysconfdir=/etc/squid' '--enable-epoll' '--enable-snmp' '--enable-removal-policies=heap,lru' '--enable-storeio=aufs,coss,diskd,null,ufs' '--enable-ssl' '--with-openssl=/usr/kerberos' '--enable-delay-pools' '--enable-linux-netfilter' '--with-pthreads' '--enable-ntlm-auth-helpers=SMB,fakeauth' '--enable-external-acl-helpers=ip_user,ldap_group,unix_group,wbinfo_group' '--enable-auth=basic,digest,ntlm' '--enable-digest-auth-helpers=password' '--with-winbind-auth-challenge' '--enable-useragent-log' '--enable-referer-log' '--disable-dependency-tracking' '--enable-cachemgr-hostname=localhost' '--enable-underscores' '--enable-basic-auth-helpers=LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL' '--enable-cache-digests' '--enable-ident-lookups' '--with-large-files' '--enable-follow-x-forwarded-for' '--enable-wccpv2' '--enable-fd-config' '--with-maxfd=16384' 'build_alias=i686-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu' 'target_alias=i386-redhat-linux-gnu' 'CFLAGS=-D_FORTIFY_SOURCE=2 -fPIE -Os -g -pipe -fsigned-char' 'LDFLAGS=-pie'
[root@proxy1 ~]#]


3. Check internet is working fine in client side..

4. As per your requirement make different groups...

Scenario : I have installed Squid in RHEL-5 and given internet access to 172.16.4.X subnet... We have Lease line 4Mbps line. I have made 4 groups for different speed limit. This group can access internet speed max what we have assigned speed limit...
Group-1 : 172.16.4.1 to 172.16.4.51 (Unlimited Speed) /etc/squid/unlimited.txt
Group-2 : 172.16.4.51 to 172.16.4.100 (1Mbps) /etc/squid/our_1.5mbps.txt
Group-1 : 172.16.4.101 to 172.16.4.150 (1.5Mbps) /etc/squid/our_1mbps.txt
Group-1 : 172.16.4.151 to 172.16.4.240 (512Kbps) /etc/squid/our_512kbps.txt

Modify : /etc/squid/squid.conf file (Before modification take one backup copy for your safer side...) and enter given dalay_pools details after ACL entries...For group IP entries create 4 files in /etc/squid/ by speed limit as given above names...


##INTERNET SPEED LIMIT###
#Internet Speed Limit Define
acl all src 0.0.0.0/0.0.0.0 ##(Here you can define your Network)
acl unlimited src "/etc/squid/unlimited.txt"
acl our_1.5mbps src "/etc/squid/our_1.5mbps.txt"
acl our_1mbps src "/etc/squid/our_1mbps.txt"
acl our_512kbps src "/etc/squid/our_512kbps.txt"
http_access allow unlimited
http_access allow our_1.5mbps
http_access allow our_1mbps
http_access allow our_512kbps
http_access deny all
delay_pools 4
delay_class 1 2
delay_access 1 allow unlimited
delay_access 1 deny all
delay_parameters 1 -1/-1 -1/-1

delay_class 2 2
delay_access 2 allow our_1.5mbps
delay_access 2 deny all
delay_parameters 2 -1/-1 196608/196608

delay_class 3 2
delay_access 3 allow our_1mbps
delay_access 3 deny all
delay_parameters 3 -1/-1 131072/131072

delay_class 4 2
delay_access 4 allow our_512kbps
delay_access 4 deny all
delay_parameters 4 -1/-1 65536/65536

Save file and Restart Squid Service..

Above given details is 4 pools entry's... Here we have used dalay_class 2 for all 4 pools, as we have allowed dalay_parameters 4 65536/65536 (its in bytes for 512kbps) user can get max speed 512kbps only...as per your requirement you can change with speed limit...


Thanks and Regards,
Sandeep CC

Friday, August 16, 2013

Install/Configure Webmin Web-Based Access Tools on REDHAT LINUX

Install & Configure Webmin on Redhat Linux Server


Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup/create user accounts, you can start stop the services, you can ssh/remote login for command mod,  file sharing and much more. Webmin is one graphical/browsable easy simple access tool...I like this tool too much.... Lets see how to install webmin and how to use this simple tool...

Requirements:
1. Webmin RPM (Here we have used webmin-1.590-1.noarch.rpm version)

Installation:
[root@proxy2 home]# rpm -ivh webmin-1.590-1.noarch.rpm
warning: webmin-1.590-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 11f63c51
Preparing...                ########################################### [100%]
Operating system is Redhat Enterprise Linux
   1:webmin                 ########################################### [100%]
Webmin install complete. You can now login to http://proxy2:10000/
as root with your root password.
[root@proxy2 home]#

Change Default Port No:

By default webmin gives 10000 port no, for your security purpose you can change port no to anything... Here i am changing 9543 port no...File is available in /etc/webmin/ (Before modification with original file take one backup copy for your safety purpose...)

[root@proxy2 webmin]# cp miniserv.conf miniserv.conf.org
[root@proxy2 webmin]#
[root@proxy2 webmin]# vi miniserv.conf
port=9543
Start/Stop/Status Webmin Service:
[root@proxy2 webmin]# service webmin status
Webmin (pid 13830) is running
[root@proxy2 webmin]# service webmin stop
Stopping Webmin server in /usr/libexec/webmin
[root@proxy2 webmin]# service webmin start
[root@proxy2 webmin]#

Create User By Webmin Tool: 


Created User Logins & Permission: