4 ms·
> To my knowledge even now you can’t just upload a bundle of .py, .rb or .jar files into a directory hosted by Apache and go. Doesn't that just depend on Apach
by Evidlo 6y ago
> To my knowledge even now you can’t just upload a bundle of .py, .rb or .jar files into a directory hosted by Apache and go.
Doesn't that just depend on Apache settings? You can set up Apache to serve all requests ending in .py as CGI. As long as these scripts emit HTML the situation is the same as PHP.
- darrenf 6y agoSmall nitpick: it doesn't, and never had to be, HTML that was emitted. Executables were/are responsible for headers (including `Content-type`) as well as the body.
- shagie 6y agoAn example of this was the old, classic, counter.cgi which, when accessed would: * Read a file containing an integer * Increment the integer in memory * Emit a .gif with the new value * Write the new value back to the file
- anyfoo 6y agoThat's a bad order to do things, is that how it worked? There is a huge window while emitting the .gif during which other visitors may appear. At best a new visitor appearing during another visitor's "emit gif" phase does not increment the counter, at worst a visitor on a very slow line causes the cgi instance for this visitor to run for a long time and then write back a very old value to the file, making the counter run backwards. For things that matter, the counter reading+increasing should be an atomic read-modify-write. But since this is just a web counter, I guess it's sufficient if you at least keep the hazardous window very small (by not doing the write-back at the end).
- spookthesunset 6y agoI mean, these were slapped onto peoples personal pages right below an animated "under construction" gif and fractal looking background images. Accuracy was not a huge concern.
- guidoism 6y agoHeh yeah. It didn’t matter because there weren’t that many people hitting the pages. It was more of a thing to do that was cool because when it hit like a thousand you would be like “OMG a THOUSAND people all over the world have visited my page, what a world we live in”
- c0achmcguirk 6y agoAnd dynamic--anything dynamic--was completely insanely cool.
- yjftsjthsd-h 6y agoFor this case, eventually consistent is good enough
- dredmorbius 6y agoIf you're not locking the counter whilst reading, incrementing, applying, and updating it, what you're eventually getting ... isn't really consistency. "A widely shared myth" would be more accurate.
- anyfoo 6y agoYeah, the "it's just a web counter, so maybe just keep the window small" suggestion I made in the end was not meant to say that this provides any consistency, just that it keeps the underestimation of actual visitors smaller. By the way, I'm totally aware that those counters didn't matter, but I thought it's worth discussing anyway. Someone might read this and apply it to things that matter.
- luckylion 6y agoKind of. The files need to be executable and need to have a valid Shebang. That was a common issue with Perl when developers uploaded from Windows, because the Shebang was now "/usr/bin/perl\r". ASCII mode FTP mitigated that, but was itself a terrible idea. Passing flags to Perl ("/usr/bin/perl -w") or putting env into it ("/usr/bin/env perl") usually helped. Chmod'ing over FTP isn't straight forward in most clients, so it was much more complicated for beginners to get things to run than "upload those files, go to your browser".