 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
CatsWhoCode.com: How to easily monitor your web server using PHP
by Chris Cornutt February 08, 2010 @ 13:48:31
In a new post to the CatsWhoCode.com blog Jean-Babtiste Jung walks you through the creation of a simple monitoring script written using just PHP that can tell you if your web site is up and responsive.
In order to make sure that your website is always available to the public, you have to monitor it. In this tutorial, I'll show you how you can easily create a monitoring script that will check your website availability and send an email or sms alert to you if it isn't.
They have a snippet of code (about 15 lines long) with a function you can call to check a remote host's connection and check the returned data for a certain string. This can not only ensure that your site is responsive but also that it's not responding incorrectly. You could even use this to hit a certain monitoring page of your site to check for certain things (like database connection problems).
voice your opinion now!
monitor webserver tutorial socket
Christian Weiske's Blog: PHP Testfest Berlin 2009
by Chris Cornutt May 12, 2009 @ 12:05:46
Christian Weiske has posted about his experience at this year's TestFest in Belin (as hosted by the Berlin PHP User Group).
I spent the last weekend (may 09/10) on the PHP Testfest Berlin, organized by Till for the Berlin PHP Usergroup. Coming from Leipzig, I don't really know who of the other 8 people were from the user group and who not.
He mentions issues the group faced (OS X being difficult, PHP from CVS not compiling), the intro to testing and their first area of choice - gettext (which they got up to 98.8% coverage!). The second and third efforts were some work done on the intl and sockets extensions.
voice your opinion now!
testfest berlin testfest09 extension test gettext intl socket
DeveloperTutorials.com: Port Scanning and Service Status Checking in PHP
by Chris Cornutt April 08, 2009 @ 08:49:21
On the DeveloperTutorials.com site today there's a new tutorial showing the creation of a port scanner with PHP - a tool that, given some of the familiar ports that services (like web or email servers) run on, can check to see if they're responding.
While building web applications, it's often important to keep an eye on the other services running on your server. Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.
Their example makes a socket connection to the remote port to see if there's a valid hookup. The wrap this inside a loop for ports 1 through 1000 to see what ports are open and responding on your local machine (doing this on a remote machine is just asking for trouble).
Their full example defines some of the common ports in an array and loops to check on their status. It sets out a base you can build on top of with things like their suggestions - logging scan results, repoting downtime and running a service-specific task.
voice your opinion now!
port scan fsockopen socket http ftp pop3 check connection
ThinkPHP Blog: Comet in conjunction with a PHP socket server - server-client communication
by Chris Cornutt September 02, 2008 @ 08:41:55
In a new post to the ThinkPHP blog today there's a look at combining Comet with PHP to make a simple method for the client to talk back to the server outside the usual methods.
If a couple of users have opened the application there are already some hundred or thousand requests per second. The outcome of this is a big load for your server and a highly increased traffic - your server will in a senseless way be overloaded. In conclusion, our problem is the enormous amount of polling without knowing whether the server really wants to send a new push. Let's turn the initial situation around. And we get the solution to our problem: Comet.
With Coment, the model changes and the request is "cached" on the server-side automatically in a single Comet instance. Coordinate this with another recommendation of theirs, a PHP socket server, and you can do some pretty interesting things.
voice your opinion now!
communication socket server comet ajax push pull
PHP Security Blog: Cross Virtual Host Cookie Theft
by Chris Cornutt December 15, 2006 @ 08:09:00
In this new post on the PHP Security Blog, Stefan Esser brings up an interesting issue when dealing with web applications - being able to bind a script/application to a different port on the local machine.
Unfortunately the ability to bind yourself to a port and receive connections is a threat to webapplications installed on different virtual hosts on the same IP, even if other security measures in place, like tight filesystem permissions or executing PHP script with the permission of the owner.
He gives an example in PHP of how this can happen and one of the scary side effects of having it in the same domain - the cookie information is passed in. It's a simple concept that could have very bad consequences in the wrong hands.
Additionally, you don't even have to create it in PHP either. As cyberlot mentions, it could be created in any language that has socket functions. Be sure to check out the comments for more thoughts and comments on the post.
voice your opinion now!
virtual host cookie theft socket example function virtual host cookie theft socket example function
Shahar Evron's Blog: Adapters of the new Zend_Http_Client
by Chris Cornutt December 07, 2006 @ 14:41:00
On his blog, Premature Optimization, Shahar Evron has posted some information about work he's done on the Zend_Http_Client package of the Zend Framework - including the push to make it live.
Earlier this week, I finally (after long and hard work) pushed the Zend_Http_Client out of the incubator and into the core of Zend Framework, and it will be released with the 0.6 preview release.
Some of the things introduced in this package include the introduction of "connection adapters", a method of having an adapter object made responsible for handling the networking connection. The default for this is the socket adapter, but work is already being done to create cURL and future ideas for a caching adapter or a pfsockopen-based option for more preferment connection needs.
Shahar also includes some stats to show off what the new package can do and how many requests per second it can handle.
voice your opinion now!
zendhttpclient zend framework package adapter socket curl cache zendhttpclient zend framework package adapter socket curl cache
|
Community Events
Don't see your event here? Let us know!
|