Hello world!

I keep on writing programs. Some of them are useful in many projects, and some of them may not be aborted and finally forgotten.

Instead of letting the codes to be forgotten one day, I ask myself, why not publish them in the internet.  Maybe, somebody thinks they are useful , or maybe not.

For simplicity, I’ve grouped them into different categories.  I started from Assembly, Java, Javascript, jQuery, Python, …, etc. Now, it’s the time for PHP.

Frankly speaking, I am not quite familiar with PHP and I always have to spent large effort to make some PHP code becoming near perfect.

As mention in one of my blog article, “The difference between IIS 5.0 and IIS 5.1” from the “Web Server Tricks Blog“, I have spent a lot of effort writing a reverse proxy in PHP.  And finally, I found I’d better not using it in that project.  It’s a waste, isn’t it?  Then, the message, “why not publish it” come to my mind again.

So, I setup a website using the name of PHP class (I’ve just created the DNS, the link may not be work at the moment, see backup link from google site) and I copy the source code (backup) to it.  And now, I have a website publishing my PHP classes in the future.  Some of them may be useful and have been used in some of my projects, and some of them may note appeared to be so useful.  You have to judge it yourself 😛

By the way, I’ve planned to use the the “PHP Reverse Proxy” as one of component in a content publishing software which is able import the content of other website such as, Google site, which is one of my favorite “content engine”.  Google site is, for me, simple but not beautiful; powerful but not flexible.

If I can use Google site for drafting, I can publish it on other site using the stylesheet that I like, using the Javascript that I like and linking to the database that I planned to.  Yes, I have done a lot of experiments on it that you found some of the results in some of my websites.

I think I gone too far for the current topic.  I am happy to have a place publishing PHP class code.  Bye for now.

Happy programming,

Cloudgen

Advertisements
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

2 Responses to Hello world!

  1. Julián Landerreche says:

    Hi Cloudgen,

    thanks for sharing your PHP Reverse Proxy class.
    In the past, I’ve used a patched version of php5rp.
    Now, I would like to test yours. The problem is that I’m not sure how to use it.
    I’ve created a index.php file on the root of the proxy domain (http://mypublicdomain.com), and have set the $this->host variable to http://myprivatedomain.com, but it didn’t work (I got a blank page). I’m probably using it wrong…
    I’ve tried this too, with no luck.

    
    <?php
    
    include_once 'PRP.class.php'; // your class
    
    $proxy = new PhpReverseProxy();
    $proxy->connect();
    $proxy->output();
    
    ?>
    

    I’ll appreciate your help. Thanks.

    • cloudgen says:

      This class is designed for using the file not found 404 page for handling request. For instance, one of my website http://www.examplet.buss.hk the source code is actually located in other server (http://von.ath.cx). I save the following code in index.php and the 404.php:

      
      <?
      include($_SERVER['DOCUMENT_ROOT']."/rproxy-inc/PhpReverseProxy-inc.php");
      $proxy=new PhpReverseProxy();
      $proxy->port="";
      $proxy->host="von.ath.cx";
      $proxy->forward_path="";
      $proxy->connect();
      $proxy->output();
      ?>

      Before using this, you should config .htaccess correctly. Here is what I’ve done as the content of .htacess:

      ErrorDocument 404 /404.php
      

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s