Monday, June 20, 2011

Puppet: Configuration,Management Tool, installation on RHEL 5


Introduction:-
Prerequisite : Ruby and all ruby Library
Rpm Repository for Puppet
rpm -Uvh facter-1.3.7-1.el5.noarch.rpm puppet-0.22.4-1.el5.noarch.rpm
puppet-server-0.22.4-1.el5.noarch.rpm
Server Preparation
The server (puppetmasterd) requires a manifest to be in place before it’s able to run. Lets write a manifest that tells puppet to create a file “/tmp/testfile” on the client.
puppet:# vim /etc/puppet/manifests/site.pp
# Create “/tmp/testfile” if it doesn’t exist.
class test_class {
file { “/tmp/testfile”:
ensure => present,
mode   => 644,
owner  => root,
group  => root
}
}
# tell puppet on which client to run the class
node pclient {
include test_class
}
Managing nodes in Puppet
Once the puppet master is installed, we need to do some basic configuration and then start the daemon. Puppet operates not by executing scripts but by applying what are called manifests against target hosts. A manifest is a Puppet configuration document that describes the target configuration and the steps required to achieve it. Your manifest files also contain the definition of each of the hosts to be managed, which Puppet calls ‘nodes’.
Each puppet master server requires a master manifest, called a site manifest. The site manifest is stored in the file /etc/puppet/manifests/site.pp. You’ll need to create this directory like so:
# mkdir /etc/puppet/manifests
You can see an example of a site.pp file below.
class base_etc {
      file { “/etc/passwd”: owner => root, group => root, mode => 644}
      file { “/etc/sudoers”: owner => root, group => root, mode => 440}
}
node default {
        include base_etc
}
The site manifest file can contain all the instructions you want to use on your managed hosts or can import the contents of other files to enable you to better structure your configuration instructions. Take a look at this example:
import “nodes.pp”
import “classes/*”
The above configuration would import the file nodes.pp and all the files in the classes directory. All directories are assumed to be under the /etc/puppet/manifests directory.
In our example, site.pp file, we’ve specified a class called base_etc. Classes are containers for sets of instructions. In this case, the container holds two instructions, both using the file resource that sets the ownership and permission of the /etc/passwd and /etc/sudoers files. The file resource allows you to create files and directories or specify their permissions and ownership.
The file resource is one of a number of resource types, including types that can manage cron entries, host entries, manage packages, start and stop services or manage users. Each of these resource types can have multiple implementations, called providers, where each provider resource is designed for a different system. For instance, there are multiple file resource providers to cater for file operations on Linux, Unix, Windows and other platforms. This is one of the great strengths of Puppet; a single configuration language that can be interpreted appropriately on multiple target hosts running on different platforms.
We’ve also defined a node called default. The default node is a special definition that allows you to define sets of instructions that are applied to all nodes except those explicitly defined in your configuration. This allows you to specify a baseline configuration to all nodes without having to specifically define all nodes. We can also define other nodes in here (or in another file and import them).
A typical node definition looks like:
node goldfish {
       include apache
}
node ‘salmon.testing.com’ inherits default {
        include mysql}
Nodes are defined either by their simple name or a fully qualified domain name. If you use the fully-qualified domain name, then it must be encapsulated in single quotation marks. In our example, both the goldfish and salmon.testing.com nodes have been defined. Each node uses the include statement to specify particular classes that apply to them, which in this case are the apache and mysql classes, respectively. We’ve also specified that the salmon host also inherits the configuration of the default node.
Starting and configuring Puppet
Once you’ve created your site.pp file you can start the puppermasterd daemon. The Puppet RPMs come with an init script for Puppet, but we’re going to start it manually on the command line:
# /usr/bin/puppetmasterd –verbose
The –verbose option tells the puppetmasterd not to daemonize and to output all logging messages on the command line. If you omit this option, Puppet will daemonize by default. The Puppet master listens on port 8140 (you’ll need to ensure your clients have network connectivity and access through any firewalls to this port on your Puppet server). You can also change a variety of configuration options for your Puppet master daemon by editing the /etc/puppet/puppetmasterd.conf file.
Now you need to install Puppet on one of your client nodes. We also need to install Ruby and the Ruby libraries on the client node and then we need to download and install the Puppet and Facter RPMs.
# wget http://people.redhat.com/dlutter/yum/rhel5/puppet-0.22.4-1.el5.noarch.rpm
# wget http://people.redhat.com/dlutter/yum/rhel5/facter-1.3.7-1.el5.noarch.rpm
# rpm -Uvh facter-1.3.7-1.el5.noarch.rpm puppet-0.22.4-1.el5.noarch.rpm
Next, we need to configure the puppet.conf configuration file to tell it about our Puppet master server. The puppet.conf file is installed into the /etc/puppet directory. You can see an example of this file below.
[puppet]
    vardir = /var/lib/puppet
    logdir = /var/log/puppet
    rundir = /var/run/puppet
    ssldir = $vardir/ssl
[puppetd]
    classfile = $vardir/classes.txt
    localconfig = $vardir/localconfig
    server = puppetmaster.testing.com
Client Preparation
Clients by default will connect to a server on your network with a hostname of “puppet.” If your server’s hostname isn’t “puppet” a directive needs to be inserted into the puppetd configuration file “puppetd.conf.” Even though we don’t need to in this case, we’ll do so for demonstration purposes.
Open “/etc/puppet/puppetd.conf” with your favorite text editor and add “server = puppet.example.com” to the existing file as the example below indicates.
pclient:# vim /etc/puppet/puppetd.conf
[puppetd]
server = puppet.example.com
# Make sure all log messages are sent to the right directory
# This directory must be writable by the puppet user
logdir=/var/log/puppet
vardir=/var/lib/puppet
rundir=/var/run
Sign Keys
In order for the two systems to communicate securely we need to create signed SSL certificates. You should be logged into both the server and client machines for this next step.
On the client side run.
pclient:# puppetd –server puppet.example.com –waitforcert 60 –test
You should see the following message.
err: No certificate; running with reduced functionality.
info: Creating a new certificate request for pclient.example.con
info: Requesting certificate
warning: peer certificate won’t be verified in this SSL session
notice: Did not receive certificate
Next, on the server side, run the following command to verify the client is waiting for the cert to be signed.
puppet:# puppetca –list
pclient.example.con
Then sign the certificate.
puppet:# puppetca –sign pclient.example.com
If everything went OK you should see this message on pclient.
info: Requesting certificate
warning: peer certificate won’t be verified in this SSL session
notice: Ignoring –listen on onetime run
info: Caching configuration at /etc/puppet/localconfig.yaml
notice: Starting configuration run
notice: //pclient/test_class/File[/tmp/testfile]/ensure: created
info: Creating state file /var/lib/puppet/state/state.yaml
notice: Finished configuration run in 0.11 seconds
Test
Check and make sure the file was created.
pclient:# ls -l /tmp/testfile
-rw-r–r– 1 root root 0 2007-02-18 18:28 /tmp/testfile
For a test lets edit the manifest and direct Puppet to modify the file mode. Change line, “mode => 644,” to “mode => 600,”
puppet:# vim /etc/puppet/manifests/site.pp
# Create “/tmp/testfile” if it doesn’t exist.
class test_class {
    file { “/tmp/testfile”:
       ensure => present,
       mode   => 600,
       owner  => root,
       group  => root
    }
}
# tell puppet on which client to run the class
node pclient {
    include test_class
}
On the client run puppetd in verbose mode (-v) and only once (-o).
pclient:# puppetd -v -o
You should see the following message, which states that /tmp/testfile changed from mode 644 to 600.
notice: Ignoring –listen on onetime run
info: Config is up to date
notice: Starting configuration run
notice: //pclient/test_class/File[/tmp/testfile]/mode: mode changed ’644′ to ’600′
notice: Finished configuration run in 0.26 seconds
To verify the work was completed properly.
pclient:# ls -l /tmp/testfile
-rw——- 1 root root 0 2007-02-18 18:28 /tmp/testfile
Conclusion
Congratulations, testing is complete and you have a working Puppet setup. Your next step is to create a functional
manifest, test some more, and then fire up the puppetd daemon on the client side. Puppetd by default will automatically poll the server every 30 minutes.
pclient:# /etc/init.d/puppet start

HOW-TO Install VMWARE server on Centos 5 or Red hat enterprise Linux 64 bit version


Introduction:-
VMware virtualization software is an excllent choice for x86-compatible computers. They have both commercial and free version. I received few email regarding VMWARE on 64 bit Linux. Installing VMWARE server on CentOS 5 or Red hat enterprise Linux 64 bit version is a tricky business. In this small howto I will explain vmware installation on 64 bit Linux server without facing any dependencies problem.
Following instructions are tested on both RHEL 5 and CentOS 5 running 64 bit Intel / AMD hardware and software….
Server Requirements 
The server is a Windows or Linux system where you install the VMWare Server software. Virtual machines can be stored on the server host or located on a network share.
Server Host Hardware VMware Server supports up to 32-way multiprocessor servers. The number of virtual machines you can run concurrently depends on the resources they require, but VMware recommends you run no more than four virtual machines concurrently per processor. You can run a maximum of 64 virtual machines concurrently on one host. The server must include the following.
• Standard x86-based server with up to 32 processors
• Hosts with 32-bit IA-32 processors, and IA-32 processors with 64-bit extensions supported
• 733MHz or faster compatible x86 processor that supports the Pentium
 instruction set
Compatible processors include
• Intel: Pentium II, Pentium III, Pentium III Xeon, Pentium 4, Xeon, Xeon EM64T
• AMD™: Athlon™, Athlon XP, AMD Opteron, AMD Athlon 64
Multiprocessor systems supported
Memory
You need enough memory to run the Windows or Linux host operating system, plus memory required for each guest operating system and applications on the host and each guest; see your guest operating system and application documentation for their memory requirements.
• Minimum: 512MB
• Maximum: 64GB for Windows hosts and Linux hosts that support large memory or are PAE-enabled, 4GB for non-PAE-enabled Windows hosts or 2GB for Linux hosts with kernels in the 2.2.x series
Display
• 16-bit display adapter or higher
Host Hard Disk
• 130MB free disk space on Windows hosts required for server, VMware Management Interface, VmPerl API, VmCOM API and VMware Virtual Machine Console installation
• 20MB free disk space on Linux hosts required for server, VMware Management Interface, VmPerl API and VMware Virtual Machine Console installation
• IDE or SCSI hard drives, CD-ROM and DVD-ROM drives supported
• Guest operating systems can reside in virtual disk files or on physical (raw) disk partitions
Local Area Networking
• Any Ethernet controller that the host operating system supports
• Non-Ethernet networks are supported using built-in network address translation (NAT) or using a combination of host-only networking plus routing software on the host operating system
• A static IP address for your host machine (recommended if you want to access the server from the internet)
Remote Client Requirements
The remote client is a Windows or Linux system from which you launch the VMware Virtual Machine Console or use VMware Scripting APIs to remotely manage virtual machines on the GSX Server host. You access the VMware Management Interface to manage virtual machines on the host using a Web browser.
Hardware Requirements
• Standard x86-based computer
• 266MHz or faster processor
• 64MB RAM minimum
• 20MB (for Windows hosts) or 10MB (for Linux hosts) free disk space is required for installation of the VMware Virtual Machine Console
• 17MB free disk space is required for VMware Scripting APIs (VmCOM and VmPerl Scripting APIs) installation on Windows remote clients; 14MB is required for VmPerl API on Linux remote clients
Software — Linux Remote Client
• Standard Linux installation is required with glibc version 2.1 or higher and one of the following kernels:
• For single-processor systems: kernel 2.0.32 or higher in the 2.0.x series, or kernel in the 2.2.x, 2.4.x or 2.6.x series
• For SMP systems: kernel in the 2.2.x, 2.4.x or 2.6.x series
Note: Linux kernel 2.2.14-5.0 is not supported.
• Perl 5.005x or higher is required to use VmPerl API
• X server is required to run the VMware Virtual Machine Console on the client
• The VMware Management Interface requires one of these browsers:
• Firefox 1.x
• Mozilla 1.x
• Netscape Navigator 7.0
Lets check the kernel
$ uname -mrs
Output:
Linux 2.6.18-8.1.6.el5 x86_64
My RHEL 5 release (same kernel for CentOS):
$ cat /etc/redhat-release
Output:
Red Hat Enterprise Linux Server release 5 (Tikanga)
Make sure you have following software installed:
* Full gcc compiler and development environment
* Kernel headers and devel packages for current kernel (i.e. kernel-headers and kernel-devel)
Step # 1: Download vmware server
You can download VMWARE server here. Use wget command to download:
$ wget http://download3
Step # 2: Install vmware server
Once downloaded use RPM command to install vmware sever, enter:
# rpm -ivh VMware-server-1.0.3-44356.i386.rpm
Step # 2: Install vmware server
Once downloaded use RPM command to install vmware sever, enter:
# rpm -ivh VMware-server-1.0.3-44356.i386.rpm
Output:
Preparing… ########################################### [100%]
1:VMware-server ########################################### [100%]
Step # 3:Install required files / libraries
You need to install following development package / files on server:
1. libXtst-devel : X.Org X11 libXtst development package
2. libXrender-devel : X.Org X11 libXrender development package
Simply use yum command to install packages:
# yum install libXtst-devel libXrender-devel
Output:
Loading “rhnplugin” plugin
Loading “installonlyn” plugin
Setting up Install Process
Setting up repositories
rhel-x86_64-server-vt-5 100% |=========================| 1.2 kB 00:00
rhel-x86_64-server-5 100% |=========================| 1.2 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
………..
….

Running Transaction
Installing: libXtst ######################### [1/8]
Installing: libXau-devel ######################### [2/8]
Installing: xorg-x11-proto-devel ######################### [3/8]
Installing: libX11-devel ######################### [4/8]
Installing: libXdmcp-devel ######################### [5/8]
Installing: libXtst-devel ######################### [6/8]
Installing: libXtst-devel ######################### [7/8]
Installing: mesa-libGL-devel ######################### [8/8]
Installed: libXtst-devel.x86_64 0:1.0.1-3.1 libXtst-devel.i386 0:1.0.1-3.1
Dependency Installed: libX11-devel.x86_64 0:1.0.3-8.0.1.el5 libXau-devel.x86_64 0:1.0.1-3.1 libXdmcp-devel.x86_64 0:1.0.1-2.1 libXtst.i386 0:1.0.1-3.1 mesa-libGL-devel.x86_64 0:6.5.1-7.2.el5 xorg-x11-proto-devel.x86_64 0:7.1-9.fc6
Complete!
Step # 4: Install xinetd
You need xinetd the extended Internet services daemon / service in order to use VMWARE console from remote computer. Use yum command to install xinetd:
# yum install xinetd
Step # 5: Configure VMWARE server
Use vmware-config.pl script to configure VMWARE networking and other aspects.
Output (make sure you setup VMWARE as per your requirments, following is just a sample output):
Making sure services for VMware Server are stopped.
Stopping VMware services:
Virtual machine monitor [ OK ]
You must read and accept the End User License Agreement to continue.
Press enter to display it.
……
……
will provide you with a copy of our
distribution agreement for your signature.
Do you accept? (yes/no) yes
Thank you.
Configuring fallback GTK+ 2.4 libraries.
In which directory do you want to install the mime type icons?
[/usr/share/icons]
What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]
In which directory do you want to install the application’s icon?
[/usr/share/pixmaps]
Trying to find a suitable vmmon module for your running kernel.
None of the pre-built vmmon modules for VMware Server is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]
Using compiler “/usr/bin/gcc”. Use environment variable CC to override.
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.18-8.1.6.el5/build/include]
Extracting the sources of the vmmon module.
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only’
make -C /lib/modules/2.6.18-8.1.6.el5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64′
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
CC [M] /tmp/vmware-config0/vmmon-only/linux/hostif.o
CC [M] /tmp/vmware-config0/vmmon-only/common/cpuid.o
CC [M] /tmp/vmware-config0/vmmon-only/common/hash.o
CC [M] /tmp/vmware-config0/vmmon-only/common/memtrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/phystrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/task.o
CC [M] /tmp/vmware-config0/vmmon-only/common/vmx86.o
CC [M] /tmp/vmware-config0/vmmon-only/vmcore/moduleloop.o
LD [M] /tmp/vmware-config0/vmmon-only/vmmon.o
Building modules, stage 2.
MODPOST
CC /tmp/vmware-config0/vmmon-only/vmmon.mod.o
LD [M] /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64′
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/vmware-config0/vmmon-only’
The module loads perfectly in the running kernel.
Do you want networking for your virtual machines? (yes/no/help) [yes]
Configuring a bridged network for vmnet0.
Your computer has multiple ethernet network interfaces available: eth0, eth1.
Which one do you want to bridge to vmnet0? [eth0] eth1
The following bridged networks have been defined:
. vmnet0 is bridged to eth1
Do you wish to configure another bridged network? (yes/no) [no]
Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes] no
Do you want to be able to use host-only networking in your virtual machines?
[no]
Extracting the sources of the vmnet module.
Building the vmnet module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmnet-only’
make -C /lib/modules/2.6.18-8.1.6.el5/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64′
CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
CC [M] /tmp/vmware-config0/vmnet-only/netif.o
CC [M] /tmp/vmware-config0/vmnet-only/bridge.o
CC [M] /tmp/vmware-config0/vmnet-only/procfs.o
CC [M] /tmp/vmware-config0/vmnet-only/smac_compat.o
SHIPPED /tmp/vmware-config0/vmnet-only/smac_linux.x86_64.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.o
Building modules, stage 2.
MODPOST
WARNING: could not find /tmp/vmware-config0/vmnet-only/.smac_linux.x86_64.o.cmd for /tmp/vmware-config0/vmnet-only/smac_linux.x86_64.o
CC /tmp/vmware-config0/vmnet-only/vmnet.mod.o
LD [M] /tmp/vmware-config0/vmnet-only/vmnet.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-8.1.6.el5-x86_64′
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory `/tmp/vmware-config0/vmnet-only’
The module loads perfectly in the running kernel.
The default port: 902 is not free. We have selected a suitable alternative
port for VMware Server use. You may override this value now.
Remember to use this port when connecting to this server.
Please specify a port for remote console connections to use [904]
WARNING: VMware Server has been configured to run on a port different from the
default port. Remember to use this port when connecting to this server.
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
Configuring the VMware VmPerl Scripting API.
Building the VMware VmPerl Scripting API.
Using compiler “/usr/bin/gcc”. Use environment variable CC to override.
Installing the VMware VmPerl Scripting API.
The installation of the VMware VmPerl Scripting API succeeded.
Generating SSL Server Certificate
In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines]
The path “/var/lib/vmware/Virtual Machines” does not exist currently. This
program is going to create it, including needed parent directories. Is this
what you want? [yes]
Please enter your 20-character serial number.
Type XXXXX-XXXXX-XXXXX-XXXXX or ‘Enter’ to cancel: XYZZZ-XYZZZ-XYZZZ-ABC91
Starting VMware services:
Virtual machine monitor [ OK ]
Virtual ethernet [ OK ]
Bridged networking on /dev/vmnet0 [ OK ]
The configuration of VMware Server 1.0.3 build-44356 for Linux for this running
kernel completed successfully.
How to Start/Stop/restart VMServer
/etc/init.d/vmware stop/start/restart (stop/start/restart please change the options accordingly)
How do I manage my VMWARE server remotely?
You can now connect from local computer using vmware-server-console program to:
$ vmware-server-console &
You need to enter host name ip:port, username and password to access vmware server.

Setup NIS Server


NIS Server
Build NIS Server in order to share users’ accounts among virtual networks. Following examples show that NIS Server is built on HostOS in virtual networks like NFS Server. It’s necessary to install ypserv for NIS.
First we need to install the ypserv package, we can install it by using the following command
#yum -y install ypserv
// set domain name
#ypdomainname example.com
// add at the bottom of file
#vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=ns.server-linux.info
GATEWAY=192.168.0.1
NISDOMAIN=example.com
#vi /var/yp/Makefile
# MERGE_PASSWD=true|false
MERGE_PASSWD=false// line 42: change
#
# MERGE_GROUP=true|false
MERGE_GROUP=false// line 46: change
#
all: passwd shadow group hosts rpc services netid protocols   // line 109: add shadow
// create a directory for email automatically when a user is added in the system
[root@ns ~]# mkdir -p /etc/skel/Maildir/cur
[root@ns ~]# mkdir -p /etc/skel/Maildir/new
[root@ns ~]# mkdir -p /etc/skel/Maildir/tmp
[root@ns ~]# chmod -R 700 /etc/skel/Maildir/
[root@ns ~]# useradd cent
[root@ns ~]# passwd cent
Changing password for user cent.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
 [root@ns ~]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS servers. ns.server-linux.info is in the list of NIS server hosts. Please continue to add the names for the other hosts, one per line. When you are done with the list, type a .
next host to add: ns.server-linux.info
next host to add: // push Ctrl + D keys
The current list of NIS servers looks like this:
ns.server-linux.info
Is this correct? [y/n: y] y// input ‘y’ and push Enter key
We need a few minutes to build the databases…
Building /var/yp/server-linux.info/ypservers
Running /var/yp/Makefile…
gmake[1]: Entering directory `/var/yp/server-linux.info
Updating passwd.byname…
Updating passwd.byuid…
Updating group.byname…
Updating group.bygid…
Updating hosts.byname…
Updating hosts.byaddr…
Updating rpc.byname…
Updating rpc.bynumber…
Updating services.byname…
Updating services.byservicename…
Updating netid.byname…
Updating protocols.bynumber…
Updating protocols.byname…
Updating mail.aliases…
gmake[1]: Leaving directory `/var/yp/server-linux.info
ns.server-linux.info has been set up as a NIS master server.
Now you can run ypinit -s ns.server-linux.info on all slave server.
[root@ns ~]# /etc/rc.d/init.d/portmap start
Starting portmap: [  OK  ]
[root@ns ~]# /etc/rc.d/init.d/ypserv start
Starting YP server services: [  OK  ]
[root@ns ~]# /etc/rc.d/init.d/yppasswdd start
Starting YP passwd service: [  OK  ]
[root@ns ~]# chkconfig portmap on
[root@ns ~]# chkconfig ypserv on
[root@ns ~]# chkconfig yppasswdd on
// It’s neccessary to update NIS database with following way if new user is added again
[root@ns ~]# cd /var/yp
[root@ns yp]# make
After building NIS Server, Configure on clients in order to share users’ accounts. Following examples show config on GuestOS ‘www’.
[root@www ~]# vi /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=www.server-linux.info
GATEWAY=192.168.0.1
NISDOMAIN=server-linux.info// add the line

[root@www ~]# vi /etc/sysconfig/authconfig

USEWINBINDAUTH=no
USEKERBEROS=no
USESYSNETAUTH=no
FORCESMARTCARD=no
USESMBAUTH=no
USESMARTCARD=no
USELDAPAUTH=no
USELOCAUTHORIZE=no
USEWINBIND=no
USESHADOW=yes
USEDB=no
USEMD5=yes
USEPASSWDQC=no
USELDAP=no
USEHESIOD=no
USECRACKLIB=yes
USENIS=yes// change

[root@www ~]# vi /etc/yp.conf

# Valid entries are
#
# domain NISDOMAIN server HOSTNAME
#Use server HOSTNAME for the domain NISDOMAIN.
#
# domain NISDOMAIN broadcast
#Use broadcast on the local net for domain NISDOMAIN
#
# domain NISDOMAIN slp
#Query local SLP server for ypserver supporting NISDOMAIN
#
# ypserver HOSTNAME
#Use server HOSTNAME for the local domain. The
#IP-address of server must be listed in /etc/hosts.
#
# broadcast
#If no server for the default domain is specified or
#none of them is rechable, try a broadcast call to
#find a server.
#
domain server-linux.info server nfs.server-linux.info  // add the line

[root@www ~]# vi /etc/nsswitch.conf

passwd:files nis// line 33: add
shadow:files nis// add
group:files nis// add

#hosts:db files nisplus nis dns
hosts:files dns nis// add

[root@www ~]# chkconfig ypbind on
[root@www ~]# chkconfig portmap on
[root@www ~]# reboot

www login: cent// user name on NIS
Password:// input password
Last login: Sun Mar 11 22:02:12 on tty1
[cent@www ~]$// could login
[cent@www ~]$ ypwhich
nfs.server-linux.info
[cent@www ~]$ ypcat passwd
cent:x:500:500::/home/cent:/bin/bash
[cent@www ~]$ yppasswd// change password
Changing NIS account information for cent on nfs.server-linux.info.
Please enter old password:// input current password
Changing NIS password for cent on nfs.server-linux.info.
Please enter new password:// input new password
Please retype new password:// verify

The NIS password has been changed on nfs.server-linux.info.

SVN installation with Apache


1. First of all, install apache/httpd
* yum install httpd
2. Make sure you apache is running. You can also type ‘http://localhost’ at your browser and apache test page should appear if your apache is running
* /etc/init.d/httpd status
3. Make it start by default on startup
* chkconfig httpd on
4. Edit the apache configuration to suit your need. If not sure, leave the default setting as it is
* vi /etc/httpd/conf/httpd.conf
5. Install subversion and mod_dav_svn for apache
* yum install mod_dav_svn subversion
6. Go to subversion.conf in /etc/httpd/conf.d/. Edit as below
* cd /etc/httpd/conf.d/
* vi subversion.conf
1. This is the most basic configuration where anyone will have unrestricted access to the repos. Location is the name that will be used in the browser address bar. In this example it will be ‘http://localhost/svn/repos
2. This is a configuration with username and password for the client
DAV svn
SVNListParentPath on
SVNParentPath /usr/local/svn/
AuthType Basic
AuthName “Subversion repositories”
AuthUserFile “/etc/httpd/conf.d/svnuserconf”
Require valid-user
1.
* htpasswd -cm /etc/httpd/conf.d/svnuserconf admin — This command is not needed for the first configuration. To create the first user with password
* htpasswd -m /etc/httpd/conf.d/svnuserconf pawan — use this command to add another user
2. Configure your repository
* mkdir /usr/local/svn — create folder svn
* cd /usr/local/svn — change diectory to the newly created svn directory
* svnadmin create repos — create svn repository named repos
* chown apache.apache -R repos — change ownership of ‘repos’ to apache
* /etc/init.d/httpd restart — restart apache
* If you are running different apache change port no from conf file.
3. Open you browser and type ‘http://localhost/svn/repos’. You can see that a page with ‘Revision 0:/’ will appear. Congratulation, you just completed the setup for svn server