whobutdrew: (Rational)
Drew ([personal profile] whobutdrew) wrote in [site community profile] dw_dev2009-09-26 07:13 pm
Entry tags:

So close, and yet...

OK, so I got past my previous crisis. I now am back where I started: My site is live, I can create accounts, import content, etc. What I can't do is actually use the site as intended.

I am working off of the assumption that my ISP is blocking port 80 traffic. So my server is listening on port 9999, and my router has that port open and forwarding to my server. I can log in as any user, but if I try to go to that user's journal (http://user.my.domain.org:9999), it technically takes me there, as that's what the address bar tells me, but I get the main site's login page, not the journal. If I try to go to a user's profile (http://user.my.domain.org:9999/profile), then I get:

We can't find that page
If you typed the URL directly (or pasted it into your browser's address bar), make sure you didn't typo, paste too little, or paste too much. If you followed a link, report this to the maintainer of the page that linked you here.

According to the wiki, if I want subdomain support, I need to add a wildcard record to my DNS, which I've done (my 'domain' is simply a DynDNS.com host, and I have enabled wildcard support on it). I have also confirmed that the settings in etc/config.pl are set correctly:


$DOMAIN_WEB = "my.domain.org"
$SITE_ROOT "http://$DOMAIN_WEB:9999"

%SUBDOMAIN_FUNCTION = (
community => 'journal',
users => 'journal',
syndicated => 'journal',
cssproxy => 'cssproxy',
);

$USER_VHOSTS = 1;
$USER_DOMAIN = "$DOMAIN_WEB:9999"; (I have tried switching this between $DOMAIN and $DOMAIN_WEB to see if it would change anything. The quotes need to be there.)

$ONLY_USER_VHOSTS = 1;

In %CAP_DEF, 'userdomain' => 1 in both default and free, again, just to see what would happen (previously only in default).


What am I overlooking/missing?

I WILL find a way to give back to this community after asking for so much help. Promise!
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2009-09-27 03:58 pm (UTC)(link)
[personal profile] sophie's comment triggered a memory, and got me looking into that area. To override the link that is created in, e.g., user tags, you can use the journal_base hook.

So, in a file, cgi-bin/DW/Hooks/JournalBase.pm, try this code:
package DW::Hooks::JournalBase;

use strict;

LJ::register_hook( 'journal_base', sub {
    my ( $u, $vhost ) = @_;
    if ( $vhost eq "users" ) {
        my $he_user = $u->user;
        $he_user =~ s/_/-/g;
        return "http://$he_user.$LJ::USER_DOMAIN:9999";
    }
} );

1;