Welcome to

LINUX WORLD

Rohit Mehta : A Linux Follower

bangalore, Karnataka, India
hi! i m a person who is chill all time. Since jan 2008 i am working for Novell software. The word Impossible does not exist in my dictionary because Impossible says i m possible...hey guys have fun with linux...it begins but has no end......
Showing posts with label Server. Show all posts
Showing posts with label Server. Show all posts

Tuesday, November 17, 2009

How To Make A NFS Share


http://funlinuxfun.blogspot.com/
nfsNFS(Network File System) is a viable solution for sharing disk space between two linux/unix machines/servers. NFS uses a standard client/server architecture. The server portion consists of physical disks containing shared file system and several daemons that make shared file system visible and available for use by NFS clients. NFS clients simply mount the exported file system, known as NFS mounts.
Note: While making a nfs share we should export directories only under / directory and only the local file systems.
Some of the important nfs daemons are:
.rpcbind
.nfs
.netfs
.nfslock
.portmapper
Steps for making a NFS share and exporting the nfs share to the client:
Step1.)Generally all the linux versions comes with the nfs package installed. One can check using:
#rpm –aq |grep nfs
redhat-config-nfs-1.1.3-1
nfs-utils-1.0.1-3.9
Step2.) Configure the /etc/exports file. It is the main nfs configuration file and has two columns.
The first column lists the directories you want to make available to the network. The second column has two parts. The first part lists the networks or DNS domains that can get access to the directory, and the second part lists NFS options in brackets.
eg:
/home 192.168.1.0/24(rw,sync) #this meas that home directory is exported to 192.168.1.0 domain
with read,write permissions.
sync option ensures that file data cached in memory is automatically written to the disk after the completion of any disk data copying operation.
rw can be replaced by ro for making the share read only.
Step 3. ) Use chkconfig command to start nfs services at the boot time
# chkconfig nfs on
# chkconfig nfslock on
# chkconfig rpcbind on
Step 4.)Use the init scripts in the /etc/init.d directory to start the nfs and RPC rpcbind daemons.
#service rpcbind start
#service nfs start
#service nfslock start
Step 5.)Check nfs services by:
#rpcinfo -p #for local machine
#rpcinfo -p hostname #for remote machine
Step 6.)We can check the mounts using:
#showmount -e
Step 7.)When no directories have yet been exported to NFS, use the following command.
#exportfs -a
When adding a shared directory, you can use the following command to export only the new entries.
#exportfs -r
Step 8.)Configuring the nfs client:
Start the nfs daemons on the nfs client also:
Use the chkconfig command to configure the required nfs and RPC rpcbind daemons to start at boot:
#chkconfig nettfs on
#chkconfig nfslock on
#chkconfig rpcbind on
Use the init scripts in the /etc/init.d directory to start the nfs and RPC rpcbind daemons:
# service rpcbind start
# service netfs start
# service nfslock start
Test whether NFS is running correctly:
#rpcinfo -p
Step 9.)On the nfs client add the shared mount entry in the /etc/fstab file:
vi /etc/fstab
#Directory Mount Point Type Options Dump FSCK
192.168.1.100:/home /mnt/nfs nfs defaults 0 0
save and quit from the file
Reload the fstab file by:
#mount -a
Step 10.)Now we can access the nfs share by going into directory in which we have mounted the export on the client side.

How To Configure YUM Server/Yum Repository


http://funlinuxfun.blogspot.com/
linux-logo-250x300Sometimes one may find himself in dependcy resolution problem while installing rpm packages on linux. Yum(Yellowdog update manager) server is a viable solution to it which holds the repository of linux packages and allows users to take packages .Client can easily install packages with simple commands using the yum installer .Which protocol does yum uses for the tranfer of packages from client to server side?
yum uses ftp protocol for the transfer of packages from client to server side.
Configuring the yum server:
Step1:)Mount the linux dvd/iso to some preexisting directory.
#mount /dev/cdrom /mnt/
Step2:) Intsall the vsftpd package and createrepo package:
#rpm –ivh vsftpd-2.0.5-12.el5
#rpm –ivh createrepo-0.4.11-3.el5
Step3:)Copy the entire DVD to /var/ftp/pub directory:
# cp -rvf /mnt/* /var/ftp/pub/
Step4:)Move to the pub direcorty:
# cd /var/ftp/pub/
#cp Server/repodata/comps-rhel5-server-core.xml Server
# cd Server/
#createrepo -vg comps-rhel5-server-core.xml /var ftp/pub/Server
Step5:)Restart vsftpd service
#service vsftpd restart
Step6:)To enable service start at the boot time type the following command:
#chkconfig vsftpd on
yum server has been established and can be used for downloading the packages.
Configuring the yum client:
Step1:)Create the yum repository file.
#vi /etc/yum.repos.d/ser.repo
enter the following configuration lines.
[Server]
name=any meaningful name
baseurl=ftp://192.168.1.1/pub/Server #enter the ip adress of the yum server
baseurl=file:///var/ftp/pub/Server #if both client and server are same machine
gpgcheck=0
save and exit.
Now you can easily download packages using the yum command:
For more options go to man yum.conf


How To configure a samba share on redhat/linux


http://funlinuxfun.blogspot.com/
logo-sambaSometimes your network may consists of Windows and Linux system.Samba server is the viable solution for file and printer sharing between linux and windows machines. Samba allows files and printers to be shared by all the systems in a network.
For networks having only Linux system we should go forNFS server.On how to configure NFS share read this
Samba server uses the SMB protocol for sharing files and printers across the network.

For configuration for samba server we need to install samba rpm packages.
For installing package:
# rpm -ivh samba
If your system supports yum installation use:
# yum –y install samba
If your system does not support yum installation you can configure yum server for your network. For
The default configuration file for samba is /etc/samba/smb.conf which allows users to view their home directories as a Samba share. It also shares all printers configured for the system as Samba shared printers.
If you change this configuration file, the changes do not take effect until you restart the Samba daemon with the following command .
# services smb restart.
To specify the Windows workgroup , edit the following lines in your smb.conf file:
workgroup = WORKGROUPNAME
If you want to restrict users to access samba share only form your domain then
In section1:
host allow = your domain ip-address
To create a samba share which can be accessed on windows.Go to the last section of the configuration file for samba and add the following lines
[sharename]
comment = Insert a comment here
path = /home/share/
valid users = tfox carole
public = no
writable = yes
printable = no
You then need to add samba password for the valid users which will access the samba share on the windows machine
#smbpasswd –a username
#service smb restart
To enable service start after the reboot:
#chkconfig smb on
Samba also provides you with a utility called testparm for checking its default configuration file.
# testparm
The above command will show you all the shared folders and printers.
One can also login into the samba share on linux machine with the following command.
#smbclient //ip-address/share-name –U username
Enter the password prompted for and access the samba share.

How to enable anonymous uploads on ftp server in linux


http://funlinuxfun.blogspot.com/
ftp logoAnonymous FTP is the choice of Web sites that need to exchange files with numerous unknown remote users. Common uses include downloading software updates. anonymous FTP requires only a username of anonymous and your email address for the password. Once logged in to a VSFTPD server, you automatically have access to only the default anonymous FTP directory (/var/ftp in the case of VSFTPD) and all its subdirectories .You as an anonymous user may be able to download the files but not upload unless configured on your FTP server (VSFTPD server in this case).

Firstly you need to install vsftpd package :
#rpm –ivh vsftpd
If your system supports yum distribution then you can also install using.
#yum –y install vsftpd

Next we need to edit to vsftpd configuration file:
The main vsftpd configuration file is /etc/vsftpd/vsftpd.conf
Open the file using your favourite editor: I m using vim in this case:
# vim /etc/vsftpd/vsftpd.conf
Enable the following two lines:
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES

chown_uploads=YES

Enable the following line and change whoever which is default enrty to root
chown_username=root
Add the following line anywhere in the configuration file:
anon_umask=077
Save and exit
Next we need to create a directory where the anonymous user will upload the files and we need to change the permission and ownership of that directory.
# mkdir /var/ftp/incoming/
# chmod 773  /var/ftp/incoming/
#  chown root:daemon  /var/ftp/incoming
Restart the service
# service vsftpd restart
To enable it after the reboot
#chkconfig vsftpd on
After doing this step you can allow anonymous users to uploads file onto your ftp server.

How to configure squid proxy server on redhat/linux


http://funlinuxfun.blogspot.com/
5-26-2009-6-17-01-PMWhat actually a proxy server means??
A proxy server is a server within a network which provides an extra layer of security and prevents the users direct access to the internet.. Squid is the most widely used proxy server which also provides caching which enablessquid to store requested objects and thus speeding up internet access.
Configuring a squid proxy is an easy task and allows you with wide number of options to configure your users access to the internet .
The best part is that squid is supported on all open source platforms
In this article I will explain on how to configure squid proxy server on redhat / linux.

For configuring squid server we first we need to install squid rpm
Step: 1)
#rpm –ivh squid-2.6.STABLE-5.el5_1.3.i386.rpm
You can also use yum repository for installation . If your system doesnot provide you can configure the yum server for your own
After configuring yum server install the squid rpm using
#yum –y install squid
Step2:) Open the squid main configuration file :
#vim /et c/squid/squid.conf

This is the main configuration file which holds all the squid settings and controls.
Step3:) Squid , by default runs on port 3128. If we need to change the web proxy port.
In the file search for http_port 3128 and change it to http_port 8080.
Now your squid web proxy will run on port 8080.
Step4:) Next you need access rules for the proxy server which are known as ACL to limit users’ ability to browse the Internet. Squid matches each Web access request it receives by checking the http_access list from top to bottom. If it finds a match, it enforces the allow or deny statement and stops reading further. You have to be careful not to place a deny statement in the list that blocks a similar allow statement below it. The final http_access statement denies everything, so it is best to place new http_access statements above it
Here are some examples of the ACL
¬
Restricting web access by IP address
acl mylan src 172.24.0.0/16
http_access allow mylan
Restricting web access by phrase in the url
acl myphrase url_regex phrase
http_access deny myphrase

Step 5:) Like every linux application squid needs to be restarted for changes to the configuration file can take effect..
# service squid restart
For enabling squid startup after the reboot:
#chkconfig squid on
You need to force users to use your proxy server by configuring the proxy setting in the web browser.
Now you can add an extra layer of security and reduce internet bandwidth charges.

Which Linux distribution has ease of use?