Put your message here! Contact me for more information
 
 







 

Archive for the ‘Server’ Category


 

I just found out today that LastProxy.com was hacked. I updated the code last night to optimize for Adsense and things worked beautifully. But this afternoon, I checked on the scripts and found out that both of the proxy scrips stopped working! I FTP to the site and found out that the scripts were removed permissions and hacked by adding ‘exit 0′ at the beginning. To tell the truth, I’m quite shocked.

First of all, I don’t know why anyone would spend time to hack into the scripts. I mean what’s the point of doing so? Secondly, I am very surprised to see someone actually got access to the scripts’ sources. The scripts should always be executed like usual, and how does that person have the permission to write back to the server to add the exit code to both the scripts.

I called 1and1’s support number (contrary to some people, I alwasy get to talk to a live person within 3 minutes and the guys are very, very helpful and nice too). It’s against their policy to change customer’s files. So I know they didn’t go into my site and hacked it. Then someone else got to get in and did it. I checked on the SSH logs and FTP logs, it seems that everything was clean. Very strange indeed.

Well, I’ve wrote 2 posts on Sitepoint forum to see if other people have encoutered something similar. Let’s see what is actually going on. Meanwhile, I’ll be monitoring constantly the site for any sudden changes. And yes, I’ve backed it up, thanks to whoever hacked my site.

view comments
 

After reading my buddy’s blog (http://blog.tvlgiao.com/) about the PHPEclipse, I decided to give it a shot. I’ve been using the Zend IDE because I love the intellisense feature (a.k.a. auto-complete) of this nice IDE. The only thing is that it’s very slow to start and I had a hard time installing the debugger. Well, now the PHPEclipse package also provides the same functionalities with a complete debugger for FREE.

This is the first time I try Eclipse. My impression: impressive! The IDE loads faster than the Zend 5.1.0 IDE, eventhough both run on Java VM. The GUI of Eclipse is also slicker and it gives me the feeling of working in Visual Studio again. Installing the PHPEclipse was a breeze via the Find & Install featured under the Software Update menu. However, installing the php_dbg with Xampp wasn’t that straightforward.

At the time of writing, the php_dbg.dll is only available upto PHP engine version 5.1.2. The newest Xampp is 1.5.4, which bundles the PHP version 5.1.4. I would recommend you to install the older version of Xampp instead. Xampp 1.5.2 is the one with the correct PHP engine to work with php_dbg.

First of all, copy the php_dbg.dll-5.1.2 to the [installed xampp’s dir]/php/ext/. Then add the following lines to the php.ini file. the php.ini file that Xampp’s Apache is using is in the [installed xampp’s dir]/apache/bin/php.ini. You can see the actual path if you do a quick phpinfo().

[debugger]
extension=php_dbg.dll
debugger.enabled = true
debugger.profiler_enabled = true
debugger.JIT_host = clienthost
debugger.JIT_port = 7869

However, the default configuration of the php.ini will crash your Apache because of the loaded ZendExtensionManager.dll. What I did to solve the problem was to comment out the zend_extension_ts lines towards the end of the php.ini file like this…

;zend_extension_ts = "I:\Program Files\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
;zend_extension_manager.optimizer_ts = "I:\Program Files\xampp\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 0
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path =
; Local Variables:
; tab-width: 4
; End:

After all the zend_ lines have been commented out, Apache started just fine and the phpinfo() dump confirmed that the php_dbg has been loaded.

Hope this help. Now it’s time to do some serious php apps with PHPEclipse. Ah by the way, CakePHP with PHPEclips is beautiful! We now have full code auto-complete for the CakePHP’s library! How amazing! And my friend Giao has just told me that Jseclipse for Javascript now support autocomplete for OOP-JS (prototypes and all that good stuff). Ha, it looks like that I’m hooked with Eclipse already.

view comments
 

I just updated the scripts on www.lastproxy.com, both the CGI (nph-proxy) and PHP (php-proxy.php) flavors. While installing the php-proxy.php was just an upload,go, and forget, configuring the nph-proxy.cgi script on 1and1 is quite tricky. I called up the 1and1 support staff and the guy seems to be really nice, but clueless about what to do.

Well, to get nph-proxy.cgi to work on 1and1, you have to do these following

1. Upload nph-proxy.cgi as ASCII
2. Chmod the script to 755 using any FTP client (e.g. FileZilla)
3. The default #! usr/bin/perl line of the script works just fine with 1and1 so you don’t have to worry about it.
4. To actually get the script working, change the extension from .cgi to .nph
5. Point your browser to the script, bam, things just work!

For some servers, they use the prefix nph- to signify the PERL engine to not parse the header (nph stands for non-parse-header). My guess is that 1and1 server configs to use the extension .nph to notify the PERL engine instead.

I hope that this saves you some hassles getting nph-proxy.cgi to work. Last of all, check out my proxy page at http://www.lastproxy.com
LastProxy logo

view comments
 

After surfing around sitepoint.com for a few days, I decided to put up my own proxy site. If Intel have Core Duo 2 (shouldn’t it be Core Quadro or something?), then my site should have dual-proxy — both PHP and CGI flavor.

Besides the regular features of the proxy, I’m thinking about adding countries IP-filtering, which should not be too hard to implement becase the documentations at Maxmind have the code exerpt. So it’s a matter of tweaking the script to work with my site. In light of a site-auction at sitepoint.com forum, .htaccess will also be added to avoid hot-linking. I think there are tons tutorials on how to do this.

Below is a screencast (gif!) of the template is below … I’m pretty happy with the result so far. The design process went really well and I have to admit that I LOVE my stripedesigner.com site. It’s awesome! Can you tell what stripes did I use for this particular design?

LastProxy

Comments are welcome as usual. :)

view comments
 

view comments