Top Ad unit 728 × 90

Latest updates

recent

WEB SERVER



### TO CONFIGURE THE WEB SERVER ###
'Step 1:-Check the Ip & Assign the Hostname'
# ifconfig (to check ip)
# hostname www.abc.com
# vi /etc/hosts (provide the entry of hostname with ip)
# vi /etc/hostname (to make hostname permanent)

'Step 2:-Install the Package'
# yum install http* -y

'Step 3:-Edit the M.C.F (Main Configuration File)'
# vim /etc/httpd/conf/httpd.conf
Come at last and add the Coding(case sensitive) manually
as given below:-

<VirtualHost *:80>
ServerAdmin root@abc.com
ServerName www.abc.com
DocumentRoot /var/www/html
DirectoryIndex abc.html
</VirtualHost>

:wq(save & quit the file)


'Step 4:-Create Web Page in Database Location'
# cd /var/www/html
# vi abc.html (create a web page file)
WELOME TO ABC TECHNOLOGIES
:wq(save & Quit the file)

'Step 5:-Restart the Service & Check result'
# service httpd restart
# systemctl enable httpd.service (to enable permanent)
# firefox http://www.abc.com
# firefox http://192.168.0.100 (to check from client pc)

'Step 6:-TO IMPLEMMENT NAME BASED VIRTUALHOSTING'
Requirement to host 2 more websites(redhat,cisco)

(A)Open M.C.F:-
# vim /etc/httpd/conf/httpd.conf
Come at last & Copy last 6 lines & Paste
Replace abc with redhat
Copy last 6 lines & paste
Replace redhat with cisco
:wq(save & quit the file)

(B)Create Web Pages:-
# cd /var/www/html
# vi redhat.html (create webpage)
# vi cisco.html

(C)Provide Entry in Host File:-
# vi /etc/hosts
192.168.0.100 www.abc.com
192.168.0.100 www.redhat.com
192.168.0.100 www.cisco.com
:wq(save & quit the file)

(D)Restart the Service & Check the result:-
# service httpd restart
Access the Websites with Name in Same PC


'Step 7:-TO IMPLEMMENT IP BASED VIRTUALHOSTING'
Requirement to Host redhat & cisco with different ip

(A)Assign Virtual IP's:-
# ifconfig enp1s6:0 192.168.0.111
# ifconfig enp1s6:1 192.168.0.222
# ifconfig (to check)

(B)Open M.C.F & Provide Ip's:-
# vim /etc/httpd/conf/httpd.conf
Go to redhat & Cisco coding & do the changes as below:-
<VirtualHost 192.168.0.111:80> <---FOR REDHAT
<VirtualHost 192.168.0.222:80> <---FOR CISCO
:wq(save & quit the file)

(C)Change the Ip's in Host File:-
# vi /etc/hosts
192.168.0.100 www.abc.com
192.168.0.111 www.redhat.com
192.168.0.222 www.cisco.com
:wq(save & quit the file)

(D)Restart the Service & Check the Result:-
# service httpd restart
Go to Client Pc & Access 3 websites with Ip's

'Step 8:-TO IMPLEMMENT PORT BASED VIRTUALHOSTING'
Requirement to Host Cisco Website on Different Port

(A)Open the M.C.F:-
# vim /etc/httpd/conf/httpd.conf
Come Near the Cisco Coding & Replace port.80 with a random port
number as given below
LISTEN 5000 <---ADD THIS LINE MANUALLY
<VirtualHost 192.168.0.222:5000>
:wq(save & Quit the file)

(B)Restart the Service & Check the Result:-
# service httpd restart
# firefox http://www.cisco.com:5000
# firefox http://192.168.0.222:5000 (in client pc)

'Step 9:-TO CHECK THE SERVER LOG FILES'
# cd /var/log/httpd (access in the webserver pc)
# cat access_log (read this file)

'TO ADD THE SERVERS IN DNS BELONGS TO DIFFERENT DOMAIN'

Step 1:-Configure the DNS Server in Separate PC
Hostname:dns.abc.com Ip:192.168.0.200 (for ex)

Step 2:-As per the above Websites, Provide the entry of www.abc.com
directly in forward lookup zone file of dns server

Step 3:-To Provide the Entry for Redhat & Cisco
# vim /etc/named.rfc1912.zones
Copy the lines from 19-23 & paste at last
Replace abc with redhat & change file name to "redhat"
Copy last 5 lines & paste
Replace redhat with cisco & change the file name to "cisco"

Step 4:-Create Zones File in DNS Database
# cd /var/named
# cp -p named.localhost redhat
# cp -p named.localhost cisco
Open this files & do the modification as per the server name
& ip address (see dns notes)

Step 5:-Restart the Service & Check the Result
# service named restart
give the dns server main ip in client pc & try to access the
Websites with name
WEB SERVER Reviewed by Unknown on 2:02 PM Rating: 5
© 2007 - 2016. All Rights Reserved by Babashaheer Blog

Contact Form

Name

Email *

Message *

Powered by Blogger.