how to block the access to the server all over the IP

Problems with the Windows version of XAMPP, questions, comments, and anything related.

how to block the access to the server all over the IP

Postby pafeu » 24. November 2010 00:39

I welcome
how to block the access to the server all over the address ip
I want the access to my server to be but through the domain address
I am novice please for accurate writing what where to put so that acts
I apologise for my tongue but I am not good at English and I translated this text with translator :wink:
help me
pafeu
 
Posts: 2
Joined: 24. November 2010 00:02

Re: how to block the access to the server all over the IP

Postby Altrea » 24. November 2010 06:20

sorry, i don't understand what you want to have.
Please can you try to explain this?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: how to block the access to the server all over the IP

Postby Nobbie » 24. November 2010 11:53

Er möchte, dass sein Server nur via Domainnamen erreichbar ist, nicht aber durch Eingabe der Server-IP. Das geht natürlich so nicht, "erreichbar" ist der Server immer, aber man kann natürlich VirtualHosts so einrichten, dass der Default-Fall (erster Host) eine Fehlermeldung ausgibt.

Das darfst Du ihm jetzt auf englisch erklären und zwar so, dass er es auch versteht... ;)

P.S.: Elegant wäre auch einfach einen Redirect auf den Domainnamen zu machen. Sicher auch eine gute Lösung.
Nobbie
 
Posts: 8761
Joined: 09. March 2008 13:04

Re: how to block the access to the server all over the IP

Postby JonB » 24. November 2010 17:58

I think I know what you are asking -

You want to make it so the only time a user gets the website is when they type in a Domain Name

You will have to set up at least two Named Virtual Hosts.

The First virtual host can be empty basically - just an index.html if you want - when someone types the IP address of your XAMPP server or its router - they will get the 'empty web site' (with just a placeholder page) - it SHOULD have at least one page to prevent 404 errors.

the name for this first Virtual Host can be anything - but probably localhost is best.

The second virtual host will be the 'real site' - and its name will the the hostname+domainname

i.e - http://www.mydomain.com

And that is where you will put your files, documents and scripts.

How to do this:

http://httpd.apache.org/docs/2.0/vhosts/name-based.html

Also look at this:
XAMPP has an example to follow in \xampp\apache\conf\extra\httpd-vhosts.conf


Good Luck

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: how to block the access to the server all over the IP

Postby pafeu » 26. November 2010 23:04

I want in order to access only http://pracaforyou.pl
how to block the access http://84.10.149.37/www/pracaforyou/forum/index.php
they didn't help vhost
how to do it
please for the help
pafeu
 
Posts: 2
Joined: 24. November 2010 00:02

Re: how to block the access to the server all over the IP

Postby JonB » 26. November 2010 23:56

Actually - a vhost will work -

You simply must not put the additional vhost's DocumentRoot under the default DocumentRoot of the installation. That is known as nesting, and each site will ALSO be part of the site that is its 'parent'. That is an awful practice security wise.

lets say XAMPP DocumentRoot is on C:\xammp\htdocs

Then anything that is BELOW c:\xampp\htdocs in the folder structure can also be accessed by the IP address. (that will include the FIRST vhost)

for the next (the important one) Vhost you make the DocumentRoot c:\sites\mypolskisite

NOW there is no way to add anything to the IP's root to get to the virtualhost. BTW, its the same on all websevers, not just Apache - it works on IIS, although they use a different term - 'virtual server'. As long as you make the access method 'Host header name', and DO NOT NEST your virtual hosts - the only way to access the vhost or virtual server is through an HTTP request that contains the 'server name'.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: how to block the access to the server all over the IP

Postby bradzo » 27. November 2010 07:35

Great answer Jon

That's what I found also on IIS - the "Host header name"

And that's the key - the only way to access the site is through the "server name"
Run your own website from home using XAMPP. http://diyws.ath.cx
bradzo
 
Posts: 7
Joined: 08. August 2010 05:23
Location: Australia


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 61 guests