Name: Rich Bowen
Member since: 2000-11-05 02:32:14
Last Login: N/A
Homepage: http://www.CooperMcGregor.com/
Notes: http://www.reefknot.org/ http://httpd.apache.org/ http://dates.rcbowen.com/ http://www.rcbowen.com/
I know how to make the url http://foo.com/~user go to the user's home directory, but how do I make that happen without the ~, which looks unprofessional?
There are two standard answers to this. One, you tell them that it can't be done without creating an Alias for every user, which is technically correct. The other answer is to tell them to write some sort of magic handler that knows what users are out there, and maps requests to the correct directory. Perhaps in mod_perl?
Well, over the last few weeks, I have been doing a number of the things that I have been telling folks on #apache to do, or things that I have long claimed were trivial, and I just had not gotten around to them yet. For example, I keep saying that you can write an Apache access control thingy that would restrict access based on the phase of the moon. So last week I wrote one.
So, anyways, here is the mod_perl thing that creates magic user alises for users so that http://foo.com/user/ goes to that user's home directory. It was depressingly easy.
<Perl>
# Folks you don't want to have this privelege
my %forbid = map { $_ => 1 } qw(root postgres bob);
opendir H, '/home/';
my @dir = readdir(H);
closedir H;
foreach my $u (@dir) {
next if $u =~ m/^\./;
next if $forbid{$u};
warn "$u/public_html";
if (-e "/home/$u/public_html") {
push @Alias, "/$u/", "/home/$u/public_html/";
}
}
</Perl>
Yeah, that's all there is to it.
So, after asking them to reschedule, I ended up with just one of them coming next week. At a discount. Because I'm an idiot.
With any luck, I won't ever do that again. It's about time to schedule another month or two of classes, so that the training schedule does not abruptly end at the end of January. Of course, not knowing for sure when ApacheCon Europe is going to be, it is a little hard to schedule March and April with any degree of certainty. I don't think I will end up going to YAPC this year (yes, I know, it is sad, but I've got to have my priorities) so that is not going to be an issue.
Please, folks, sign up for my training classes, so that I don't have to spend my days grinding out boring web applications. You know, every person that wants to put dynamic stuff on their web sites *thinks* that they are having a unique idea, but (sssshhhh, this will be our little secret) every one of them is *exactly the same thing* with different window dressing. And while it really is fun the first 18 times, after then it sort of goes downhill. Yes, code reuse and all that. And they are *just* enough different that you end up tinkering for days on the picky details.
OK, I'm done complaining. I have a good job, and I can pay the bills most months. I'd just like the 80/20 to be 80% training, rather than the other way around. Shameless self-promotion is ok here, right? http://www.coopermcgregor.com/training/ Come one, come all. OK, so it was tacky. Bah.
DreamWeaver, on the other hand, lets you edit files, and appears to keep some kind of local copy of the modified files, only putting them up when you are satisfied with them.
This will, it seems, let me ditch FTP once and for all. And it fixes all the annoying permission problems that I always have with multi-developer web sites. Using some form of http auth, rather than user logins, allows me to create "logins" very easily, withouth having to create system accounts and hand *those* out like candy.
So, I sent out a company-wide email telling folks that they need to experiment with this, and that we'll be moving off FTP RSN. Yay.
But it seems to me that DAV will actually solve this problem. They can continue to use Dreamweaver, and then then can upload the content via DAV. I think that this will make me happy. I think that I will feel better about my servers, as well as the simple fact that I'll be using very cool technology.
So far I've gotten DAV running on a couple test servers, and I'm tinkering with cadaver as a client. This seems to be working remarkably well, and I should have this stuff happily in place before the end of the week.
Rich certified others as follows:
Others have certified Rich as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!