RE: [PHP] Building a scalable Control Panel In PHP Question . . .

From: Date: Sat, 14 Sep 2002 23:47:56 +0000
Subject: RE: [PHP] Building a scalable Control Panel In PHP Question . . .
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-116405@lists.php.net to get a copy of this message
Make sure that you implement file locking into your application if you work directly with the files so that way your config file will not become corrupt when multiple clients are accessing it. I don't know your skill level, but I would recommend writing a Windows 2000 service in C++ or Visual Basic .NET (you need something multi-threaded) that will take care of the processing of your database updates and converting them into your config files. Use PHP to process the web based "requests" for config file updates, and then use the Windows 2000 service to process all the requests. The problem with using php in windows 2000 cron situations at the operating system level is that it is pretty undependable. I would not recommend installing the script in several locations on all the different boxes. Do you have any NAS (network attached storage) in your infrastructure? You can setup just one script and then virtually map the path to that script from apache. That way if you ever need to upgrade your script or fix a bug, you only have to do it in one location and not in several. It will make the code, version management and file administration much easier in the future. You can also do the same thing with the windows 2000 service. Set it up as a network installation and then just use your service control panel in windows 2000 to map it to the NAS location. Also, with a windows 2000 service, you can set actions if your service stops responding or if anything weird happens. I have several e-books from Microsoft Press that might help you in creating your Windows 2000 service. Email me directly if you would like to get a copy of them and I can email them to you. -----Original Message----- From: Jonathan Chum [mailto:jchum@jps.net] Sent: Saturday, September 14, 2002 3:14 PM To: php-general@lists.php.net Subject: [PHP] Building a scalable Control Panel In PHP Question . . . I've just started work on building a control panel in PHP to manage web hosting services (Apache, Sendmail, Bind, etc.). Considering the security risks involved and possible data corruption if there are several users online attempting to write to a conf file, I'm taking the approach of seperating the user interface from the script that writes to the system. That is, the user only interfaces to the database. Now, I'm trying to figure out how should I take the data from the database, possibly by scanning the database for changes then write it to a file. I'm also taking into consideration of how to scale to Windows 2K. I have a few ideas that sounds good, but could be a problem. Let me explain. . . I was going to code a seperate script that sits on each server at URL under a SSL link which will have to authenticate to get through. This script will capture POST data and returns data accordingly. This allows me to scale to another machine easily by just installing a script. The issue is that if Apache dies, then it needs to send data to a machine, it will cause some issues. Also, if a POST was made to that URL, if it takes a while to return data back, Apache could just time out on the request. So that's probably not a good idea. Another application I reviewed coded up a daemon using PCNTL to control child processes or run interactively. This would be feasible on *NIX machines, but not sure how well it scales to a Windows machine. Maybe recoding the daemon as a service. Is there any other ideas out there would be even better? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#116405) next »