aphenine: Teresa and Claire (Default)
aphenine ([personal profile] aphenine) wrote in [site community profile] dw_dev_training2009-07-31 11:10 pm
Entry tags:

User subdomain question

I have a question that is driving me mad. I've been looking at the dreamwidth codebase folder, most of which is excellently described in a helpful wiki page. However, one thing I cannot for the love of anything work out is where the files are that are used when dreamwidth is is accessed through a user's subdomain or what controls the mapping.

So, for example, http://www.dreamwidth.org/userinfo.bml reads userinfo.bml in $LJHOME/htdocs. But if I am accessing http://aphenine.dreamwidth.org/read, then I'm not opening $LJHOME/htdocs/read. Same for tags and profile. Please could you tell me what mapping is being used and where is it defined?
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2009-07-31 10:32 pm (UTC)(link)
Most of those are defined in cgi-bin/Apache/LiveJournal.pm which is the Apache mod_perl handler.

Basically, every time a request comes in, the various functions in that file look at the URI (URL). If it fits some certain patterns (the /read and /profile ones you mentioned, among others) then it tells Apache, "actually, go use this BML file to render the output."
janinedog: (Default)

[personal profile] janinedog 2009-07-31 11:14 pm (UTC)(link)
To add to this, the pages that are generated by S2 instead of BML are found in cgi-bin/LJ/S2/ . There you'll find RecentPage.pm (username.dreamwidth.org/), FriendsPage.pm (username.dreamwidth.org/read), EntryPage.pm (username.dreamwidth.org/####.html), etc. Those files pass information to the actual S2 code so that it can be used to render the pages.
pne: A picture of a plush toy, halfway between a duck and a platypus, with a green body and a yellow bill and feet. (Default)

[personal profile] pne 2009-08-01 01:29 pm (UTC)(link)
Will FriendsPage.pm be renamed? Or is that going to stay the same since it's not a user-facing name?
janinedog: (Default)

[personal profile] janinedog 2009-08-01 05:14 pm (UTC)(link)
As far as I know, there's no plans to change the name. Probably doesn't matter too much either way.