Multiple accounts for

We host most of our client sites at Rackspace so we have a fair few servers and different accounts we need to login with whenever accessing the portal.

While the site has a cookie to remember the last entered account number and username, it doesn’t help if you have half a dozen different accounts you need to login with on a frequent basis. Switching browsers can be impractical and remembering the account IDs can just get tiring.

To solve this problem I created the My.Rackspace bookmarklet for logging in with multiple accounts. When clicked it takes you to If you’re already there, it displays a select list of your different accounts and populates the login form once you’ve chosen.
Continue reading “Multiple accounts for”

Finding the Apache user in PHP

In PHP, knowing what the Apache user is on your webserver is very useful. Anything that writes a file to the server for example sessions, uploading files or other temporary file operations, needs to have the destination folder writeable by Apache. If you’re developing locally that’s not usually a problem. But as soon as you’re out in the real world file permission issues can sometimes be a pain.

If you’re having difficulties finding out what the Apache user is try this simple script to help you out.

It basically writes a small temporary file, checks the owner username, gets rid of the file and prints the Apache username to the screen. It should work on PHP4 and PHP5.

$tmpFilename = tempnam('/tmp', 'TEST');
$handle = fopen($tmpFilename, 'w');
fwrite($handle, 'testdata');
$info = posix_getpwuid(fileowner($tmpFilename));
$apacheUser = $info['name'];
echo "The Apache user is $apacheUser";

There’s also a small PHP source file you can easily download and use: getApacheUser.phps


I’m in the process of rebooting my website and transferring content from the old website. If you’re visiting this site after picking up one of my business cards, please bear with me. Service will be resumed shortly…