still kind of a stealthy love ninja (
zvi) wrote in
dw_dev_training2009-09-25 02:58 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Entry tags:
What's wrong with my Schwartz?
When I set up $LJHOME/etc/config-private.pl, I didn't set it up correctly in some ways I now know were wrong, but I didn't realize that before I protected my config files from updates.
My $LJHOME/cvs/local/etc/config-private.pl file now looks like
My $LJHOME/etc/config-private.pl looks similar to that, but with these differences. (When I tried to edit that file directly to make the changes, it through a 500 error at my dreamhack. Reverting made it work okay, again.)
What changes do I need to make to what file to get the Schwartz to work?
My $LJHOME/cvs/local/etc/config-private.pl file now looks like
#!/usr/bin/perl # Dreamwidth configuration file. Copy this out of the documentation # directory to etc/config-private.pl and edit as necessary. The reason # it's not in the etc directory already is to protect it from # getting clobbered when you upgrade to the newest Dreamwidth code in # the future. # # This is where you define private, site-specific configs (e.g. passwords). { package LJ; # database info. only the master is necessary. %DBINFO = ( 'master' => { # master must be named 'master' 'host' => "localhost", 'port' => 3306, 'user' => 'dh_zvi', 'pass' => 'FAKE PASSWORD', 'dbname' => 'dreamhack_zvi', 'role' => { 'cluster1' => 1, 'slow' => 1, # optionally, apache write its access logs to a mysql database #logs => 1, }, }, # example of a TCP-based DB connection #'somehostname' => { # 'host' => "somehost", # 'port' => 1234, # 'user' => 'username', # 'pass' => 'password', #}, # example of a UNIX domain-socket DB connection #'otherhost' => { # 'sock' => "$HOME/var/mysqld.sock", # 'user' => 'username', # 'pass' => 'password', #}, ); # Schwartz DB configuration @THESCHWARTZ_DBS = ( { dsn => 'dbi:mysql:dreamhack_zvi;host=localhost', user => 'dh_zvi', pass => '$DW::PRIVATE::THESCHWARTZ_DBS{pass}', }, ); # allow changelog posting. this allows unauthenticated posts to the changelog # community from the IP and users specified. this does not work on its own, # you have to configure your version control server to do the posting. see # cgi-bin/DW/Hooks/Changelog.pm for more information. %CHANGELOG = ( enabled => 0, community => 'changelog', allowed_posters => [ qw/ mark denise / ], allowed_ips => [ qw/ 123.123.123.123 / ], ); # example user account for FAQs. By default, [[username]] in an FAQ answer # will use the username of the logged-in user; however, if the viewer is # not logged in, this username will be used instead. (You should own this # account so that nobody can take it.) $EXAMPLE_USER_ACCOUNT = "username"; # list of official journals, as a list of "'username' => 1" pairs # used to determine whether to fire off an OfficialPost notification # when an entry is posted; hash instead of array for efficiency %OFFICIAL_JOURNALS = ( news => 1, ); # the "news" journal, to be specially displayed on the front page, etc $NEWS_JOURNAL = "news"; # list of alternate domains that point to your site. @ALTERNATE_DOMAINS = ( 'ljsite.org', 'ljsite.net', 'ljsite.co.uk', 'ljsite.tld', ); # configuration/ID for statistics tracker modules which apply to # site pages (www, non-journal) %SITE_PAGESTAT_CONFIG = ( # google_analytics => 'UA-xxxxxx-x', ); # Path (e.g. /bots) at which a informational page about your acceptable bot # policies are documented. This URI is excluded from anti-bot measures, so # make sure it's as permissive as possible to allow humans in who may be # lazy in their typing. For example, leave off the trailing slash (/bots # instead of /bots/) if your URI is a directory. #$BLOCKED_BOT_URI = '/bots'; # If you wish to publish PubSubHubbub notifications, uncomment this. You can # use this default hub location, as it's supported by Google, or you can run # your own (or use any other hub you want). # @HUBBUB_HUBS = ( 'http://pubsubhubbub.appspot.com/' ); } { package DW::PRIVATE; $DOMAIN = "zvi.hack.dreamwidth.net"; #%PAYPAL = ( # user => , # password => , # signature => , # email => , #); #%DBINFO = ( # master => { # pass => , # }, %THESCHWARTZ_DBS = ( pass => 'FAKE PASSWORD', ); #%RECAPTCHA = ( # public_key => , # private_key => , #); } 1;
My $LJHOME/etc/config-private.pl looks similar to that, but with these differences. (When I tried to edit that file directly to make the changes, it through a 500 error at my dreamhack. Reverting made it work okay, again.)
# database info. only the master is necessary. %DBINFO = ( 'master' => { # master must be named 'master' 'host' => "localhost", 'port' => 3306, 'user' => 'dh_zvi', 'pass' => 'DEFAULT PASSWORD', # CHANGETHIS 'dbname' => 'dreamhack_zvi', 'role' => { 'cluster1' => 1, 'slow' => 1, … #%THESCHWARTZ_DBS = ( # pass => 'FAKE PASSWORD', #);
What changes do I need to make to what file to get the Schwartz to work?
no subject
that needs to be
pass => $DW::PRIVATE::THESCHWARTZ_DBS{pass},
no subject
no subject
pass => 'FAKE PASSWORD',
instead.
no subject
I've stopped getting error messages about TheSchwartz being misconfigured, but it's still not actually functioning
If I need to make the changes at $LJHOME/etc/config-private.pl, how can I do that without causing a 500 error?
no subject
As for how not to cause a 500 error? Don't introduce syntax errors, I guess? If you do run into one, you can usually get more info with "tail ~/apache/logs/error_log".
no subject
"Don't introduce syntax errors" (a) reads like "don't fuck up", which is useless and dispiriting for the person being told that and (b) doesn't tell me anything about syntax, like why 'password' should be in single quotes but $DW::PRIVATE::THESCHWARTZ_DBS{pass}, should not be.
no subject
But anyway. Please don't take 500 errors (or technical advice) personally, if at all possible. It will happen to everyone, even those who know perl. You'll hit an error, you'll need a second opinion. That's normal. I think the best thing you can do is know where to look to start troubleshooting. I assume you need that advice only because you came to this discussion without the error message in hand. It also matters what this thread will look like to others who want to learn -- I just didn't want to leave your question unanswered, even though it didn't entirely make sense to me. Sorry if that was too vague.
That said, I stand by my first reactions here: (a) the variable is going to be undef at that point in the code, (b) it doesn't matter which file you edit as long as both of them have your changes when you're done, and (c) please look in error_log for more diagnostic info when you get an error. My intuition tells me that using an undefined variable could have been the error, but I can't say exactly what happened without seeing the error message.
no subject
no subject
Thanks.
no subject
Have you managed to make it work? I could use some help too. :)
no subject
no subject