how to test web-server

In this exmple My WEB-SERVER Ip Is 45.56.109.180 which is listening on port 80

mohammedrafi@NOC-RAFI:~$ nmap 45.56.109.180

Starting Nmap 6.40 ( http://nmap.org ) at 2016-04-01 08:16 IST
Nmap scan report for li911-180.members.linode.com (45.56.109.180)
Host is up (0.26s latency).
Not shown: 994 closed ports
PORT     STATE    SERVICE
22/tcp   open     ssh
80/tcp   open     http
139/tcp  filtered netbios-ssn
444/tcp  filtered snpp
1434/tcp filtered ms-sql-m
8080/tcp open     http-proxy

[root@li911-180 ~]# tail /etc/httpd/conf/httpd.conf 
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<virtualhost *:80>
documentroot /var/www/html/
directoryindex sample.html
servername li911-180.members.linode.com
</virtualhost>

I am editing my server name anything i can put

[root@li911-180 ~]# nano /etc/httpd/conf/httpd.conf 

[root@li911-180 ~]# service httpd status
httpd (pid  5112) is running…

[root@li911-180 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

[root@li911-180 ~]# httpd -t
Syntax OK

[root@li911-180 ~]# tail /etc/httpd/conf/httpd.conf 
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<virtualhost *:80>
documentroot /var/www/html/
directoryindex sample.html
servername rafi.admin.com
</virtualhost>

===========================TESTING============================

mohammedrafi@NOC-RAFI:~$telnet   45.56.109.180     80
Trying 45.56.109.180…
Connected to 45.56.109.180.
Escape character is ‘^]’.
HEAD / HTTP/1.1
HOST: rafi.admin.com

HTTP/1.1 200 OK
Date: Fri, 01 Apr 2016 02:38:31 GMT
Server: Apache/2.2.15 (CentOS)
Last-Modified: Mon, 28 Mar 2016 02:49:56 GMT
ETag: “e70a-33-52f12f7ca8b0a”
Accept-Ranges: bytes
Content-Length: 51
Connection: close
Content-Type: text/html; charset=UTF-8

Connection closed by foreign host.

TO SEE THE CONTENT IN WEB-SERVER USE GET METHOD
mohammedrafi@NOC-RAFI:~$telnet 45.56.109.180 80
Trying 45.56.109.180…
Connected to 45.56.109.180.
Escape character is ‘^]’.
GET / HTTP/1.1
HOST: rafi.admin.com
HTTP/1.1 200 OK
Date: Fri, 01 Apr 2016 02:41:02 GMT
Server: Apache/2.2.15 (CentOS)
Last-Modified: Mon, 28 Mar 2016 02:49:56 GMT
ETag: “e70a-33-52f12f7ca8b0a”
Accept-Ranges: bytes
Content-Length: 51
Connection: close
Content-Type: text/html; charset=UTF-8
<head>
<body>
hello guies how are u
</body>
</head
Connection closed by foreign host.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s