Run a local proxy server

Status
Not open for further replies.

Osiris

Golden Master
Messages
36,817
Location
Kentucky
I was so excited to write this article that I could not sleep well all night. Yesterday I have written an article that explained how you could setup a webserver on your computer and use it to display websites or share files with your friends. Today IÂ’m going to show you how to use this webserver to host a local proxy server that you can access from anywhere on the net to surf sites that are blocked at your current location.

The requirements are that the webserver is up and running at your computer and that the Apache module is started. Download one of the many proxy scripts and unzip it. I suggest you create a new sub directory in htdocs, donÂ’t name it proxy . use a name that does not tell anyone what the files in the directory could be for. This is to prevent keyword filters that could block your local url if they find the keyword proxy in it. Name it tennis for instance.

Move the files index.php, javascript.js, PHProxy.class.php, style.css and url_form.inc into the new directory. Et voila, you are done. Test the script by accessing it locally (http://localhost/tennis/) ; If the proxy script appears everything is fine and you can access it from anywhere on the net as long as your local computer is connected to the web and the apache module is started.

It is highly unlikely that this proxy is banned by the admins of your school, university or company because it runs on a dynamic IP and no one has ever used it before.

To secure the directory do the following: Create a .htaccess file - Windows Explorer does not like this kind of files but a good editor should be able to create the file without errors. Add the following lines to the file and save it.

Options All -Indexes AuthName "Go Away ;)" AuthType Basic

order deny,allow
deny from all
#Comment 1
allow from 111.111.111.111This prevents access to the directory to anyone except the user with a matching IP address. This is not a useful protection if you want to prevent the admins from your school or university to take a look at your server.

A better protection would be to use a password protection, this is done the following way:

Create an encrypted password and copy the result in a file named randomly starting with a . - for instance .grqwev ; Place the file into the directory that you want to protect. Add a .htaccess file to the directory with the following lines.

AuthUserFile /tennis/.grqwev
AuthType Basic
AuthName “Top Secret”
Require valid-user

That is it. You password protected your proxy script running on your local computer. Only users who know the password are able to login and use the proxy, everyone else will not be able to see what lies behind the password request.


http://www.ghacks.net/2007/01/31/host-your-own-webserver/
 
Status
Not open for further replies.
Back
Top Bottom