If you are someone that likes the steady flow of traffic that Craigs list can provide, this tutorial should be right up your alley. For sometime now Craig has been working feverishly to keep spammers and businesses form taking advantage of the massive amounts of traffic Craigslist generates. There are content filters that check for duplicate content and titles. There are post police that prevent users from posting in multiple cities and categories. There are IP detection schemes that make sure the IP address you are using to connect to craigslist.org is a genuine local address for that area.
Regardless of all the detection and filters that are in place, it is still possible to get your ads out there in multiple regions. One such way of doing this is by using a proxy server. Proxy servers operate by taking your request for information and fetching that content. Then the proxy server typically caches the content and serves it back to you in your browser.
How does this help?
If you have a proxy server located in the regions where you want to post your ads, craigslist.org will think you are posting FROM that region and not from Timbuktu. The trick is to find a hosting company in the regions you want to post in. There are numerous low cost hosts spread all over the US where you can find a suitable VPS that will run Squid as a proxy server. Make sure you visit LowEndBox.com and check out the deals they have. You can click on a regions and find hosts that are located in most major metropolitan cities. I use a VPS in Dallas, TX from Serverhub.
For our tutorial I will assume you have SSH and root access to your VPS. I run mostly Ubuntu 12.04 Servers these days and for all intents and purposes this guide is geared towards that distro. If you are using a RH distro some of your commands will differ on the installation however the configuration of Squid should still work for you.
First let’s install Squid3.
sudo apt-get install squid squid-common
Now that you have squid lets get it configured. First thing I do with Squid is copy the default config file to let me create my own file. The default Squid config is somewhere around 5500 LOC so continually scrolling through that file gets old real quick. First do this…
sudo cp /etc/squid3/squid.conf /etc/squid3/squid.conf.original
sudo chmod a-w /etc/squid3/squid.conf.original
That last command makes the file immutable to prevent changing it. You probably will never need it, but having it there could save you some trouble down the road. Next I want to setup a proxy user acct. I do not want to leave my proxy open for anyone that finds it and can connect to it. So we are going to secure it with basic authentication. This is not the most secure way of doing this, but it is the easiest to setup and get going. It will also stop 99.99% of the attempts to detect and hijack your server’s proxy connection.
We setup a user by using the htpasswd command but first we need a file to store the user/password combination in. If you need multiple users just repeat the second line as many times as you need, changing username to your desired username.
sudo touch /etc/squid3/passwd
sudo htpasswd /etc/squid3/passwd username
This will prompt you to enter the password for the username you are creating. Make sure you remember this password or write it down somewhere safe. Next lets setup the rest of squid.conf.
http_port XX.XX.XX.XX:8880 transparent
auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
# acl allow rules
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
These lines configure Squid to accomplish a couple of things. First we see that we set http_port to the IP address and port number that you want it to accept connections on. The next directive forwarded_for delete tells Squid to strip out the proxy information from the http header. This is very important as you do not want to advertise that you are behind a proxy server.
The rest of this config file sets up the auth parameters, the operation of the proxy as a web caching server. Caching will cut down on the number of requests that your proxy makes to any website.
Lastly we see that we have an ACL or access control list. This tells Squid to only allow access to the http proxy and only to authenticated users.
Finally done? The absolute last step is to restart Squid and test the operation of your new proxy server.
sudo service squid3 restart