Saturday, 10 August 2013

HOW TO CONFIGURE VNC SERVER IN LINUX

VNC server is a used to share desktop with remote computer. VNC works on client server architecture. To share desktop you need vnc-server package and to access from other computers you need vnc-viewer. In this tutorials I will show you how to configure vnc server.
For demonstration purpose we will use two linux systems. Both systems should have graphics installed.

To configure VNC- Server

Boot system in init 5 or graphic mode. vnc-server rpm is required to configure server check it if not found install it.
rpm
now click on preferences from system and select remote desktop
vnc
This will launch a new window where you can set sharing and security for remote desktop
set password on server
Allow other users to view your desktop check this option if you to present your desktop on other computer
Allow other users to control your desktop Check this options if you want to grant permission to control user desktop to other user
In security tab you can set password for the user who want to connect with server [Recommended]

Configure Linux client

Go on client system and ping server. vnc-viewer rpm is required to configure clients
vnc viewer
check it and if not found install
Now select accessories from application menu and click on vnc viewer
vnc viewer
this will launch a window Give vnc server ip in it and click on ok
give ip in vnc vieawer
Once connected it will ask for password Give the password which you set on server
enter password in vnc
On server side it will show a pop up and ask for permission click on allow
grant permission
After getting permission from server side you can use server desktop on client side
use server desktop

HOW TO CONFIGURE SAMBA SERVER IN LINUX

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

HOW TO CONFIGURE WEBSERVER IN LINUX

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
rpmNow 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
if links command retrieve your home page

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
webpage of vinita

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. 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