TCHS 4O 2000 [4o's nonsense] alvinny [2] - csq - edchong jenming - joseph - law meepok - mingqi - pea pengkian [2] - qwergopot - woof xinghao - zhengyu HCJC 01S60 [understated sixzero] andy - edwin - jack jiaqi - peter - rex serena SAF 21SA khenghui - jiaming - jinrui [2] ritchie - vicknesh - zhenhao Others Lwei [2] - shaowei - website links - Alien Loves Predator BloggerSG Cute Overload! Cyanide and Happiness Daily Bunny Hamleto Hattrick Magic: The Gathering The Onion The Order of the Stick Perry Bible Fellowship PvP Online Soccernet Sluggy Freelance The Students' Sketchpad Talk Rock Talking Cock.com Tom the Dancing Bug Wikipedia Wulffmorgenthaler |
bert's blog v1.21 Powered by glolg Programmed with Perl 5.6.1 on Apache/1.3.27 (Red Hat Linux) best viewed at 1024 x 768 resolution on Internet Explorer 6.0+ or Mozilla Firefox 1.5+ entry views: 1929 today's page views: 252 (67 mobile) all-time page views: 3207978 most viewed entry: 18739 views most commented entry: 14 comments number of entries: 1203 page created Sun Jan 19, 2025 18:06:11 |
- tagcloud - academics [70] art [8] changelog [49] current events [36] cute stuff [12] gaming [11] music [8] outings [16] philosophy [10] poetry [4] programming [15] rants [5] reviews [8] sport [37] travel [19] work [3] miscellaneous [75] |
- category tags - academics art changelog current events cute stuff gaming miscellaneous music outings philosophy poetry programming rants reviews sport travel work tags in total: 386 |
|
- programming - Having finally gotten it into my mind to try out Perl on the SOC Zone so kindly set up for me, I got Apache and PHP up and running easily enough (can't say the same for the non-Computing students in the module, not least because they don't have access to the MySOC help pages). Perl wasn't as simple, though, and my heart sank a little when the basic httpd.conf changes didn't work out - the dreaded 500 Internal Server Error greeted me. I will be first to admit that I'm no Linux whiz, and indeed even the command to directly create a file from the command line (cat, don't ask why) eluded me at first; The last time I used any flavour of Unix with regularity was a few semesters back for CS2106 Operating Systems. Finding the temerity (terminity?) of PuTTY not to my liking, I found EngInSite DataFreeware's GUI frontend much friendlier. It didn't have a convenient way to upload files, however, so with some combination of the two I plodded on. Under the assumption that the mod_perl Apache interpreter was a must for running Perl on Apache (no thanks to all my Googles for Apache Perl and the like returning some reference to it), I browsed through the installation procedures (which were written for a clean install of Apache), and decided to seek other avenues. It was about this time that I hit upon the bright idea to inspect the error logs, which I had downloaded once before but turned out empty on my local drive (which I discovered was simply because I didn't have sufficient rights). With vim but not much vigour, I discovered that at least the server had received the requests, but had rejected each and every one of them with "Premature end of script headers, file does not exist, nyeah nyeah nyeah". Checked the line out, and rechecked my Hello World cgi script. Shebangs usr/bin/perl... Hmm... D'oh! It was supposed to be "#!/usr/bin/perl" not "#!usr/bin/perl". One missing forward slash. Refreshed Apache (didn't know if it was necessary, was for my Java stuff last time), and nothing. Read more about mod_perl, downloaded the tar file. Then realised that there was some warning about non-UNIX line endings when developing on Windows platforms. Supposedly dos2unix would fix it, so I dutifully did "dos2unix test.cgi". Didn't work. Tore some more hair. Stared at the mod_perl install options some more. It didn't really have to end up like this, right? Fiddled about with the permissions and config file, then finally hit upon the bright idea of typing in the Hello World script directly, with "cat > test2.cgi". Still zero. Hmm. Oh yes, the permissions for the new file are still default. Changed them, then bingo! Perl lives! So why didn't the dos2unix treatment work? Two reasons: One, I had used it incorrectly. If I had read the man page first, I would have realised that the correct invocation is "dos2unix (inputfile) (outputfile)", and instead I assumed that it would just directly overwrite the original. Two, I think it resets the permissions silently even when the input and output files are the same. Well, that's the hardest over. I don't think I will be tinkering with mod_perl for awhile, even if it does promise to run CGI calls 2000% faster. There's a prize for crashing the server anyway :P And the bane of my existence? The invisible carriage return. Two miserable bytes. And the shell rolls over and dies on me. Why can't all the OSes just be friends? Next: Schedule of Doom
LaW said... I've simply no idea what all these mean..
gilbert said... Some secrets are not meant for the eyes of non-Computing majors, lest they peel away at their sanity...
Trackback by actos claims
|
|||||||||||||||
Copyright © 2006-2025 GLYS. All Rights Reserved. |