Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

BLock access to webserver using IP address

hi,
 i have got apache running with name based virtual hosts. I am hosting aroung 5 sites on the same sevver. The problem is when I type the IP address of the server in the browser, the pages of the first virtual host in httpd.conf gets displayed.

 I dont want any one to access my server using IP address on the internet. How to block this in apache?? I tried specifying an desfault virtual host but doesnt seem to work.

 It would be great , if anyone can enligthen me on this issue
0
kiran0212
Asked:
kiran0212
  • 2
2 Solutions
 
samriCommented:
This is common, the first Virtualhost will be the default for any request not matching any other vhost.

how does you default vhost configuration looks like.

how about

<VirtualHost *>
  Order allow,deny
</VirtualHost>

more info: http://httpd.apache.org/docs/mod/mod_access.html
0
 
heskyttbergCommented:
Hi!

Create a virtual host that has IP as name.
That shoudl do it.

Regards
/Hans - Erik Skyttberg
0
 
samriCommented:
and I think you would still need to have the restriction on the vhost.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now