INSTALL AND CONFIGURE WEBSERVER



INSTALL AND CONFIGURE WEBSERVER


yum search apache
yum search apache | grep "server"

it provide list of the packages and now install apache or http server by following cmnd's

yum install httpd
systemctl start httpd
systemctl status httpd

root of the apache web server located in /var/www

cgi-bin html folders are there intially.

you can put html pages in html folder
DocumentRoot=/var/www/html

(cmd to connect internet using dhcp - dhclient)

now connect the server
ex in windows machinf open browser
and type 192.168.0.84 - if u r not getting.

ping ip from windows machine (if it is connected then there is problem with polices)

now in server
give
iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
or
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

to check policy

iptables _L | grep 80

to delete policy

iptables -D INPUT 1
or
iptables -D INPUT -p tcp --dport 80 -j ACCEPT

now connect to http server
it's working

config file of http
/etc/httpd/conf/httpd.conf

NMAP - USED FOR SCANNING THE ENTIRE HOSTS IN THE NETWORK MEANS IT INFORM US WHETER THE THE GIVEN HOST IS UP OR NOT AND WHAT PORTS(ON WHICH SERVICES ARE RUNNING) ARE UP ETC..
ex
nmap 192.168.0.84
result: host is up and listening ports 22,80,111

now stop httpd - systemctl stop httpd.service
then scan again
nmap 192.168.0.84 -v -p 80
v-verbose
p-port

now it outpouts as 80 port closed

elinks: A TEXT MODE WEB BROWSER
we can use text based browser from our terminal acess the webserver inorder to confirm wheter it is fuctional or not

now install elinks

yum install elinks
from there
elinks http://192.168.0.84
then it o/p's text mode browser

Comments

Popular posts from this blog

Power Broker

zabbix-introduction

variables in shell scripting