Loading...
Advance Linux

Web Server

#### TO CONFIGURE THE WEBSERVER ####
Step 1
###### TO ASSIGN THE HOSTNAME #####
hostname www.zoom.com
hostname ( to check )
ifconfig ( to check the ip )
vi /etc/hosts ( to provide the ip & hostname )
192.168.0.180  www.zoom.com www
:wq ( save &  quit )
vi /etc/hostname ( to make permanent )
www.zoom.com
:wq ( save &  quit )
#### Step 2 #### TO INSTALL THE PACKAGE ####
rpm  -e  httpd  –nodeps ( to remove )
yum  install httpd  -y  ( to install )
rpm -q httpd  ( to query )
#### Step 3 ### TO CONFIGURE THE M.C.F ####
vi  /etc/httpd/conf/httpd.conf
come end of file & add this lines
<VirtualHost *:80>
ServerName  www.zoom.com
ServerAdmin root@zoom.com
DocumentRoot  /var/www/html
DirectoryIndex zoom.html
</VirtualHost>
:wq ( save & quit )
#### Step 4 ### TO START THE SERVICE ####
service httpd restart
#### Step 5 ### TO CREATE A HOME PAGE ####
cd /var/www/html  ( to ente the dir )
vi zoom.html ( to create a page )
this is zoom.com
:wq (save &  quit )
##### Step 6 ### TO CHECK THE WEBSITE ###
open the browser
http://www.zoom.com
##### TO CONFIGURE THE NAME BASED ####
vi  /etc/hosts  ( to provide the ip & hostname )
192.168.0.180  www.zoom.com
192.168.0.180  www.linux.com
:wq ( save & quit )
vi /etc/httpd/conf/httpd.conf ( to open the m.c.f )
come end of file &  copy 6 lines then paste
<VirtualHost *:80>
ServerName  www.linux.com
ServerAdmin root@linux.com
DocumentRoot  /var/www/html
DirectoryIndex linux.html
</VirtualHost>
:wq ( save &  quit )
service httpd restart ( To start the service )
open the browser
http://www.zoom.com
http://www.linux.com
##### TO CONFIGURE THE  IP  BASED ####
ifconfig ( to check the ip )
ifconfig enp1s7:0 192.168.0.181 (to assign virtual ip
ifconfig  ( to check  )
vi /etc/hosts ( to provide the ip  )
192.168.0.180  www.zoom.com www
192.168.0.181  www.linux.com www
:wq ( save &  quit )
vi  /etc/httpd/conf/httpd.conf ( to open m.c.f )
come end of file & assign the ip for linux website
<VirtualHost 192.168.0.181:80>
:wq ( save &  quit )
service httpd restart ( To start the service )
open the browser
http://192.168.0.181  ( to check the linux website )
#### TO CONFIGURE THE PORT BASED ####
vi  /etc/httpd/conf/httpd.conf ( to open m.c.f )
come end of file & add this  line for linux website
LISTEN 8000
<VirtualHost 192.168.0.181:8000>
:wq  ( save &  quit )
service httpd restart ( to start the service )
open the browser
http://192.168.0.181:8000 ( To check linux website )



 

#### TO CONFIGURE THE HTTPS #########

first  configure the http

#### Step 1 ### TO ASSIGN THE HOSTNAME #####

#hostname www.zoom.com

# hostname  ( to check )

#ifconfig ( to check the ip )

#vi /etc/hosts ( to provide the ip & hostname )
192.168.0.20  www.zoom.com www
:wq ( save &  quit )

#vi /etc/hostname  ( to make permanent )
www.zoom.com
:wq  ( save &  quit )

#### Step 2 #### TO  INSTALL THE PACKAGE ####

#yum install http*  mod_ssl*  -y

#rpm -qa http*  mod_ssl*  ( to query )

#### Step 3 ### TO CONFIGURE THE M.C.F OF HTTP #####

#vim  /etc/httpd/conf/httpd.conf

come end of file
<VirtualHost *:80>
ServerAdmin  root@zoom.com
DocumentRoot  /var/www/html
DirectoryIndex zoom.html
ServerName  www.zoom.com
</VirtualHost>
:wq ( save & quit )

#cd  /var/www/html  ( To enter the dir )

#vi  zoom.html  ( to create a home page )

#### Step 4 ### TO START THE SERVICE #####

#service httpd restart

#### Step 5 ### TO OPEN THE BROWSER ####

firefox http://www.zoom.com

#### Step 6 ##### TO CREATE  THE CERTIFICATES & KEY  ######

#cd  /etc/pki/tls/certs    ( to enter the dir )

#make zoom.crt ( to create the certificates )

#ls  ( to check )

#mv  zoom.key   /etc/pki/tls/private  ( To move the key )

### Step 7 #### TO CONFIGURE THE M.C.F OF HTTPS ####

vim  /etc/httpd/conf.d/ssl.conf

go to line  100  replace   localhost.crt zoom.crt
go to line  107  replace   localhost.key zoom.key

come end of file & add this parameter above the line last of file

ServerAdmin  root@zoom.com
DocumentRoot  /var/www/html
DirectoryIndex zoom.html
ServerName  www.zoom.com
:wq  ( save &  quit )

#### Step 8 ### TO START THE SERVICE ####

service httpd restart

#### Step 9 ### TO OPEN THE BROWSER ####

firefox  https://www.zoom.com

### Step 10 ### TO REDIRECT HTTP TO HTTPS ####

vim  /etc/httpd/conf/httpd.conf

come end of file

above the line </VirtualHost> add this  line

Redirect /  https://www.zoom.com:443

:wq ( save & quit )

#service httpd restart  ( to start the service )

#### Step 11 ### THEN OPEN THE BROWSER ###

firefox   http://www.zoom.com

#### Step 12 ## TO CHECK THE LOGFILES OF HTTP ###

tail  /var/log/httpd/access_log

### Step 13 ### TO CHECK THE LOGFILES  OF HTTPS ###

tail  /var/log/httpd/ssl_access_log

Leave a Reply

Your email address will not be published. Required fields are marked *