lab-y

 

>> Skip to the content.

Lab-Y Menu

  • Blog Entry Cal

< December, 2003 >
Su Mo Tu We Th Fr Sa
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31  

Lab-Y Content

Samsung VGA1000 Compatibility Report

Posted: Dec 15, 2003, 9:38pm CST
Modified: January 7, 2004, 7:18:00 pm CST

I just put up a compatibility report for the Samsung VGA1000. It works under Linux as modem (acm device) for wireless internet access. Just get a USB cable and you are good to go.

[ Posted by dast — linux, wireless, cellphones ]

Fun with Apache Handlers

Posted: Dec 15, 2003, 9:03pm CST
Modified: January 7, 2004, 7:18:00 pm CST

Pursuant to the recent CGI changes at Freeshell, I'm slowly moving the backend of this site to CGI powered by PHP, instead of PHP scripts running inside mod_php. For most people, this is the exact opposite of what they want.

However, at Freeshell, the admin recently enabled the usage of suexec, letting us run our CGI scripts under our normal user accounts. This opens up all kind of goodies, like secure file writing, not needing to mark all files readable by the nobody user, etc. However, suexec doesn't work for PHP scripts running in mod_php.

So everything here must be converted to CGI scripts—running PHP. For the most part that works nicely, except one small bit that gave me trouble. I use a technique with Apache to fake the appearance of directories inside URLs. It uses some mime magic to force the webserver to execute a script that does not have a file extension. That let's me execute the script 'search' in an URL like http://foo.bar/search/apache to search for articles related to Apache (foo.bar is not a real site, of course).

Well, mime magic doesn't work for CGI scripts. So you can use this bit of Apache magic in your .htaccess file.

<Files search>
    SetHandler cgi-script
</Files>

And it's like, wa-lah! Instant fix for crappy URLs. Just check the $_SERVER["REQUEST_URI"] variable in PHP, which will return to you everything after the hostname in the URL, to determine what content to display.

For more fun, read up on Apache Handlers.

[ Posted by dast — internet, web, blogging, php ]

 

Validate XHTML 1.0 Strict

Validate CSS

Copyright © 2003, 2004 Dast <dast _-=(a t)=-_ freeshell.org>. All rights reserved.

Powered by PHP on servers graciously provided by freeshell.org.