httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dick Davies <rasput...@hellooperator.net>
Subject Re: [users@httpd] Blocking http requests to certain URLs.
Date Sat, 08 Jan 2005 06:08:46 GMT
* Aman Raheja <araheja@techquotes.com> [0148 02:48]:
> It sure means you are listening on * and ServerName directive not setup
> Be specific and use the Listen directive wisely, like
> Listen xxx.xxx.xxx.xxx:80
> and use the same on your VirtualHost, if you have one and ServerName 
> directive be
> ServerName www.mydomain.com
> Then only www.mydomain.com will respond.

No, I don't think that's right. There's always a default vhost, if you
only have one then all requests to port 80 end up there regardless of
what the Host: header (domain name the browser asked for) is.
If you don't define a vhost at all (which I guess is the case here) then
all requests end up at the DocumentRoot, whether you get there by name
or the IP.

Christopher, what do you want to happen when someone goes to those domains?
Probably easiest to put something in the default DocumentRoot (up in 'Section 2'
of httpd.conf) which asks people to use the correct name or whatever, and then
create a virtual host for www.mydomain.net.

( I'm sure someone will recommend doing something with mod_rewrite too, but I
tend to think that's overly complex. If you're going to rewrite to somewhere 
anyway, you may as well just have the vhost system do that for you.

To misquote Jamie Zawinski:

	'Some people, when confronted with a problem, think:
		"I know, I'll use mod_rewrite".
	Now they have two problems.'
)

> Christopher J. Bottaro wrote:
> 
> >Hello,
> >I'm very new to Apache and web stuff in general.  Please bare with me.
> >
> >I have my name server setup to route the following URLs to a single IP
> >address:
> >www.mydomain.net
> >ftp.mydomain.net
> >ssh.mydomain.net
> >
> >I want Apache to reject http requests to ftp.mydomain.net and
> >ssh.mydomain.net.  Currently (default Apache setup on Fedora Core 3), I can
> >put in my webbrowser "http://ssh.mydomain.com" and it will bring me to my
> >homepage.  I don't want that.

-- 
'Everybody I know who is right always agrees with ME.'
		-- Rev Lady Mal
Rasputin :: Jack of All Trades - Master of Nuns

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message