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

These $LJ:: settings are automatically set in ljdefaults.pl. You do not need to use all of them. Some are only documented here for people interested in extending LiveJournal, or for other special cases.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 bin directory under $LJ::HOME.



Points to the cvs directory under $LJ::HOME. This is used by multicvs.conf, which specifies how the files from the multiple SVN repositories map onto the live file space ($LJ::LIVEDIR / $LJ::HOME).



Set to the same value as $LJHOME.



Points to the htdocs directory under $LJ::HOME.



Points to $LJ::HOME. This is used by multicvs.conf, which specifies how the files from the multiple SVN repositories map onto the live file space from $LJ::CVSDIR.



Points to the ssldocs directory under $LJ::HOME.



Points to the temp directory under $LJ::HOME.



Points to the var directory under $LJ::HOME.



Database Setup


Integer number of seconds to wait for database handles before timing out. By default, zero, which means no timeout.



The max number of bytes that a MySQL database slave can be behind in replication and still be considered usable. Note that slave databases are never used for any 'important' read operations (and especially never writes, because writes only go to the master), so in general MySQL's async replication won't bite you. This mostly controls how fresh of data a visitor would see, not a content owner. But in reality, the default of 100k is pretty much real-time, so you can safely ignore this setting.

E-mail Related


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.



Sets the from address for community invitation e-mails. When this option is not set, it defaults to the $LJ::ADMIN_EMAIL address. This makes them appear to be official communications from the site because the same address is used for password reminders and validation e-mails. The invitations are actually communications from individual users through a site feature - they are more comparable to comment e-mails.







Default ISO (639/639_3166) language code to show site in, for users that have not set their language. Defaults to the first item in @LANGS, which is usually "en", for English. Optional.



Boolean setting that allows UTF-8 support (for posts in multiple languages). The default has been 'on' for ages, and turning it off is nowadays not recommended or even known to be working/reliable. Keep it enabled.

Miscellaneous Auto-Configured


Sets how often the editor at update.bml will automatically save a draft of the entry. The default saves at intervals of three minutes.



Editor for new entries if the user hasn't overridden it. Should be 'rich' or 'plain'.



If $LJ::DO_GZIP is enabled, the list of content types considered valid for gzip compression is defined in this hash.


    'text/html' => 1,                # regular web pages; XHTML 1.0 'may' be this
    'text/xml' => 1,                 # regular XML files
    'application/xml' => 1,          # XHTML 1.1 'may' be this
    'application/xhtml+xml' => 1,    # XHTML 1.1 'should' be this
    'application/rdf+xml' => 1,      # FOAF should be this

Max number of bytes that users are allowed to upload via Atom API. Note that this upload path is not ideal, so the entire upload must fit in memory. Default is 25MB until path is optimized. It is set like this because the HTTP content-length header is in bytes (a 25600 value would be 25KB).



The maximum number of friends that users' FOAF files will show (so the server does not get overloaded). If they have more than the configured amount, some friends will be omitted.



The maximum number of friend-ofs ('fans'/'followers') to load for a given user. Defaults to 5000. Beyond that, a user is just too popular and saying 5,000 is usually sufficient because people aren't actually reading the list.



Boolean hash to set usercap for the maximum amount of keywords a userpic can have. The keywords themselves have a 40 character limit; userpic comments can be up to 255 bytes or 120 chars.



The file (relative to htdocs) to use for the profile URL. Defaults to userinfo.bml


Block size used in stats generation code that gets n rows from the database at a time.





Array of cookie domain values to send when deleting cookies from users. Only useful when changing domains, and even then kind've useless. Notes: ancient hack for one old specific use.


("", "$DOMAIN", ".$DOMAIN")

According to the RFCs concerning cookies, the cookie path must be explicitly set as well. If LiveJournal is installed underneath a directory other than the top-level domain directory, this needs to be set accordingly. Note: Setting or changing this variable has no practical use, since LiveJournal must be rooted at /.



HTML to show at the top left corner of the Dystopia skin. This was never actually used. Second, the Dystopia 'skin' (scheme) is ljcom, not GPL-licensed livejournal code.


Old historic baggage: Do not use. This boolean enables the fix_usercounter.bml tool at $SITEROOT/admin. The tool reset user counters to resolve “duplicate key error” issues with journals. A better way to address the problem was found, making this tool redundant.


Old historic baggage: Do not use. There used to be a bug where only parts of entries got deleted, then there was another bug with per-user number allocation. Together, they forced this option to be made for awhile, where new entries (when this is on) would blow away any old data if part of it was still there but wasn't supposed to be. This includes deleting comments tied to those old entries. Off by default.

Site Maintenance


Message to show users when they're not allowed to comment due to either their 'get_comments' or 'leave_comments' capability being disabled, probably by the admin to lower activity after a hardware rotation.


Due to hardware maintenance, you cannot leave comments at this time.  Watch the news page for updates.

Message to show users when they are not allowed to post due to their 'can_post' capability being disabled, probably by the admin to lower activity after a hardware rotation.


Due to hardware maintenance, you cannot post at this time.  Watch the news page for updates.

Message to show users when their journal (or a journal they are visiting) is in read-only mode due to maintenance.


This journal is in read-only mode right now while database maintenance
is being performed. Try again in a few minutes.


Database temporarily in read-only mode during maintenance.

System Related


Mail transports setup. Array values are: protocol, mailserver hostname, and preferential weight. qmtp (requires the Net::QMTP perl module to work properly), SMTP, dmtp, and sendmail are the currently supported protocols.


( [ 'sendmail', $SENDMAIL, 1 ] )

The system path to the sendmail program, along with any necessary parameters. This option is ignored if you have defined the higher-precedence option: @LJ::MAIL_TRANSPORTS. See also $LJ::SMTP_SERVER


"/usr/sbin/sendmail -t -oi"



If set, external CSS should be proxied through this URL (URL is given a ?u= argument with the escaped URL of CSS to clean. If unset, remote CSS is blocked. See also $LJ::CSS_FETCH_TIMEOUT.


Use the S2 style named 's1shortcomings' to handle page types that S1 can't handle. Otherwise, BML is used. This is off by default, but will eventually become on by default, and no longer an option.


Do not try to load compiled S2 layers from the global cluster. Any new installation can enable this safely as a minor optimization. If you have an existing site, make sure to only turn this flag on if you have actually migrated everything. The option only really makes sense for large, old sites



An array of hashes with keys ('scheme') being a BML scheme name and the values ('title') being the scheme description. When set, users can change their default site scheme to the scheme of their choice. Schemes will be displayed according to their order in the array, but the first array item is the site default scheme.


        { scheme => 'bluewhite', title => 'Blue White' },
        { scheme => 'lynx', title => 'Lynx',
        thumb => [ 'schemethumb/lynx.png', 200, 166 ]  },
        { scheme => 'opalcat', title => 'Opalcat' },


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

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

Abuse Prevention


Include unique cookie information and IP address with the $LJ::BLOCKED_BOT_MESSAGE notice.


Message (HTML) shown to people suspected to be bots, informing them they've been banned, and where/what the rules are.


You don't have permission to view this page.

Subject/title (text-only) shown to people suspected to be bots.


403 Denied

Path (e.g. /bots) at which an informational page about your acceptable bot policies is 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.


If enabled, when a user attempts to change e-mail addresses the new address is checked for validity; changing to $LJ::USER_EMAIL addresses is also disallowed.


Setup support e-mail address to not accept new e-mails. Basically if an address is specified below, any user who e-mails it out of the blue will be sent back a copy of the specified file along with their e-mail. Users will still be allowed to respond to e-mails from the support system, but they are not able to open a request by e-mailing the address. The value part of the hash is the name of an include file. It will be loaded out of $LJHOME/htdocs/inc. See $LJ::FILEEDIT_VIA_DB for how to make it read from memcached/DB.


    'abuse@$DOMAIN' => 'bounce-abuse',

If enabled, users will not be able to edit their e-mail address at manage/profile. Instead, a link to changeemail.bml will be displayed, and (non-OpenID™) users will be prompted for their password at that page.


If enabled, when a user attempts to change their e-mail address at changeemail.bml, their IP address is included with the record noting the change in the statushistory table.


Arrayref of rate rules to apply incoming comments from anonymous “users”. It is switched off by default. Each rate rule is an arrayref of two items: number of comments, and period of time. If user tries to make more comments in the specified time period, the comment is denied, at least without a CAPTCHA. In the example, anonymous comments will always require a CAPTCHA. For efficient anti-spammer rate-limiting we recommend you also run memcached, and set the appropriate ljconfig.pl variables (@LJ::MEMCACHE_COMPRESS_THRESHOLD and @LJ::MEMCACHE_SERVERS).


[[0, 65535]];


[ [ 300, 3600 ], [ 200, 1800 ], [ 150, 900 ], [ 15, 60 ] ];

Arrayref of rate rules to apply incoming comments from authenticated users . It is switched off by default. Each rate rule is an arrayref of two items: number of comments, and period of time. If user makes more comments in period of time, comment is denied, at least without a CAPTCHA.


[ [ 200, 3600 ], [ 20, 60 ] ];

Real-time Block List support for comments. In the array specify providers you wish to use, like dsbl.org's or openproxies.com's data, to help combat comment spam.


Require submitted comments to include a signed hidden value provided by the server. Slows down comment-spammers, at least, in that they have to fetch pages first, instead of just blasting away POSTs. Defaults to off.


If $LJ::REQUIRE_TALKHASH is on, also make sure that the talkhash provided was issued in the past two hours. Defaults to off.


If enabled, do not e-mail passwords in the clear from lostinfo.bml. Instead, e-mail a link that allows the user to reset their password. The link authorizes the user to use changepassword.bml, without an old password.


Regular expression which, when matched on incoming comment bodies, kills the comment.


If set, up to this many URLs will be extracted from comments and stored (in the commenturls table) for analysis.



Filter comments for spam using this list of regular expressions.



Set this boolean value to true, to give users a unique session cookie, unrelated to their login session cookie, to help fight abuse.

Capabilities/User Options


By default, when a user has more userpics than their account type allows, perhaps due to expiration of paid time, their least often used userpics (based on their journal posts) will be marked inactive. This happens whenever their account type is changed or they visit editpics.bml. They will no longer be available for use, and only the account owner may see them on editpics.bml. Turning this boolean setting true will circumvent this behavior. In other words, enabling this option lets users just keep whatever userpics they had when their account type changed.


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 Section 4, “Setting Capabilities” for more information.


The default capability limits, used only when no other class-specific limit below matches.


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



If set to true, users don't need to validate their e-mail addresses.


The default capability class mask for new users. Bitmask of capability classes that new users begin their accounts with. By default users are not in any capability classes and get only the default site-wide capabilities. See also %LJ::CAP.


Hashref of journaltype (P, C, I, …) to maximum number of allowed attended schools for that journal type.


    'P' => 25,
    'I' => 25,
    'S' => 25,
    'C' => 50,

Let users set their PGP/GPG public key, and accept PGP/GPG-signed e-mail for e-mail posting. Requires GnuPG::Interface and Mail::GnuPG modules to be installed. Note: users need to use GPG version 1.2.4, or higher.


Do certain users get a forwarding e-mail address, such as user@$DOMAIN?. This requires additional mail system configuration. Users will also need the “useremail” cap.


This option defines the user-properties that users should have by default.


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

Contact e-mail addresses


This provides a way to declare more than one e-mail address which is routed to a support category. The primary incoming e-mail address for a support category is in the supportcat table. If you need more than one, this hash maps from the e-mail address you want to accept mail, to the primary e-mail address of that support category. For instance: %ALIAS_TO_SUPPORTCAT = ('dmca@example.com' => 'webmaster@example.com') would mean that dmca@ would go to the same support category that webmaster@ would otherwise go to.


Used as a contact method for people to report problems with the LiveJournal installation.



Database Related


A hash that defines master-master DB cluster pairs.


This is an array listing the names of the clusters that your configuration uses. Each one needs a 'cluster$i' role in %LJ::DBINFO. Consult Section 2, “Setting up multiple database servers” for more details.


( 1, 2, 3 )


( 1 )

An optional host:port to send UDP packets to with blocking reports. The reports log the total amount of time used in a slow operation to a remote host via UDP.



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 Section 4, “Configuring %LJ::DBINFO for more details.


The default cluster to choose when creating new accounts. If you have an arrayref of multiple cluster names, for scalability, one of the listed clusters is chosen at random. You can weight new users by repeating cluster numbers, e.g. [ 1, 1, 1, 2 ] puts 75% of people on cluster 1, 25% of people on cluster 2. Clusters are checked for validity before being used.


[ 1 ]

If true, only use the 'directory' DB role for the directory, and don't also try the 'slave' and 'master' roles. Consult Section 4, “Configuring %LJ::DBINFO for details on setting roles.


If set to true, access to the 'master' DB role is prevented, by breaking the LJ::get_dbh function. Useful during master database migrations.


If set to true, all database connection handles (except those for logging) are disconnected at the end of each request. Recommended for high-performance sites with lots of database clusters.


If set to true, memcached connection handles are disconnected at the end of each request. Not recommended if your memcached instances are Linux 2.6.


Boolean value that controls /admin/fileedit setup. If you are using and frequently editing the files in htdocs/inc, you may wish to put all of these files into the database. It uses the BML hook called “include_getter”. If it is defined, then it is called and checked every time BML includes something. It behaves like other BML hooks. The hook uses the LJ::load_include API. Using these ljconfig.pl options, you can configure it to make none/some/all include files be loaded from memcached / DB. You can instruct BML to treat all <?_include?> statements as being pulled from memcached (failover to the database) by uncommenting this. Alternatively, you can specify that only particular files should be kept in memcached and the database, using a hash: (%LJ::FILEEDIT_VIA_DB). An example value for the hash, is: ( 'support_links' => 1, );


Gearman information, if you have gearmand servers running, so you can run workers. Uses form: hostname:port.



This is used to set the minimum size of an object before trying to compress it. A value of '0' turns off compress; a value of x sets that size as required. You specify the array value in bytes.



If you have multiple internal networks and would like the memcached libraries to pick one network over the other, you can set the preferred IP list. In the example below, the variable is set to say “if we try to connect to, instead try first and then fall back to”.


( =>,

Memcache information, if you have memcached servers running. Uses form: hostname:port.



Make the stats system use the “slow” database role, never using “slave” or “master”, and dying loudly if it is unable to do so.


Array of database roles to be used for slow support queries, in order of precedence.



TheSchwartz information, so it can connect to your database, if you have TheSchwartz server and workers running.


my $mast = $LJ::DBINFO{master};
    my $dbname = $mast->{dbname} || 'livejournal';
    dsn  => 'dbi:mysql:$dbname;host=$mast->{host}',
    user => $mast->{user},
    pass => $mast->{pass},
    prefix => 'sch_',

Create new tables as InnoDB by default.

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 is only useful when working on the code. Deprecated. Instead, use: $LJ::DEBUG{allow_cluster_select} = 1;.


Mapping of key (word chars) to file (like $LJ::PROFILE_BML_FILE) to use to override the default $LJ::PROFILE_BML_FILE. Used if the ver=[key] URL parameter is used on a /profile URL.


Set true if your installation is a publicly 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. Deprecated. Instead, use: $LJ::DEBUG{anti_squatter} = 1;


Enable this if you are running a development installation and have set up SSL.


Enable this option to signify that the server running the LiveJournal software is being used as a development server and not used for production. A lot of debug info and intentional security holes for convenience are introduced when this is enabled. When enabled, the tool will check your ljconfig.pl variables (using the LJ::ConfCheck::* module). Additionally, changed library files are automatically reloaded without stopping/starting Apache.


Array of additional (ISO 639/639_3166) language codes to allow users to select e.g. using an argument on a URL, if they know about them. These ones are actively being translated, but are not yet ready to be publicly available.


Support explicit IP + community + user posting without passwords, for internal purposes. You might want to use this if you want to make commits to your local SVN repository but without parsing your local SVN configuration, for example. An alternative to this hash is the generic post_noauth hook, which allows dynamically generating posters based on how you program the hook to be used.


    '' => {
    'changelog' => [qw(stan eric wendy kyle etc)],
    'another_community' => [qw(bob mary jane sue)],

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


qw(test test2);

Domain Related


Subdomain URL to use for ad-serving.


The “domain” value set on cookies sent to users. Note the leading period, which is a wildcard for everything at or under $DOMAIN. Cookie domains should simply be set to .$domain.tld, based on the Netscape Cookie Spec., but some older browsers do not adhere to the specs very well. $LJ::COOKIE_DOMAIN can be a single string value, or it can be a perl array ref.


["", ".$DOMAIN"]



The minimal domain name of the site, excluding the 'www.' prefix if applicable.



The preferred domain name for your installation's web root. For instance, if your $DOMAIN is 'foo.com', your $DOMAIN_WEB might be 'www.foo.com', so any user who goes to foo.com will be redirected to www.foo.com. If defined and different from $LJ::DOMAIN, any GET requests to $LJ::DOMAIN will be redirected to $LJ::DOMAIN_WEB.



Prefix for embedded media content. Media is embedded into an entry or comment using an iframe. We recommend using a separate domain, for security.



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 (static) image directory or subdomain. Does not take a trailing slash. By default it is $SITEROOT/img, but your load balancing may dictate another hostname or port for efficiency. See also $LJ::JSPREFIX.



Prefix on (static) JavaScript directory or subdomain, for URLs. Does not take a trailing slash. By default it is $SITEROOT/js, but your load balancing may dictate another hostname or port for efficiency. See also $LJ::IMGPREFIX.



If you only want $LJ::USER_VHOSTS to work, and want to disable the typical /users/USERNAME, /~USERNAME, and /community/USERNAME URLs, set this boolean option.


Let users CNAME their vanity domains to this LiveJournal installation, to transparently load their journal. Users will also need the “domainmap” cap.


The URL prefix to the palimgs directory or subdomain. Does not take a trailing slash. Prefix on GIF/PNGs with dynamically generated palettes. By default, it's '$SITEROOT/palimg', and there is little reason to change it. Useful if you want to move images, used for styling, to another host. You can use it in a similar way to $LJ::SITEROOT (e.g. $LJ::PALIMGROOT/myimage.png). Somewhat related: note that Perlbal has a plugin to handle these before it gets to mod_perl, if you would like to relieve some load on your backend mod_perls. But you do not necessarily need this option for using Perlbal to do it. It depends on your configuration.



System's hostname. 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. In a massive LiveJournal webfarm, each node would have its own value of this. The default is to query the local machine's hostname at runtime, so you don't need to set this. It is not used for anything too important anyway To share the same ljconfig.pl on each host (say, over NFS), you can put something like the example in your ljconfig.pl: It is kind've ugly, but it works.


chomp($SERVER_NAME = `hostname`);



The name of the site. This is set to the default, unless you override it in ljconfig.pl, or you define $LJ::SITENAMESHORT which is stripped of its trailing .tld suffix (.net, .com, etc.) and used for $SITENAME.



The abbreviated (shortened) possible slang name of your site.



The shortened name of the site, for brevity purposes.



The URL prefix, including 'http://', to construct canonical pages. Does not take a trailing slash. This can include the port number, if 80 is not in use. This is what gets prepended to all URLs. This can't be auto-detected because of reverse-proxies, etc. See also $LJ::SSLROOT.





Parallels $LJ::IMGPREFIX. The URL prefix of the (static) image directory or subdomain, for the SSL-portion of the site. Does not take a trailing slash.



Parallels $LJ::JSPREFIX. Prefix on (static) JavaScript directory or subdomain, for the SSL-portion of the site. Does not take a trailing slash.



The URL prefix, including 'https://', for the base of the SSL-portion of the site. Does not take a trailing slash. This can't be auto-detected because of reverse-proxies, etc. See also $LJ::SITEROOT.



Parallels $LJ::STATPREFIX. The URL prefix to the static content directory or subdomain, for the SSL-portion of the site. Does not take a trailing slash.



Parallels $LJ::JSPREFIX. Prefix on (static) JavaScript directory or subdomain, for the SSL-portion of the site. Does not take a trailing slash.



The URL prefix to the static content directory or subdomain. Does not take a trailing slash.



This lets site administrators mark a subdomain as the normal path (foo.$DOMAIN), ignoring the user component of the subdomain. It is useful if you want to serve palimg files elsewhere (like an image caching service, as part of a content delivery network). Some load balancer configuration is also required (see $LJ::PALIMGROOT). The value part of the hash is the subdomain type, such as 'userpics', or 'files' (for serving hook-supplied files).


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



If enabled, the LiveJournal installation will support username URLs of the form http://username.yoursite.com/. Users will also need the “userdomain” cap.


The URL prefix to the userpic directory or subdomain. Defaults to $SITEROOT/userpic. Does not take a trailing slash. See $LJ::SUBDOMAIN_FUNCTION to use something else.



Your static prefix on the same domain as $LJ::DOMAIN_WEB. Does not take a trailing slash. This is needed for JavaScript security, since a script on stat.example.com can't access content on www.example.com.



External and Pluggable Authorization Support


The DN unique identifiers go here. This is a required setting for LDAP (Lightweight Directory Access Protocol) support.



The host URI goes here. It accepts anything that the Net::LDAP constructor takes. This is a required setting for LDAP support.



An optional field containing the username. It defaults to 'uid'.



Support pre-1.0 OpenID™ specs as well as final spec.


Enable OpenID™ consumer support, to accept OpenID™ identities for logging in and commenting. Off by default.


Enable OpenID™ server support.


Speak stateless OpenID™. Slower, but no local state needs to be kept.

Filesystem Related


Hash that contains the details for a number of blob servers. The format of the parameter is 'cluster' => 'directory'. You also need to add a %LJ::USERPROP_DEF key: 'blob_clusterid' => 1,. The webserver user also needs to be able to access the given directory. If you wish to use CAPTCHAs image / audio generation for human checks, then this is a necessary parameter. This is old. MogileFS is the future. You might want to use this option, though, for development, as blobserver in local-filesystem-mode is easy to set up.


    "clusters" => {
        "1" => "\$HOME/var/blobs/",

Boolean to disable all media uploads/modifications that would go to MogileFS. This puts code that interacts with MogileFS into read-only mode: editpics.bml - users can't delete/upload userpics while in this mode, and CAPTCHAs - can't generate new ones or delete old ones while flag on. You might set this if you needed to turn off your MogileFS install, for example.


If you are using MogileFS on your site for userpics (the userpic factory requires MogileFS in order to work) or other purposes, you will need to define this hash and complete the information in it. Please see also $LJ::USERPIC_MOGILEFS. The your_class element allows you to define any special MogileFS classes you need. If you want CAPTCHAs to come from a MogileFS backend, enable $LJ::CAPTCHA_MOGILEFS; you also need a class called 'captcha' in your domain, as in the example.


    domain => 'example.com::lj',  # arbitrary namespace, not DNS domain
    hosts => [ '' ],
    root => '/var/mogdata',
    # timeout => 3,               # optional timeout on MogileFS clients.
    classes => {
    userpics => 3,
    captcha => 2,
    # your_class => 3,

If you have multiple internal networks and would like the MogileFS libraries to pick one network over the other, you can set the preferred IP list. In the example below, the variable is set to say “if we try to connect to, instead try first and then fall back to”.


( =>,

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 set up in the %LJ::BLOBINFO section. This is old. MogileFS is the future. You might want to use this option, though, for development, as blobserver in local-filesystem-mode is easy to set up. See also %LJ::PERLBAL_ROOT.


Uncomment this to put new userpics in MogileFS.

Human Checks


You should also turn this on to enable anonymous comment CAPTCHAs.


The max number of audio CAPTCHAs to make per-process. Should be less than $LJ::CAPTCHA_AUDIO_PREGEN. Useful for farming out generation of $LJ::CAPTCHA_AUDIO_PREGEN to lots of machines. (This value is not ideal, since after each generation, processes should just double-check the number available so this configuration variable can be removed, from the codebase).



The max number of audio CAPTCHAs to pre-generate ahead of time.



The max number of image CAPTCHAs to pre-generate ahead of time.



What image files to use to generate image CAPTCHAs.



In addition to filling out the %LJ::MOGILEFS_CONFIG hash, you need to enable some options if you want to use MogileFS. Turn this on to put CAPTCHAs in MogileFS.


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


        create => 1,
        anonpost => 1,

Maintenance Messages


Customizable DB unavailable message.


Sorry, database temporarily unavailable.
Please see <a href='http://status.example.com/'>…</a> for status updates.

Customizable generic unavailable message.


Sorry, there was a problem.

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. The site is globally marked as 'down' and users get an error message, as defined by $SERVER_DOWN_MESSAGE and $SERVER_DOWN_SUBJECT. See also $LJ::SERVER_TOTALLY_DOWN.


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, this subject/title is displayed on the error message for anyone trying to access the LiveJournal installation.



The site is globally marked as 'down' and users get an error message, as defined by $SERVER_DOWN_MESSAGE and $SERVER_DOWN_SUBJECT. But compared to $SERVER_DOWN, this error message is done incredibly early before any dispatch to different modules. See also $LJ::SERVER_DOWN.

Messaging Related


Base domain for SMS service. Defaults to value of $LJ::DOMAIN. You might use this in message footers you send to users.


Number of your SMS service for users to send to and receive from.



The name of your SMS service. Used on SMS communications and site pages.





Miscellaneous settings


Comma-separated list of directories under htdocs which should be served without parsing their _config.bml files. For example, directories that might be under a lesser-trusted person's control.


If Apache access logging to a database is enabled, in the %LJ::DBINFO hash, this boolean lets you choose whether to log images or just page requests.


The username of the example user account, for use in Support and user-documentation. Must be an actual account on the site.


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" => "\$SITEROOT/support/faqbrowse.bml?faqid=1",
            "linklist_support" => "\$SITEROOT/manage/links.bml",

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



Initial optional friends, listed on create.bml.



Makes initial friends (checkboxes) on create.bml be selected by default.



Array of ISO (639/639_3166) language codes to make available for users to select from. You can edit the array in ljconfig.pl, as in the example, for any extra languages you plan to configure, translate and make available on your site. Also, if the user has not selected a language, it is auto-detected from their browser. See also @LJ::DEFAULT_LANG.


qw(en_YS en_GB de da es it ru ja pt eo nl hu fi sv pl zh lv tr ms);



If you want to change the limit on how many bans a user can make, use this variable. The default is 5000, but it is site-configurable.


If using MogileFS for userpics, and are not using $LJ::REPROXY_DISABLE{userpics}, the server headers will advise they be cached for this value. Value is in seconds. Defaults to 3600 (one hour).



If you are reproxying userpics (on by default, but add this for it to work), and store userpics on a blobserver, set its location here so reproxy headers can be generated to the blobserver. Please see also $LJ::USERPIC_BLOBSERVER and %LJ::REPROXY_DISABLE.


                    'userpics' => '/mnt/xy_blob',

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


("^ex_", "^lj_")

On a larger installation, it is useful to have multiple qbufferd.pl processes, one for each command type. This is not necessary on a small installation.


('weblogscom', 'eg_comnewpost')

Sets the file to which the qbufferd.pl parent process records the process id of the daemon. The presence of the file ensures qbufferd.pl knows if it already has a process started. The value must be a valid path, as the parent has to kill the child process if the parent couldn't create or write to its pid.



If you want to change the amount of time a user stays in the random_user_set table, change this. The random user search feature uses this. The value is in days (default is one week).



If you are using Perlbal to balance your web site, it can use reproxying to distribute the files itself. You can use this option to disable that reproxying on an item-by-item basis. This can be useful for extremely busy sites without persistent connections between Perlbal and mogstored, etc. The hash is a set of file classes that should not be internally redirected to mogstored nodes / a blobserver. Values are true, keys are one of 'userpics', 'captchas', or site-local file types like 'phoneposts' for ljcom. The default is to allow all reproxying.


        userpics => 1,
        captchas => 1,

Support diagnostics can be helpful if you are trying to track down a bug that has been occurring. The user-agent information will be appended to requests that users open through the web interface.


( 'track_useragent' => 1, );

Record in memcached what URL a given host/pid is working on.


If you know that your installation is behind a proxy or other fence that inserts X-Forwarded-For headers that you can trust, enable this. Otherwise, don't! Default is off (for direct connection to the 'net). If behind your own reverse proxies, you should enable this.


Used in conjunction with @LJ::QBUFFERD_ISOLATE, to specify a time to sleep between runs of qbuffered tasks. The default is 15 seconds.



Links to SSL portions of the site should be visible. This makes pages default to their SSL versions. If somebody can't do SSL due to proxies/etc, they can use insecure versions by appending ?ssl=no to the URL.


File name and path the search-updater worker should use for the usersearch data file.





Boolean setting that compresses entry (stored in logtext2) and comment text (stored in talktext2) in the database, to save disk space.


Instruct Perlbal to concatenate static files on non-SSL pages.


Instruct Perlbal to concatenate static files on SSL pages.


Sets length of time in minutes to try fetching external CSS before timing out.



Boolean hash, signifying that separate parts of this LiveJournal installation are working and are available to use. A value of 1 on individual items within the hash indicates 'on' i.e. “please switch on disabling of this feature”.Consult Section 3, “%LJ::DISABLED for more information.


Boolean setting that when enabled, signals to the installation to use gzip encoding, to compress text content sent to browsers, wherever possible. In most cases this is known to cut bandwidth usage in half. Requires the Compress::Zlib perl module. mod_gzip is somewhat buggy in Apache 1.3x; just use Compress::Zlib. See also %LJ::GZIP_OKAY


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 superfluous and taxing on your installation. In the example, 234 and 232252 are userids of popular system communities.


        234 => 1,
        232252 => 1,

Enable this to use Gearman when a set of “Friends” need loading. You will also need to run the corresponding worker.


Enable this to use Gearman to load sysbanned users, instead of Apache. You will also need to run the corresponding worker.


Enable this to use Gearman for loading user tags. This needs to be enabled so the corresponding worker operates, otherwise it falls back to loading in-process among the web processes.


Threshold (in bytes) under which compiled S2 layers are cached in memcached. If you have a lot of free memcached memory and a loaded database server with lots of queries to the s2compiled table, turn this up.



If defined, list of clusters that qbufferd should use when retrieving and processing outstanding jobs. Defaults to value of @LJ::CLUSTERS. You might set this if you removed a cluster you wanted to retire from @LJ::CLUSTERS so it receives no new qbufferd jobs, but still needed to get qbufferd to process remaining jobs.


The logtagsrecent table holds mapping on a set quantity of the most recent tags applied to an entry. This variable sets that quantity.





Large processes should voluntarily kill themselves at the end of requests.


This is used by $LJ::SUICIDE, with Apache::DebateSuicide, the underlying cleanup handler, to decide whether a large process should voluntarily kill itself at the end of the request. It lets the site administrator set a global and/or per-server maximum memory cap on the sum of all of mod_perl children. If a processes memory is over the configured size (in KB), then the process will exit.



See also %LJ::SUICIDE_OVER. If a processes memory is under the configured size (in KB), then the process will exit.



Syndicated accounts tend to have more database traffic than normal accounts, so it is a good idea to set up a separate cluster for them. If set to a cluster (defined by @LJ::CLUSTERS), all newly created accounts will reside on that cluster. If undefined, syndicated accounts are assigned to user clusters (partitions) in the normal way.


Maximum external feed size a syndicated account may pull in (in KB). Defaults to 300. Can be overridden for individual syndicated accounts by giving them the siteadmin:largefeedsize priv.



Maximum number of comments to display on Recent Comments page /tools/recent_comments.bml.



Policy Options


Collect birthdays to mark users as underage (under 13). To make this work, you first need to create a new capability class for underage users. Then, set $LJ::UNDERAGE_BIT to be the bit number for the cap class to put underage users in. Off by default.


Set this option true if you are running an installation using ljcom code and if you haven't installed the Crypt::Cracklib perl module. When enabled, the installation will not do strong password checks. Users can use any old dumb password they like.


Require users to agree to the TOS. The array items, respectively, allow you to: Set required version to enable tos version requirement mechanism, and change the messages displayed to users. The configurable title/html/text group values displayed are defaults, and are used if no 'domain'-specific values are defined in the rest of the array. The remaining items refer to: text/HTML to use when message displayed for a login action, an update action, posting a comment (this will just use the defaults above), protocol actions, and last, support requests. The revision must be found in the first line of your $LJHOME/htdocs/inc/legal-tos include file.

<!-- $Revision$ -->


            rev   => '1.0',

            title => 'Configurable Title for TOS agreement requirement notice',
            html  => 'Configurable HTML for TOS requirement',
            text  => 'Configurable text error message for TOS requirement',

            login => {
            html => 'Before logging in, you must update your TOS agreement',

            update => {
            html => 'HTML to use in update.bml',

            comment => {

            protocol => {
            text => 'Please visit $LJ::SITEROOT/legal/tos.bml to update your TOS agreement',

            support => {
            html => 'Text to use when viewing a support request',


If set, the account creation dialog shows a checkbox, asking users if they agree to the site Terms of Service, and will not allow them to create an account if they refuse. This depends on a few files being located in the proper directories, namely tos.bml and tos-mini.bml under $LJHOME/htdocs/legal. The account creation dialog can also check for new instances of the Terms of Service if the Terms of Service text is located in an SVN managed include file ($LJHOME/htdocs/inc/legal-tos), and if the include file includes the following line at the top:

<!-- $Revision$ -->

Used in conjunction with $LJ::COPPA_CHECK.


Error message to show underage users.


Sorry, your account needs to be <a href='$SITEROOT/agecheck/'>age verified</>
before you can leave any comments.;

A boolean setting that makes joining the site require an “invite code” before being able to create a new account. Not all features are implemented in the livejournal-only tree. LiveJournal.com used this for a period until late 2003. Note that this code might've bitrotted, so perhaps it should be kept off.

Portal Configuration


The default portal boxes ('portlets') a user will see.



A list of boxes that do not appear to users, by default.



The default sizes and positions of the boxes.


            'Birthdays' => {
                    'added' => 1,
                    'sort'  => 4,
                    'col'   => 'R',
            'FriendsPage' => {
                    'added' => 1,
                    'sort'  => 6,
                    'col'   => 'L',
            'FAQ' => {
                    'added' => 1,
                    'sort'  => 8,
                    'col'   => 'R',
            'Friends' => {
                    'added' => 1,
                    'sort'  => 10,
                    'col'   => 'R',
            'Manage' => {
                    'added' => 1,
                    'sort'  => 12,
                    'col'   => 'L',
            'PopWithFriends' => {
                    'added' => 0,
                    'col'   => 'R',
            'RecentComments' => {
                    'added' => 1,
                    'sort'  => 10,
                    'col'   => 'L',
            'UpdateJournal' => {
                    'added' => 1,
                    'sort'  => 4,
                    'col'   => 'L',
            'NewUser' => {
                    'added' => 1,
                    'sort'  => 2,
                    'col'   => 'L',
            'TextMessage' => {
                    'added'  => 1,
                    'sort'   => 12,
                    'col'    => 'R',
            'Note' => {
                    'notunique'  => 1,
            'Reader' => {
                    'notunique'  => 1,

Styling Related


A hash that defines the default S2 layers to use for accounts. Keys are layer types, values are the S2 redist_uniqs.


            'core' => 'core1',
            'i18nc' => 'i18nc/en1',
            'layout' => 'generator/layout',
            'theme' => 'generator/nautical',
            'i18n' => 'generator/en',


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

During the upgrade populator, do not touch styles. That is, consider the local styles the definitive ones, and any differences between the database and the distribution files should mean that the distribution is old, not the database.


Sets how far back somebody can go on a user's Friends page, including their own. The default value is two weeks. That is, entries posted more than two weeks ago will not appear on anybody's Friends page, even if they are the most recent entries in that user's journal. See also $LJ::MAX_SCROLLBACK_FRIENDS.



Sets how far back somebody can go on a user's Friends page. That is, how far you can skip back with the ?skip= URL argument. A higher value can significantly affect the speed of the installation.



The recent items (lastn view)'s max scrollback depth. That is, how far you can skip back with the ?skip= URL argument. Defaults to 100. After that, the 'previous' links go to day views, which are stable URLs. ?skip= URLs aren't stable, and there are inefficiencies making this value too large, so you're advised to not go too far above the default of 100.






In the example, the default S2 bare style (usually it is 'core', but it is site-configurable) is used. You can add more layers and styles, which must be public styles. Used with %LJ::MINIMAL_USERAGENT.


    'core' => 'core1',

Some people on portable devices may have troubles viewing the nice site scheme you've setup, so you can specify that some user-agent prefixes should instead use fallback presentation information. In the example below, the fallback enables if the user-agent field starts with “Foo”. Note you can only put text here; no numbers, spaces, or symbols. The “w” in the defaults refers to w3m.


    'Foo' => 1,


    'Links' => 1,
    'Lynx' => 1,
    'w' => 1,
    'BlackBerry' => 1,
    'WebTV' => 1,

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


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

When set to an appropriate LASTN style, all syndicated accounts on this installation will use this style.


Enable the navigation strip onsite. This gives users quick access to common site features from a toolbar at the top of journal Recent Entries and Friends pages, when the journal style supports it.

System Tools


Path to festival (available in the Debian package “festival”). Needed for audio CAPTCHAs.


Path to sox (available in the Debian package “sox”). Needed for audio CAPTCHAs.


Host/IP with port number to outgoing DMTP server. Takes precedence over $LJ::SMTP_SERVER. Note: the DMTP (Danga Mail Transfer Protocol) protocol and server is a dumb hack. If you have a good outgoing SMTP server, use that instead.


Use verbose output during maintenance tasks, like parsing for syndicated feed accounts. Values are one of 0=quiet, 1=normal, 2=verbose. If you only run maintenance tasks using cron, modify your crontabs accordingly if you enable this. For example, if you re-direct standard output to /dev/null (using >/dev/null), change that part of the cron job line to direct the verbose output to a file, or remove the redirect so cron falls back to the default, where cron jobs generate an e-mail to the user executing the command.



A directory to use for lock files if you're not using ddlockd for locking. Using ddlockd, the default lockdir is $LJHOME/locks.



Turn on statistics generation that shows memory/cpu usage deltas of the Apache child for each request, for database logs. It requires that the GTop module be installed.


Host/IP to outgoing SMTP server. Takes precedence over $LJ::SENDMAIL. This the recommended system to use for sending e-mail.


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


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