1. $LJHOME Environment Variable

Be aware that nearly all LiveJournal code depends on the $LJHOME environment variable being set to the top-level directory that LiveJournal is installed at.

Chapter 11, Apache has the necessary directives to make sure the web code always has $LJHOME set, but if you are running LJ maintenance commands from a terminal, you must make sure $LJHOME is set for yourself.

For example, we'll assume you are installing LiveJournal on an operating system using the Bourne/BASH shell: The easiest way to set $LJHOME is to put the following line in your ~/.profile. On some systems you should instead put it in ~/.bash_profile or ~/.bashrc:

LJHOME=/home/lj; export LJHOME

It is also a good idea to add an entry for LiveJournal into your path, into the same file:

export PATH="$PATH:$LJHOME/bin"

To test that it's set:

$ source ~/.bash_profile
$ echo $LJHOME

If the above was successful, it should print out /home/lj (or whatever the value of $LJHOME may be).

Other shells

If you use another shell interface, you might be able to see what it reads on start-up by looking for the file: ~/.profile. Please refer to the documentation provided with your shell, which can usually be found by typing:

$ help