1

I've recently found a referrer in the apache log on my site. Now, I opened it out of curiosity, since my site is live, but I just started development so I didn't expect it.

Anyway, the site was a pure copy of mine, and after investigation I saw that it resolves to my IP.

I'm on Ubuntu 12.04, Apache 2, drupal 7, don't know what other info can I provide.

My question is: how can I tell apache that it should not serve this site?

Thanks

Edit: forgot to say that I had some bots register to my fresh drupal installation. Also, my domain is a tld, this fake domain is a third level (ie. sub.domain.de)

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Zlatko
  • 1,011
  • 2
  • 11
  • 21
  • where are both sites hosted? both at your server? does the other site has a different domain or ip from where you can reach it and see that sends u back to your IP? – jpganz18 Sep 17 '12 at 20:28
  • What site? And how are you sure it isn't yours? – Michael Hampton Sep 17 '12 at 20:28
  • My site is domain.com. The other site is not mine, not hosted at my place, the TLD has some content, but one of the subdomains looks like it is on my server and acts like it. – Zlatko Sep 17 '12 at 20:33

1 Answers1

4

Odd that someone would point a random DNS name to your system, and that it would be getting hits.. might be worth looking into who owns that domain, if this has happened to other people and what the point is, etc.

Anyway, you can get Apache to stop serving real content for these requests by mapping that Host header to a junk virtual host.

<VirtualHost *:80>
    ServerName bad.domain.name.example.com
    <Location />
        Order allow,deny
        Deny from all
    </Location>
</VirtualHost>
Shane Madden
  • 114,520
  • 13
  • 181
  • 251
  • Thanks Shane, this helped. Looked like the guy pointed his subdomain to my IP, who knows why. Btw, do you know of a catchall version? I guess something like virtualhost for my hostname, and a catchall for everything else? – Zlatko Sep 17 '12 at 20:45
  • 2
    @zladuric Sure - the "default" is determined by the load order - so the only change you'd need to make is to put the new vhost where it will load before your existing vhost. That will cause it to catch all requests that don't match the `ServerName`/`ServerAlias` on your other vhosts. – Shane Madden Sep 17 '12 at 21:31