Apparently while I was sleeping, I won a Bloggie for 30 days to a more accessible weblog. Thanks.
A representative for the company that makes PowerSiphon contacted me to correct my article on how to block spambots. I claimed that PowerSiphon was the spider with the User-Agent EmailSiphon. It is not. I have updated the article to retract my previous statement, and I apologize to the company for the mixup. You can draw your own conclusions about whether a retail web spidering product with a checkbox labeled Extract email addresses
is a spammer’s tool, but it was not the specific tool I was seeing in my access logs.
Apparently Textile is the markup tool of a new generation. I hope to implement Brad Choate’s MT-Textile around here, someday. Or maybe I’m too old. I still write my markup by hand.
My wonderful, hard-working system administrator set up mod_gzip to compress HTML and text files for browsers that support retrieving compressed content. As far as most modern browsers are concerned, my home page is now 3K. I added these two lines to my .htaccess file to also compress XML files, such as my syndicated news feeds:
mod_gzip_item_include file \.xml$
mod_gzip_item_include mime xml$
My wonderful, hard-working system administrator also set up suEXEC, which briefly broke all my CGI scripts, including Recommended Reading, blog poetry, picture gallery slideshows, and the site search. I believe the problem has now been corrected through judicious use of chmod 755 *. Let me know if you have any problems. Update: blog poetry is still broken. Any ideas why? Update 2: Aryeh fixed it. Can’t imagine what that line of code was; better off without it.
Scriptygoddess is really quite good.
§
What’s this line for:
if not os.environ.has_key(’REDIRECT_FROMHTACCESS’): sys.exit(0)
?
Note that if somehow REDIRECT_FROMHTACCESS is not set, the script will end with a 500 Internal Server Error because it ends before a Content-type is printed.
From http://httpd.apache.org/docs/suexec.html:
19. Can we successfully clean the process environment to ensure safe operations?
suEXEC cleans the process’ environment by establishing a safe execution PATH (defined during configuration), as well as only passing through those variables whose names are listed in the safe environment list (also created during configuration).
This does not include REDIRECT_FROMHTACCESS.
–I hope to implement Brad Choate’s MT-Textile around here, someday. Or maybe I’m too old. I still write my markup by hand.–
I have a mostly-finished (but sorta half-assed) Python Textile workalike; though I depart from Dean’s syntax in some small ways and add footnote/endnote support (surprisingly easy and quite nice). One of my (perhaps insane) design goals was to write such a thing with the absolute minimal use of regexen (since I hate them), which makes things a bit more challenging, but fun too.
If you’re interested in the code, holler.
Kendall, regular expressions are God’s words, their syntax God’s language. Getting one right on the first try is as close to a religious experience as I get.
Of course, it’s possible that I’m insane.
— Mark ![]()
mod_gzip ?
Apache 2.0 comes standard with mod_deflate. Assuming the server’s been compiled with DSO support, all that’s required is a small edit to httpd.conf and
apachectl restart
Is there any reason to prefer the 3rd party mod_gzip ?
mod_gzip vs. mod_deflate: http://webcompression.org
Thanks for the link!
The only complaint about mod_deflate is that it defaults to a lower compression ratio (in the interest of server performance). This will be moot in Apache 2.0.45, where there will be a “CompressionLevel” runtime configuration option.
The only thing I didn’t like about those articles is that they seem to prefer listing which file types NOT to compress, whereas the easier (and more foolproof) method is to list which MIME-type s TO compress:
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml application/xhtml+xml
Anyway, I think I made the correct choice…
We’re running Apache 1.3.27. Nice link, though, thanks.
— Mark ![]()
Very glad to have you back among us. Hope it was a restful sleep.
— Liz ![]()
Checkout this css compression hack with ob_gzhandler. (It is usefull if you have not mod_gzip installed).
HTML:
css.php:
here comes the content of css file —
I meant
<LiNk Rel=”stylesheet” type=”text/css” href=”css.php”>
<? ob_start(”ob_gzhandler”);
header(”Content-type: text/css”);
header(”Cache-control: public”);
header(”Cache-control: private”);
header(”Cache-control: max-age=86400″);
?>
here comes the content of css file —
Hi all! Thanks for taking the time to look at my articles on HTTP compression and Apache 1.3.x and 2.0.x.
I have made the changes suggested by Jacques Distler and I already have an article on how to hard code GZIP-encoding in PHP without having to embed it in every script.
smp
Glad to have you back, Mark. I was starting to have diveintomark.org withdrawal symptoms! :-)
I am no longer accepting public comments on this post, but you can use this form to contact me privately. (Your message will not be published.)
§
firehose ‧ code ‧ music ‧ planet
© 2001-8 Mark Pilgrim