»1. $LJ:: Variables

Each $LJ:: variable is explained below. There are two types: user-configurable ones and those that are automatically set and interesting only to people extending the LiveJournal code.

»1.1. User-Configurable

New installations will probably want to set these variables. Some are automatically set by ljdefaults.pl based on your other settings, but it wouldn't hurt to specify them all explicitly.

Blob Server

»%LJ::BLOBINFO

Hash that contains the details for a number of blob servers. The format of the paramater is 'cluster' => 'director'. The webserver user also needs to be able to the directory given as the directory. If you wish to use Captcha Image and Audio Generation for Human Checks, then this is a necessary paramater

Example:

%BLOBINFO = (
    "clusters" => {
        "1" => "/path/to/some/directory/",
    },
);
»$LJ::USERPRIC_BLOBSERVER
If set to true, userpics are store as a file on the server rather than in the database. This depends on a Blob Server being setup in the %LJ::BLOBINFO section

Capabilities/User Options

»$LJ::ALLOW_PICS_OVER_QUOTA
By default, when a user's account expires, their least often used userpics will get marked as inactive and will not be available for use. Turning this boolean setting true will circumvent this behavior.
»%LJ::CAP
A hash that defines the capability class limits. The keys are bit numbers, from 0 .. 15, and the values are hashrefs with limit names and values. Consult for more information.
»%LJ::CAP_DEF
The default capability limits, used only when no other class-specific limit below matches.
»$LJ::DEFAULT_STYLE

A hash that defines the default S2 layers to use for accounts.

Default:

{
     'core' => 'core1',
     'layout' => 'generator/layout',
     'i18n' => 'generator/en',
 };
»$LJ::EMAIL_POST_DOMAIN

If set, and your MTA is configured, users can post to their account via [email protected]$EMAIL_POST_DOMAIN.

Example:

post.$DOMAIN
»$LJ::NEWUSER_CAPS
The default capability class mask for new users.
»$LJ::USER_DOMAIN

If $LJ::USER_VHOSTS is enabled, this will is the part of the URL that follows 'username'.

Example:

$DOMAIN
»$LJ::USER_EMAIL
Do certain users get a forwarding email address, such as [email protected]$DOMAIN?. This requires additional mail system configuration.
»$LJ::USER_VHOSTS
If enabled, the LiveJournal installation will support username URLs of the form http://username.yoursite.com/
»%LJ::USERPROP_DEF

This option defines the userproperties that users should have by default.

Example:

%USERPROP_DEF = (
    "s1_lastn_style" => 29,
    "s1_friends_style" => 20,
    "s1_calendar_style" => 2,
    "s1_day_style" => 11,
);

Human Checks

»%LJ::HUMAN_CHECK

This option enables human checks at various places throughout the site. Enabling this requires a "Blob Server" setup (for details of setting one up, refer to the %LJ::BLOBINFO section of the document.) Currently, the only option is "create"

Example:

('create' => 1);

Database Related

»@LJ::CLUSTERS

This is an array that contains the names of the clusters that your configuration uses.

Example:

qw(fast slow)

Default:

(1)
»%LJ::DBINFO
This is a hash that contains the necessary information to connect to your database, as well as the configuration for multiple database clusters, if your installation supports them. Consult for more details.
»$LJ::DEFAULT_CLUSTER

The default cluster to choose when creating new accounts.

Default:

1
»$LJ::DIR_DB
This setting tells the installation which database to read from for directory usage. By default this is left blank, meaning that it will use the main database. This can make larger installations work much slower.
»$LJ::DIR_DB_HOST

The database role to use when connecting to the directory database.

Example:

master

Development/Debugging Options

»$LJ::ALLOW_CLUSTER_SELECT
When set true, the journal creation page will display a drop-down list of clusters (from @LJ::CLUSTERS) along with the old 'cluster 0' which used the old db schema and the user creating an account can choose where they go. In reality, there's no use for this, it's only useful when working on the code.
»$LJ::IS_DEV_SERVER
Enable this option to signify that the server running the LiveJournal software is being used as a development server.
»$LJ::NODB_MSG

Message to send to users when the database is unavailable

Default:

Database temporarily unavailable. Try again shortly.
»$LJ::SERVER_DOWN
Set true when performing maintenance that requires user activity to be minimum, such as database defragmentation and cluster movements.
»$LJ::SERVER_DOWN_MESSAGE

While $LJ::SERVER_DOWN is set true, this message will be displayed for anyone trying to access the LiveJournal installation.

Example:

$SITENAME is down right now while we upgrade. It should be up in a few minutes.
»$LJ::SERVER_DOWN_SUBJECT

While $LJ::SERVER_DOWN is set true, a message with this subject is displayed for anyone trying to access the LiveJournal installation.

Example:

Maintenance

Domain Related

»$LJ::COOKIE_DOMAIN

Cookie domains should simply be set to .$domain.com, based on the Netscape Cookie Spec, but some older browsers don't adhere to the specs too well. $LJ::COOKIE_DOMAIN can be a single string value, or it can be a perl array ref.

Example:

["", ".$DOMAIN"]

Default:

.$DOMAIN
»$LJ::COPPA_CHECK
If set, the account creation dialog shows a checkbox, asking users if they're under 13 years old and won't let them create an account if they check it.
»$LJ::DOMAIN
The minimal domain of the site, excluding the 'www.' prefix if applicable.
»$LJ::DOMAIN_WEB
Optional. If defined and different from $LJ::DOMAIN, any GET requests to $LJ::DOMAIN will be redirected to $LJ::DOMAIN_WEB.
»$LJ::FRONTPAGE_JOURNAL
If set, the main page of the site loads the specified journal, not the default index page. Use this if you're running a news site where there's only one journal, or one journal is dominant.
»$LJ::IMGPREFIX

The URL prefix of the image directory or subdomain.

Default:

$SITEROOT/img
»$LJ::SERVER_NAME

Optional. If using db-based web logging, this field is stored in the database in the server column, so you can see later how well each server performed. To share the same ljconfig.pl on each host (say, over NFS), you can put something like this in your ljconfig.pl: It's kinda ugly, but it works.

Example:

chomp($SERVER_NAME = `hostname`);
»$LJ::SITENAME
The name of the site
»$LJ::SITENAMEABBREV

The abbreviated version of the name of the site.

Default:

LJ
»$LJ::SITENAMESHORT

The shortened name of the site, for brevity purposes.

Default:

LiveJournal
»$LJ::SITEROOT

The URL prefix to construct canonical pages. This can include the port number, if 80 is not in use.

Default:

http://www.$DOMAIN:8011/
»$LJ::STATPREFIX

The URL prefix to the static content directory or subdomain.

Default:

$SITEROOT/stc
»$LJ::TOS_CHECK
If set, the account creation dialog shows a checkbox, asking users if they agree to the site's Terms of Service, and won't allow them to create an account if they refuse. This depends on a few files being located in the proper directories, namely <filename>tos.bml</filename> and <filename>tos-mini.bml</filename> under <filename><envar>$LJHOME</envar>/htdocs/legal/</filename>. The account creation dialog can also check for new instances of the Terms of Service if the Terms of Service text is located in a CVS managed include file (<filename><envar>$LJHOME</envar>/htdocs/inc/legal-tos</filename>), and if the include file includes the following line at the top: <programlisting><![CDATA[<!-- $Revision$ -->]]></programlisting>
»$LJ::USERPIC_ROOT

The URL prefix to the userpic directory or subdomain.

Default:

$SITEROOT/userpic

Contact email addresses

»$LJ::ADMIN_EMAIL
Given as the administrative address for functions like changing passwords or information.
»$LJ::BOGUS_EMAIL
Used for automated notices like comment replies and general support request messages. It should be encouraged not to reply to this address.
»$LJ::SUPPORT_EMAIL
Used as a contact method for people to report problems with the LiveJournal installation.

Miscellaneous settings

»$LJ::ANTI_SQUATTER
Set true if your installation is a publically available development server and if you would like beta testers to ensure that they understand as such. If left alone your installation might become susceptible to hordes of squatter accounts.
»%LJ::DISABLED
Boolean hash, signifying that separate parts of this LiveJournal installation are working and are avaiable to use. Consult Section 3: %LJ::DISABLED for more information.
»$LJ::DYNAMIC_LJUSER
Boolean variable that defines whether the user-types of users is looked up when LJ::ljuser is called. This is not recommended unless the site is using memcached.
»%LJ::FORCE_EMPTY_FRIENDS

A hash of userids whose friends views should be disabled for performance reasons. This is useful if new accounts are auto-added to another account upon creation (described in @LJ::INITIAL_FRIENDS), as in most situations building a friends view for those accounts would be superflous and taxing on your installation.

Example:

(
     234 => 1,
     232252 => 1,
);
»%LJ::HELPURLS

A hash of URLs. If defined, little help bubbles appear next to common widgets to the URL you define. Consult Section 2: %LJ::HELPURLS for more information.

Example:

%HELPURLS = (
     "accounttype" => "http://www.example.com/doc/faq/",
     "security" => "http://www.example.com/doc/security",
);
»$LJ::HIDE_FRIENDOF_VIA_BAN
Allows a user to hide usernames from appearing on their 'friend-of' list via use of the 'ban' mechanism.
»@LJ::INITIAL_FRIENDS

This is a list of usernames that will be added to the friends list of all newly created accounts on this installation.

Example:

qw(news)
»$LJ::NO_PASSWORD_CHECK
Set this option true if you are running an installation using ljcom code and if you haven't installed the Crypt::Cracklib perl module.
»@LJ::PROTECTED_USERNAMES

This is a list of regular expressions matching usernames that users on this LiveJournal installation can't create on their own.

Example:

("^ex_", "^lj_")
»%LJ::S2_TRUSTED

Allows a specific user's S2 layers to run javascript, something that is considered a potential security risk and is disabled for all accounts. The hash structure is a series of userid => username pairs. Note that the system account is trusted by default, so it is not necessary to add to this hash.

Example:

( '2' => 'whitaker', '3' => 'test', );
»@LJ::SCHEMES

An array of hashes with keys being a BML scheme name and the values being the scheme description. When set, users can change their default BML scheme to the scheme of their choice.

Example:

(
   { scheme => 'bluewhite', title => 'Blue White' },
   { scheme => 'lynx', title => 'Lynx' },
   { scheme => 'opalcat', title => 'Opalcat' },
);
»@LJ::TESTACCTS

A list of usernames used for testing purposes. The password to these accounts cannot be changed through the user interface.

Example:

qw(test test2);
»$LJ::USE_ACCT_CODES
A boolean setting that makes the LiveJournal installation require an invitation code before anyone can create an account.Consult for more information.

Optimization

»$LJ::COMPRESS_TEXT
Boolean setting that compresses log and comment text in the database, to save disk space.
»$LJ::DO_GZIP
Boolean setting that when enabled, signals to the installation to use gzip encoding wherever possible. In most cases this is known to cut bandwidth usage in half. Requires the Compress::Zlib perl module.
»$LJ::MAX_HINTS_LASTN

Sets how many entries a user can have on their LASTN page. A higher value can majorly affect the speed of the installation.

Default:

100
»$LJ::MAX_SCROLLBACK_FRIENDS

Sets how far back someone can go on a user's FRIENDS page. A higher value can majorly affect the speed of the installation.

Default:

1000
»$LJ::MSG_READONLY_USER

Message to send to users if their account becomes readonly during maintenance.

Example:

This journal is in read-only mode right now while database maintenance is being performed. Try again in a few minutes.
»$LJ::USE_RECENT_TABLES
Only turn this on if you are using MySQL replication between multiple databases and have one or more slaves set to not replicated the logtext and talktext tables. Turning this on makes LJ duplicate all logtext & talktext rows into recent_logtext & recent_talktext which is then replicated. However, a cron job cleans up that table so it's never too big. LJ will try the slaves first, then the master. This is the best method of scaling your LJ installation, as disk seeks on the database for journal text is the slowest part.

Portal Configuration

»@LJ::PORTAL_COLS

This is a list that specifies which columns can be used for the portal pages.

Default:

qw(main right moz)
»$LJ::PORTAL_LOGGED_IN

The default positions for portal boxes that a user will see when they are logged in.

Default:

{'main' => [ 
             [ 'update', 'mode=full'],
             ],
 'right' =>  [ 
             [ 'stats', '', ],
             [ 'bdays', '', ],
             [ 'popfaq', '', ],
 ] };
»$LJ::PORTAL_LOGGED_OUT

The default positions for portal boxes that a user will see when they are logged out.

Default:

{'main' => [ 
             [ 'update', 'mode='],
             ],
 'right' =>  [ 
             [ 'login', '', ],
             [ 'stats', '', ],
             [ 'randuser', '', ],
             [ 'popfaq', '', ],
             ],
 'moz' =>    [
             [ 'login', '', ],
             ],
};
»$LJ::PORTAL_URI

The URI to the portal. Only two options are supported at this time, '/portal/' and '/'.

Default:

/portal/

Syndicated Account Options

»$LJ::SYN_LASTN_S1
When set to an appropriate LASTN style, all syndicated accounts on this installation will use this style.
»$LJ::SYND_CLUSTER
Syndicated accounts tend to have more database traffic than normal accounts, so its a good idea to set up a seperate cluster for them.If set to a cluster (defined by @LJ::CLUSTERS), all newly created syndicated accounts will reside on that cluster.

System Tools

»$LJ::SENDMAIL

The system path to the sendmail program, along with any necessary parameters.

Example:

"/usr/bin/sendmail -t"
»$LJ::SMTP_SERVER

This the recommended system to use for sending email. This requires the perl Net::SMTP module to work properly.

Example:

10.2.0.1
»$LJ::SPELLER

The system path to a spell checking binary, along with any necessary parameters.

Example:

"/usr/local/bin/aspell pipe --sug-mode=fast --ignore-case"

»1.2. Auto-Configured

These $LJ:: settings are automatically set in ljdefaults.pl. They're only documented here for people interested in extending LiveJournal. Or, you can define them in ljconfig.pl ahead of time so you can use them in definitions of future variables.

Configuration Directories

»$LJ::BIN

Points to the under bin directory under \$LJHOME

Default:

$HOME/bin
»$LJ::HOME

Set to the same value as \$LJHOME

Default:

$ENV{'LJHOME'}
»$LJ::HTDOCS

Points to the htdocs directory under \$LJHOME

Default:

$HOME/htdocs
»$LJ::TEMP

Points to the temp directory under \$LJHOME

Default:

$HOME/temp
»$LJ::VAR

Points to the var directory under \$LJHOME

Default:

$HOME/var

Internationalization

»$LJ::UNICODE
Boolean setting that allows UTF-8 support. This is enabled by default.