• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Tag Archives: Apache2 Logs

Apache config for blocking proxy requests to random hostnames

June 3, 2011 12:59 pm / Albertech.net

If you have an Apache server with strange logfile entries such as:

GET http://proxyjudge1.proxyfire.net/fastenv HTTP/1.1" 404
GET http://images.google.com/ HTTP/1.1" 404

You need to reconfigure your Apache to deny any access to a host that is not specifically configured on your server. This can be done via changing your /etc/apache2/sites-enabled/[your default config]

Make sure to change the realhost.example.com to your host name, change the aliases (I add the IP address if there is only one IP for the domain), and change the document root path. This source of this script is from the Apache.org wiki.

NameVirtualHost *:80

<VirtualHost *:80>
ServerName default.only
<Location />
Order deny,allow
Deny from all
</Location>
</VirtualHost>

<VirtualHost *:80>
ServerName realhost1.example.com
ServerAlias [YOUR IP ADDRESS — ONLY if each server has its own IP address]
DocumentRoot /path/to/site1
</VirtualHost>

One you are done with the change, make sure you run apache2ctl configtest
to ensure the configuration is correct. Restart the Apache2 service. Check the logfiles again to see if the proxy requests are gone.

This should be the default configuration that you should be using for Apache, unless you are using Apache as a proxy.

Notes:
If you only have one domain name per IP address, you should put in the IP address as an alias. This will allow the website to be accessible by IP, which is useful for server monitoring software.

Source: http://wiki.apache.org/httpd/ProxyAbuse

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: apache2 logs, proxy

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.