Wednesday, December 21, 2011

How to configure linux samba server step by step guide Example and Implementation

Most Linux systems are the part of networks that also run Windows systems. Using Linux Samba servers, your Linux and Windows systems can share directories and printers. This is most use full situation where your clients are window native and you want to use the linux security features.
Exam question There are mixed lots of System running on Linux and Windows OS. Some users are working on Windows Operating System. There is a /data directory on linux server should make available on windows to only vinita should have right to connect with samba server . Configure to make available.

Configure samba server

In this example we will configure a samba server and will transfer files from client side.For this example we are using two systems one linux server one window clients.
per quest of samba server
  • A linux server with ip address 192.168.0.254 and hostname Server
  • A window client with ip address 192.168.0.2 and hostname Client2
  • Updated /etc/hosts file on linux system
  • Running portmap and xinetd services
  • Firewall should be off on server
We have configured all these steps in our pervious article.
We suggest you to review that article before start configuration of samba server. Once you have completed the necessary steps follow this guide.
samba rpm is required to configure samba server. check them if not found then install
rpm for samba server
Now check smb, portmap, xinetd service in system service it should be on

#setup
Select System service from list
[*]portmap
[*]xinetd
[*]smb
Now restart xinetd and portmap and smb service
service restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status
Create a normal user named vinita
useradd
now create /data directory and grant it full permission
mkdir
open /etc/samba/smb.conf main samba configuration files
vi smb.conf
By default name of workgroup is MYGROUP in smb.conf file. you can change it with desire name
workgroup tag
our task is to share data folder for vinita user so go in the end of file and do editing as shown here in this image
share data folder in smb.conf
save file with :wq and exit
Now add vinita user to samba user
smbpasswd
we have made necessary change now on smb service and check it status
service smb status
if you already have on this service then restart it with service smb restart commands.

Client configuration for samba server

Go on windows system and ping samba server, change computer name to client2 and workgroup name to MYGROUP
my computer properties
reboot system after changing workgroup name
After reboot open my network place here you can see samba server [ if not see then click on view workgroup computer in right pane, if still not see then use search button from tool bar and search computer samba server form ip ]
samba server in my network place
First try to login from user nikita she will not successes as nikita have not permission to login
user nikita deny
Now login from user vinita [ give the password which you set with smbpasswd command ]
user vinita
As you can see in image user vinita gets the /data folder which we share from samba server
data folder on widow
Copy some window files in data folder
copy in data folder

Check status on samba server

on samba server you can check runtime status of samba server to check it run smbstatus command
smbstatus
in output you see that one samba shared directory is used on window system

Tuesday, December 20, 2011

How to configure linux web server step by step guide Example and Implementation

When you view a web page over the Internet, the code to create that page must be retrieved from a server somewhere on the Internet. The server that sends your web browser the code to display a web page is called a web server. There are countless web servers all over the Internet serving countless websites to people all over the world. Whether you need a web server to host a website on the Internet a Red Hat Enterprise Linux server can function as a web server using the Apache HTTP server. The Apache HTTP server is a popular, open source server application that runs on many UNIX-based systems as well as Microsoft Windows.
Exam question 1 There are two sites www.vinita.com and www.nikita.com. Both sites are mappings to 192.168.0.X IP address where X is your Host address. Configure the Apache web server for these sites to make accessible on web

Configure web server

In this example we will configure a web server.
necessary rpm for web server is httpd, httpd-devel and apr check them for install
rpm
Now configure the ip address to 192.168.0.254 and check it
ifconfig
start httpd daemons and verify its running status
pgrep httpd

Configure virtual hosting

In this example we will host a website www.vinita.com to apache web server. create a documents root directory for this website and a index page
mkdir vinita
for testing purpose we are writing site name in its index page
index.htm
save file and exit
now open /etc/hosts file
hosts
in the end of file bind system ip with www.vinita.com
entry of vinita in hosts
now open /etc/httpd/conf/httpd.conf main configuration file of apache server
vi httpd.conf
locate virtual host tag
virtual host
remove # from the beginning and add the IP of host
virtual host
Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file. change these seven lines as shown in image
httpd.conf
now save this file and exit from it
you have done necessary configuration now restart the httpd service and test this configuration run links command
links
means you have successfully configured the virtual host now test it with site name
links vinita
In output of links command you should see the index page of site

Configure multiple site with same ip address

At this point you have configured one site www.vinita.com with the ip address 192.168.0.254. Now we will configure one more site www.nikita.com with same ip address
create a documents root directory for www.nikita.com website and a index page
create virtual directory
for testing purpose we are writing site name in its index page
index.htm
save file and exit
now open /etc/hosts file and bind system ip with www.nikita.com
hosts
now open /etc/httpd/conf/httpd.conf main configuration file of apache server
vi httpd.conf
Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file. change these seven lines as shown in image
httd.conf
now save this file and exit from it
you have done necessary configuration now restart the httpd service
service httpd restart
test this configuration run links command
links
In output of links command you should see the index page of site

configure multiple site with multiple ip address

Now we will host multiple sites with multiple ip address. Create a virtual lan card on server and assign its an ip address of 192.168.0.253. [ if you don't know how to create virtual lan card and read our pervious article how to create virtual lan card ]. we will create a testing site www.nidhi.com and will bind it with ip address of 192.168.0.253
create a documents root directory for www.nidhi.com website and a index page
vi nidhi
for testing purpose we are writing site name in its index page
index.htm
save file and exit
now open /etc/hosts file and bind system ip with www.nidhi.com
hosts
now open /etc/httpd/conf/httpd.conf main configuration file of apache server
vi httpd.conf
Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file. change these seven lines as shown in image
httpd.conf
now save this file and exit from it
you have done necessary configuration now restart the httpd service
service httpd restart
test this configuration run links command
links
In output of links command you should see the index page of site

How to create site alias

Now I will show you that how can you use site alias to configure more name of same site. we configure a site www.vinita.com in stating of example. now we will create www.goswami.com site alias for this site so this site can be access with both name.
To create alias first make its entry in /etc/hosts file as shown here
hosts
Now open main apache configuration /etc/httpd/conf/httpd.conf
vi httpd.conf
Now go in the end of file and copy last seven line [ virtual host tag ] and paste them in the end of file. change these seven lines as shown in image
httpd.conf
now save this file and exit from it
you have done necessary configuration now restart the httpd service and test this configuration run links command
links
In output of links command you should see the index page of site
webpage of goswami