My notes on web hosting and drupal programming...

How to configure a private proxy on your VPS

VPS hosting is very configurable. One can do things that were not imaginable before. One of such cool things is your own private proxy server.

Whether you need to do some things anonymously in internet, or you want to see how does a landing page looks, of an affiliate marketing offer, accessible only from a country you are not living in, but your VPS server is...

This is exactly the situation a felt myself in last couple of weeks, I was using internet proxy web pages, like hacksurfing.com or any other, but they are not always working correctly. Imagine, that the affiliate redirect link contains a little more complicated redirecting link done in javascript, which is far too much for hacksurfing to parse, and there is completely nothing you can do about that. (If you don't have a VPS, of course)

Lately I've been trying to find out how to configure a proxy on my JaguarPC VPS.

I have found some articles on internet but they were too common for me.

Here is a complete solution for you...

Configuration of apache private proxy on VPS

On JaguarPC VPS we have apache httpd service, and I think this private proxy configuration will work for anyone with apache. I have a plesk configuration, but I guess that doesn't matter, the private proxy is configured at apache level.

vi your apache configuration file /etc/httpd/conf/httpd.conf

find the proxy section which starts with ‹IfModule mod_proxy.c›. If you are reading this article, then probably that whole section in that file is commented out. Uncomment it. That's it, for a first step.

But...

Due to world best practices it is not wise to leave this proxy open to everyone, because it will be immediately used by hackers to hide their identity and do their evil plans :). Who will be guilty in this case? You, of course!

So we have to add this code: "Allow from 127.0.0.1" into that section. Meaning that traffic is allowed from local host only.

restart the httpd deamon: "apachectl -k restart"

Here is how that private proxy configuration section should look at the end:

‹IfModule mod_proxy.c›
        ProxyRequests On
        ‹Proxy *›
                Order deny,allow
                Deny from all
                Allow from 127.0.0.1
        ‹/Proxy›
         ProxyVia Block
‹/IfModule›

note that I used ProxyVia Block, which tells the private proxy server not to tell anyone that it is a proxy. I don't really know whether it's really important, but I like things looking real, even if they are not :)

We are going to access the proxy via ssh tunnel, using a ssh program that supports tunnels. I always recommend putty, it really has everything!

So, open PuTTY, type your vps server's name in the host and go to tunnels section of putty's interface. Configure the tunnel so it maps your local port, let's say 8080, to remote http port: 80.
it should read:

source port: 8080
destination: localhost:80

When you connect to your VPS server with these settings, it will create a secure data tunnel, which we will use to access our private proxy configured at our VPS.

In your web browser, go to proxy servers configuration and type localhost:8080 as the proxy server name.

That's it!

When you visit some page, your browser goes through the secure tunnel made between putty and vps, then the data comes out of the tunnel at remote port 80, which is then correctly handled by the private proxy we've configured before!

related articles
I am still under the great impression of the VPS hosting I have moved to a couple of months ago. The speed and control are incredible! Read whole review about my new VPS hosting here

how to write a jquery script that rapidly increases the alexa rating of a drupal website

Finally I've taken a time and organized myself to make something that is supposed to increase my alexa pagerank.

Alexa rating is an important number that is often being looked at. For example tеxtlinkаds shows only two parameters to buyers - the PR of a page AND the alexa rating. nothing else! So we have to do something about it.

I have read a bunch of articles that advise to ask all your friends to install the alexa rating toolbar and ask them to visit your pages every day, so alexa records these visits and reflects that in numbers.

But it is a very ineffective way, as:

  • you may be in some niche that isn't connected with webmasters and internet at all, so your visitors may lack the knowledge how to write a comment, not speaking about installing the alexa toolbar for a firefox ("what's a firefox?" :)
  • even if they are, they will get tired of doing that, so that way is not lasting and eventually your alexa will go back down

That's why I guess alexa has made another way, which we need only to implement and the alexa rating will honestly report the real traffic on the site, thus boosting it up under 50000 in three weeks (that's what they say)

The redirection itself is pretty straightforward, for example, the link to this blog would look like http://redirect.alexa.com/redirect?http://www.vo1dmain.info

OK, then one could start and search-replace all his links, substituting them with the redirect links like that one. Fine, alexa rating boosts up, but.. You would lose all your google PR rating, because you will link to alexa from your every page several times each, thus making a great PR gift to to them :)

But we are not a charity organization, we will make it another way.

I have heard that there is a wordpress plugin that installs a pretty big javascript, which substitutes the real link with a redirect at the moment when user clicks it. Very elegant, because it's a clean way and everybody is happy.

This is exactly what I have done for Drupal, because there is no contributed module out there...

My final version of this javascript looks like this:

 

function alexa_click() {
  var link = this.href;
  if(link.indexOf("redirect")==-1)
  {
    link = "http://redirect.alexa.com/redirect?" + link;
    this.href=link;
  }
  return true;
}

function alexa_attach() {
  $('a').click(alexa_click);
}

if (Drupal.jsEnabled) {
  $(document).ready(alexa_attach);
}

Here is what it does: upon readiness of a page, it attaches itself to all links assigning it an alexa_click function. When any of them gets a click event, the javascript reads the link and prepends the alexa redirection. That's all! Effective and elegant.

A thing to mention - this script uses the built-into-drupal jQuery library, which is why the code snippet is so short. if you want to use it on any non-drupal site, you will need to download jQuery (40kb only!) and include it into your page.

After creating the script you save it somewhere in /misc among all other scripts and create a drupal php block which will contain only one line of code:

<?php
    drupal_add_js('misc/alexa.js');
?>

That's it!

Let's see how it'll work. Today it is the 19th of october and alexa rating of this a bit forgotten blog is 2.9mio. This my javascript was installed today, so I wonder how good is going to be the alexa number in november.

And of course I am still under the great impression of the VPS hosting I have moved to about a month ago. The speed and control are incredible! Read my whole review about my new VPS hosting here

Choosing the right VPS plan: Jaguar PC hosting, VPS review (VPS discovery plan)

A few words about hosting again, this time about JaguarPC

During last two years I have been jumping from one hosting company to another and actually I've got pretty tired of that. Through all this time my own personal development in the field of internet money making was actively progressing especially during last half a year, resulting in a very comfortable state, when the sites I am dealing with are finally able to pay for themselves, so I have decided that these sites can afford themselves something better.

Cyber Ultra Network was the best hosting so far and still is, their price/performance level was superb, so I am still recommending them to everybody who is searching for a good shared inexpensive hosting... It has a lot of features and still not expensive (3.95$/month)

As I needed more control and also perfect uptime (say, 99.99% a year), the idea of some good VPS hosting was always flying above me, so during last three months I was actively researching this area of internet.

That wasn't an easy task - the market is full of VPS hosting providers!

Another thing is that I had no idea what kind of difficulties I could ran into after I would transfer my sites to VPS, but man, sooner or later it had to happen! So after a lot of research there was a winner

And the winner was the JaguarPC Hosting Company and their VPS discovery plan.

They are affordable, they had mostly good recommendations and what I liked the most, they have their own helping community! This is the only web hosting company I have seen, that has this feature.

The last drop for me was the promotion they had for the last week of august, which I almost missed, there was only two days left but yes, that has really made the final drop.

Originally for the price 19.97$ per month you get fully managed service, 10Gb of space on hard drive, 150Gb bandwidth, 128Mb RAM and 100% uptime guarantee.

The promotional package was a "little" better: 192Mb RAM, 20 Gb HDD and two free months. Impressive? I thought so too, so I decided to try and if something goes wrong they have 30 days moneyback guarantee.

First two weeks I was playing a bit here and there, trying the shiny new VPS, exploring plesk panel and checking whether I could do at least the same I could do in my shared hosting account.

The overall impression is like you own your own server somewhere there on the other side of the world (I live in Europe). You can do whatever you like and nobody on the same physical server hosted together with your account can influence you either by memory, bandwidth or even processor. The response time comparing with shared hosting is superb. Database speed is unbelievable. I am hosting a number of Drupal sites including this one and I can say they are flying now!

By default JaguarPC gives you 3 dedicated IPS, and you can do anything with them! Typically one IP is for hosting and the other two are for your own private name servers. That was something new for me. With the private name servers you can do any DNS operations including setting all DNS records (A, MX, etc) and even changing their life time, very useful when you plan some big change!

That is the power, I personally think that I can not live without anymore!..

I have moved all my sites to this VPS hosting and so far the functionality, quality and also support team were very good. If I exclude the downtime caused by my own lack of DNS knowledge the sites have had 100% uptime.

If you liked this VPS review and want to try yourself in "god mode" :) My recommendations!. You'll definitely like it!

Please feel free to ask questions, as the person who has learnt something a month ago will answer them more enthusiastically than the one that had been using VPS for years! :)

Cyber Ultra Positive Hosting Review

Since I went away from Servage, I have looked through a lot of different hosting services.

The key points I was looking for:

  • relatively cheap hosting: we are a non-profit organization and I am not a guru in web pages building;
  • ssh access: that is a must if you want to do something quickly and least painful. Ftp is not ok anymore.
  • rich statistics: awstats and alike is OK
  • guaranteed uptime: if it is stated to be 99.98%, it should be guaranteed.

I didn't need some overwhelming space and bandwidth (which as you can see, are a big lie at some "nice" hostings, just a reasonable number I can really live with.

I finally found such a company, which doesn't advertise itself too much in the internet and has all the things that I want from the hosting company - it is Cyber Ultra! My projects are living with them for about half a year and I am completely satisfied. With both uptime and price.

Their guaranteed uptime is 99% (which is more or less OK for me) but 1% of probable downtime gets reflected in their price, it is just 3 EUR/month. Their actual uptime was 100% during past two months, and slightly below 100% before.

CyberUltra has SSH, cPanel, and therefore complete control over everything.

This is my third hosting company and I think they are simply the best!

P.S. Pity they don't have affiliate program, this post could bring me some additional credits :)

Enhancing the drupal statistics: ip geolocation

Drupal statistics logs every access to a page. It is kind-of useful when the user is logged in, but there are times when you want to see where the user physically comes from. For this situation you can just go into "details" and see his ip address. Copy and paste it into some kind of online ip2location service and see the results.

This code allows you to shorten that cycle to just one click.  read more »

Servage hosting review (current status)

Quite a time has passed since the the problems with Servage hosting have forced me to run away from them.

I still have a network monitor up and running making queries every half an hour.

Guess what is it showing? Right, Servage doesn't have control over the situation at all. Take a look at it
There are the statistics on the server where they hosted my site.

Servage hosting review

Strange, but I have to start first message in the new blog with some bad words about bad hosting experience I've had. Hopefully someone will read this Servage review and learn on my mistake, saving his nerves and money.

Originally I have posted it in some web hosting reviews, but I guess there is no truly centralized place for that, so one more time...

You will finally regret that you've listened to "servage is great"-kind opinions (probably written by Servage themselves) on the review forums.

I have had a lot of problems with Servage.  read more »

Powered by Drupal - Design by artinet