»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


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


    "clusters" => {
        "1" => "/path/to/some/directory/",
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

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.
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.
The default capability limits, used only when no other class-specific limit below matches.

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


     'core' => 'core1',
     'layout' => 'generator/layout',
     'i18n' => 'generator/en',

If set, and your MTA is configured, users can post to their account via username@$EMAIL_POST_DOMAIN.


The default capability class mask for new users.

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


Do certain users get a forwarding email address, such as user@$DOMAIN?. This requires additional mail system configuration.
If enabled, the LiveJournal installation will support username URLs of the form http://username.yoursite.com/

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


    "s1_lastn_style" => 29,
    "s1_friends_style" => 20,
    "s1_calendar_style" => 2,
    "s1_day_style" => 11,

Human Checks


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"


('create' => 1);

Database Related


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


qw(fast slow)


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.

The default cluster to choose when creating new accounts.


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.

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



Development/Debugging Options

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.
Enable this option to signify that the server running the LiveJournal software is being used as a development server.

Message to send to users when the database is unavailable


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

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


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

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



Domain Related


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.


["", ".$DOMAIN"]


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.
The minimal domain of the site, excluding the 'www.' prefix if applicable.
Optional. If defined and different from $LJ::DOMAIN, any GET requests to $LJ::DOMAIN will be redirected to $LJ::DOMAIN_WEB.
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.

The URL prefix of the image directory or subdomain.



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.


chomp($SERVER_NAME = `hostname`);
The name of the site

The abbreviated version of the name of the site.



The shortened name of the site, for brevity purposes.



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



The URL prefix to the static content directory or subdomain.


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>

The URL prefix to the userpic directory or subdomain.



Contact email addresses

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

Miscellaneous settings

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.
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.
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.

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.


     234 => 1,
     232252 => 1,

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.


     "accounttype" => "http://www.example.com/doc/faq/",
     "security" => "http://www.example.com/doc/security",
Allows a user to hide usernames from appearing on their 'friend-of' list via use of the 'ban' mechanism.

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


Set this option true if you are running an installation using ljcom code and if you haven't installed the Crypt::Cracklib perl module.

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


("^ex_", "^lj_")

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.


( '2' => 'whitaker', '3' => 'test', );

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.


   { scheme => 'bluewhite', title => 'Blue White' },
   { scheme => 'lynx', title => 'Lynx' },
   { scheme => 'opalcat', title => 'Opalcat' },

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


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


Boolean setting that compresses log and comment text in the database, to save disk space.
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.

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



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



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


This journal is in read-only mode right now while database maintenance is being performed. Try again in a few minutes.
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


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


qw(main right moz)

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


{'main' => [ 
             [ 'update', 'mode=full'],
 'right' =>  [ 
             [ 'stats', '', ],
             [ 'bdays', '', ],
             [ 'popfaq', '', ],
 ] };

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


{'main' => [ 
             [ 'update', 'mode='],
 'right' =>  [ 
             [ 'login', '', ],
             [ 'stats', '', ],
             [ 'randuser', '', ],
             [ 'popfaq', '', ],
 'moz' =>    [
             [ 'login', '', ],

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



Syndicated Account Options

When set to an appropriate LASTN style, all syndicated accounts on this installation will use this style.
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


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


"/usr/bin/sendmail -t"

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


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


"/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


Points to the under bin directory under \$LJHOME



Set to the same value as \$LJHOME



Points to the htdocs directory under \$LJHOME



Points to the temp directory under \$LJHOME



Points to the var directory under \$LJHOME




Boolean setting that allows UTF-8 support. This is enabled by default.