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.
