This commit is contained in:
2019-02-06 00:49:12 +03:00
commit 8dbb1bb605
4796 changed files with 506072 additions and 0 deletions

View File

@@ -0,0 +1,117 @@
<chapter id="lj.install.apache_setup">
<title>Apache</title>
<abstract>
<simpara>Apache is the most popular HTTP server software used today, and it's completely free.
We use Apache for our projects because there is simply no equivalent. In this chapter we'll
briefly explain how to setup and configure an Apache installation.</simpara>
</abstract>
<section id="lj.install.apache_setup.install">
<title>Installation</title>
<section id="lj.install.apache_setup.install.mod_perl">
<title>mod_perl</title>
<para>
LiveJournal in the past has been server API agnostic, working on
either FastCGI or mod_perl, but we've dropped FastCGI support, as
there's really no need to maintain it anymore. LiveJournal now solely
requires mod_perl; seeing as how it's everywhere and well supported,
and you might already have it on your machine. If not, you can read up
on the official installation docs located at
<ulink url="http://perl.apache.org/docs/1.0/guide/install.html" />
</para>
<caution><para>
We've found that more people have success when mod_perl is statically
linked, rather than using a <abbrev>DSO</abbrev>.
<footnote><simpara>
Consult <citetitle pubwork="article">
<ulink url="http://perl.apache.org/docs/1.0/guide/install.html#When_DSO_can_be_Used">
mod_perl Installation User Guide: When <abbrev>DSO</abbrev> Can Be Used</ulink></citetitle>
for more information.
</simpara></footnote>
</para></caution>
<tip><title>Debian</title>
<simpara>Typically, if you already have a working apache installation in Debian
and would like to install mod_perl support, then installing the package
<filename>libapache-mod-perl</filename> should suit your needs. Otherwise,
you should install the package <filename>apache-perl</filename>.
</simpara></tip>
</section>
<section id="lj.install.apache_setup.install.suexec">
<title>Apache suEXEC Support</title>
<para>
If you want the LiveJournal code to run as a user other than
what your webserver runs as, then you'll need suEXEC<footnote id="suEXEC">
<simpara><ulink url="http://httpd.apache.org/docs/suexec.html">Official
Apache suEXEC documentation</ulink></simpara></footnote> support in
Apache. You're free to figure that out yourself. We'll assume
your webserver is running as user <systemitem class="username">lj</systemitem>,
though it doesn't have to run as any certain user to work.
</para>
<para>
In fact, the LiveJournal code never writes to disk, so as long
as it can write to the database (which is essential, obviously),
you can run the code as any user, including
<systemitem class="username">nobody</systemitem> or
<systemitem class="username">www-data</systemitem>, both
of which are common in out-of-the-box configurations.
</para>
</section>
<section id="lj.install.apache_setup.install.vhosts">
<title>Virtual Hosts</title>
<para>
You can run the LiveJournal code inside or outside of a
<literal>&lt;VirtualHost&gt;</literal> section in Apache's
<literal>httpd.conf</literal> file. However, make note that you
can't (yet) have two VirtualHosts running parallel copies of the
code. In the future we'll fix that, but for now if you really
need two installations on the same machine, you'll need to run
two sets of Apache processes, listening on different ports.
</para>
</section>
</section>
<section id="lj.install.apache_setup.example">
<title>Example <literal>httpd.conf</literal></title>
<programlisting><![CDATA[ServerType standalone
ServerRoot "/etc/apache-perl"
PidFile /var/run/apache-perl.pid
ScoreBoardFile /var/run/apache-perl.scoreboard
Timeout 30
KeepAlive Off
MinSpareServers 5
MaxSpareServers 40
StartServers 10
MaxClients 20
MaxRequestsPerChild 500
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
Port 80
User lj
Group lj
SendBufferSize 131072
ServerName www.livejournal.com
PerlSetEnv LJHOME /home/lj
PerlRequire /home/lj/cgi-bin/modperl.pl
]]></programlisting>
<note>
<para>
This will work by itself (assuming mod_perl statically linked),
or you can just tack on parts to your existing config.
</para>
<para><filename>/home/lj</filename> is only an example directory. You'll want to use the same directory used in <xref linkend="lj.install.ljhome" />.</para>
<para>
If you'd like, you can put those last three lines in a VirtualHost block.
</para>
</note>
</section>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->

View File

@@ -0,0 +1,52 @@
<chapter id="lj.install.finishing">
<title>Finishing Up</title>
<para>
You should now just about have a working LiveJournal installation.
There are many things you can still do, but all are outside the scope of this document.
</para>
<formalpara>
<title>Configuration check</title>
<para>
To check that everything is setup okay, you should run the provided configuration checking tool,
located at <filename><envar>$LJHOME</envar>/bin/checkconfig.pl</filename>. <filename>checkconfig.pl</filename>
will check for missing perl modules, attempt to connect to your database, and do other checks to ensure everything will work smoothly.
</para>
</formalpara>
<formalpara>
<title>Start things up</title>
<para>If you haven't restarted Apache, you'll want to do that now:</para>
<screen><prompt>#</prompt> <userinput>apachectl stop</userinput>
<prompt>#</prompt> <userinput>apachectl start</userinput></screen>
<para>Note that doing a "graceful" or "restart" is not guaranteed to work. The LiveJournal code
doesn't implement any mod_perl restart handlers, and weird things have been reported to happen
using <userinput>apachectl restart</userinput>.
</para>
</formalpara>
<formalpara>
<title>The system user</title>
<para>
To administrate your site properly, you will need to create the system user that'll have
privileges to give privileges to other users:
</para>
<screen><prompt>$</prompt> <userinput>$LJHOME/bin/upgrading/make_system.pl</userinput></screen>
<para>It'll prompt you for the password to use for the system account and then sets it all up.</para>
<para>You now have the ability to login to your LJ site as user <quote>system</quote> with the password
you set and then grant priviledges from the admin section to other users:
</para>
<para>http://your-lj-server/admin/priv/</para>
</formalpara>
<para>
If you have any questions, join the <ulink url="http://www.livejournal.com/users/lj_everywhere/info">"lj_everywhere"</ulink>
community on LiveJournal.com and post your questions. We'd love to help you out.
</para>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->

View File

@@ -0,0 +1,128 @@
<chapter id="lj.install.general_setup">
<title>General Setup</title>
<!-- A departure from the name scheme, but its an easier reference -->
<section id="lj.install.ljhome">
<title>$LJHOME Environment Variable</title>
<para>
Be aware that nearly all LiveJournal code depends on the <envar>$LJHOME</envar>
environment variable being set to the top-level directory that LiveJournal is installed at.
</para>
<para>
<xref linkend="lj.install.apache_setup" /> has the necessary directives to make
sure the web code always has $LJHOME set, but if you're running LJ maintenance
commands from a terminal, you'll need to make sure <envar>$LJHOME</envar> is set
for yourself.
</para>
<para>
For example, we'll assume that you've installed LiveJournal on an operating system
using the Bourne Shell: The easiest way to set <envar>$LJHOME</envar> is to put
the following in your <filename>~/.bash_profile</filename>:
</para>
<informalexample>
<screen><literal>LJHOME=/home/lj; export LJHOME</literal></screen>
<para>
To test that it's set:
</para>
<screen><prompt>$</prompt> <userinput>. ~/.bash_profile</userinput>
<prompt>$</prompt> <userinput>echo $LJHOME</userinput></screen>
<para>
If the above was successful, it should print out <literal>/home/lj</literal>
(or whatever the value of <envar>$LJHOME</envar> may be).
</para>
</informalexample>
<note>
<title>Other shells</title>
<para>
If you use another shell interface, you might be able to see what it reads on
start-up by looking for the file: <filename>~/.profile</filename>. Please
refer to the documentation provided with your shell, which can usually be
found by typing:
</para>
<screen><prompt>$</prompt> <userinput>help</userinput></screen>
</note>
</section>
<section id="lj.install.install_files">
<title>Installing the files</title>
<para>
The typical directory to install LiveJournal is
<filename>/home/lj</filename>, but it is not a requirement at
all. To ease documentation, we'll assume that you'll want to
install in that directory. We'll also assume you'll be using
user <literal>lj</literal>, but that also doesn't matter at all.
Feel free to install wherever and as whoever &hellip; there shouldn't
be any problems.
</para>
<formalpara>
<title>Prerequisite: <envar>$LJHOME</envar></title>
<para>
Before you install using either method, you should create the directory
where your LiveJournal installation will reside. This needs to be the same
directory that the environment variable <envar>$LJHOME</envar> is set to,
otherwise your installation will not work properly. Consult
<xref linkend="lj.install.ljhome" /> for more information on setting <envar>$LJHOME</envar>.
</para>
<example><title>Creating the <envar>$LJHOME</envar> directory:</title>
<screen><prompt>#</prompt> <userinput>mkdir <replaceable>/home/lj</replaceable></userinput>
<prompt>#</prompt> <userinput>chown <replaceable>lj.lj /home/lj</replaceable></userinput></screen>
</example>
</formalpara>
<note>
<title>Using Tarballs</title>
<para>
LiveJournal maintains the server code in <filename>tar.gz</filename> (<quote>tarball</quote>)
format, which can be downloaded from: <ulink url="http://www.livejournal.org/download/code/" />.
The tarballs are labelled by date, so be sure to grab the latest one.
</para>
<para>
Untar the tarball from the <envar>$LJHOME</envar> directory, and then run the provided
installation script, <filename>bootstrap.pl</filename>.
</para>
<example><title>Tarball Install:</title><para>
<screen><prompt>$</prompt> <userinput>cd $LJHOME</userinput>
<prompt>$</prompt> <userinput>tar zxvf LiveJournal-<replaceable>YYYYMMDDNN</replaceable>.tar.gz</userinput>
<prompt>$</prompt> <userinput>./bootstrap.pl</userinput></screen>
</para></example>
</note>
<note>
<title>Using <abbrev>CVS</abbrev></title>
<para>
Bleeding edge releases of the code can be found in <abbrev>CVS</abbrev> at the <abbrev>CVS</abbrev>
server: <ulink url="http://cvs.livejournal.org/">cvs.livejournal.org</ulink>.
</para>
<warning>
Installing and updating LiveJournal from <abbrev>CVS</abbrev> is not guaranteed as stable as tarball releases.
If you need a more stable release, you're better off using the packaged tarballs as mentioned above.
</warning>
<example><title>CVS Install:</title><para>
<screen><prompt>$</prompt> <userinput>mkdir $LJHOME/cvs</userinput>
<prompt>$</prompt> <userinput>cd $LJHOME/cvs</userinput>
<prompt>$</prompt> <userinput>cvs -z3 -d:pserver:anonymous@cvs.livejournal.org:/home/cvslj co livejournal</userinput>
<prompt>$</prompt> <userinput>cvs -z3 -d:pserver:anonymous@danga.com:/home/cvspub co wcmtools bml</userinput>
<prompt>$</prompt> <userinput>wcmtools/bin/multicvs.pl --conf=livejournal/cvs/multicvs.conf --init</userinput></screen>
</para></example>
<para>
That last command will copy everything from the CVS directory
over to <literal>$LJHOME</literal>, the live area.
</para>
<para>
Having two copies of the code laying around may not make sense
now, but it will later when we write the docs to explain how
to run a heavily-customized version of the site and still stay
up-to-date with the mainstream CVS. (FIXME: write/link that section)
</para>
</note>
</section>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->

View File

@@ -0,0 +1,35 @@
<part id="lj.install.index">
<title>LiveJournal Installation</title>
<partintro>
<para>
The following chapters cover the basics of installing LiveJournal, and is geared towards LiveJournal being
installed on any operating system that resembles unix. Throughout this part we'll include installation tips
for users of <ulink url="http://www.debian.org/">Debian GNU/Linux</ulink>, because this is our operating system
of choice.
</para>
<para>
We do assume that you are familiar, at least somewhat, with the technologies covered in this manual, because
although it's certainly not necessary to be an expert to install LiveJournal, it helps to know the concepts
and tasks involved in this kind of undertaking.
</para>
<para>
If you have any questions, or encounter any problems not easily remedied, feel free to join the
<quote><ulink url="http://www.livejournal.com/userinfo.bml?user=lj_everywhere">LiveJournal Everywhere!</ulink></quote>
Community.
</para>
</partintro>
&lj.install.reqs;
&lj.install.perl_setup;
&lj.install.general_setup;
&lj.install.apache_setup;
&lj.install.ljconfig;
&lj.install.mysql_setup;
&lj.install.schedule_tasks;
&lj.install.finishing;
</part>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("../index.xml" "book" "part")
End:
-->

View File

@@ -0,0 +1,68 @@
<section id="lj.install.ljconfig.caps">
<title>Setting Capabilities</title>
<para>
Capabilities are used to define limits that are imposed on user accounts.
For more information, please read <xref linkend="lj.admin.caps"/>.
</para>
<note>
<para>Consult <xref linkend="lj.admin.caps.list" /> for reference when defining capabilities.</para>
</note>
<para>
No matter what your setup is, <literal>%LJ::CAP_DEF</literal> should <emphasis role="bold">always</emphasis> be defined,
set with sane limits per capability.
</para>
<example>
<title>Sample <literal>%LJ::CAP_DEF</literal></title>
<para>
<programlisting><![CDATA[
%CAP_DEF = (
'maxfriends' => 5,
'userpics' => 1,
'checkfriends_interval' => 60,
'checkfriends' => 1,
'styles' => 0,
'todomax' => 25,
'todosec' => 0,
'friendsviewupdate' => 30,
'findsim' => 1,
);]]>
</programlisting>
</para>
</example>
<formalpara><title>Classes</title><para>
Classes are defined as hashes under the single hash <literal>%LJ::CAP</literal>.
The keys of <literal>%LJ::CAP</literal> are the 16 different bits (<literal>0-15</literal>). The keys of those hashrefs are the capability names, and
the values are the capability settings.
</para></formalpara>
<example>
<title>Sample <literal>%LJ::CAP</literal></title>
<para>
<programlisting><![CDATA[
%CAP = (
'0' => { # 0x01
'_name' => 'new user',
'userpics' => 1,
},
'1' => { # 0x02
'_name' => 'free user',
'userpics' => 3,
},
'2' => { # 0x04
'_name' => 'paid user',
'styles' => 1,
'makepoll' => 1,
'userpics' => 10,
'paid' => 1,
'useremail' => 1,
'textmessaging' => 1,
},
'3' => { # 0x08
'_name' => 'permanent account',
'paid' => 1,
'useremail' => 1,
},
);]]>
</programlisting>
</para>
</example>
</section>

View File

@@ -0,0 +1,46 @@
<section id="lj.install.ljconfig.dbinfo">
<sectioninfo>
<title>Configuring <literal>%LJ::DBINFO</literal></title>
</sectioninfo>
<title>Configuring <literal>%LJ::DBINFO</literal></title>
<para>
<literal role="variable">%LJ::DBINFO</literal> is a hash that contains the necessary information for LiveJournal to connect to your database.
For installations that require more than one database server, the directives to define each cluster database are also defined here.
</para>
<formalpara><title>Connection keys</title><para>
<literal role="variable">%LJ::DBINFO</literal> requires a master key that is labelled 'master', and also requires the correct address for connection to the database itself.
If you're using a <abbrev>TCP</abbrev> based connection, you can specify a host key with the value of the location of the server, and a port key for the database port (typically 3306).
If instead you're using a socket based connection, you can specify a sock key with the value set to the socket file.
Specify a user key for your database username, and a password key for your database password.
If you used a different database name than the suggested <quote>livejournal</quote>, you can specify a dbname key with the value of the database name.
</para></formalpara>
<formalpara><title>Roles</title><para>
The role key in <literal role="variable">%LJ::DBINFO</literal> is a hash that sets different <quote>role</quote> keys to the current configuration with boolean values.
Roles are basically tasks assigned to the configuration. For example, to set up a server that will host your directory (which can get pretty intensive with a fair amount of users), you would do the following:
<programlisting><![CDATA['role' => {
'directory' => 1,
},]]>
</programlisting>
</para></formalpara>
<example>
<title>Sample <literal role="variable">%LJ::DBINFO</literal> hash</title>
<programlisting><![CDATA[%DBINFO = (
# master must be named 'master'
'master' => {
'host' => "localhost",
'port' => 3306,
# or, leave out host/port and use a socket to connect:
#'sock' => "/var/run/mysqld.sock";
# optional dbname, if not "livejournal":
#'dbname' => 'livejournal',
'user' => 'lj',
'pass' => 'ljpass',
'role' => {
'cluster1' => 1,
}, },
);]]></programlisting>
</example>
<para>
That's the basic configuration for an installation with only one database server. (FIXME: add link to new section on configuring a site with many database servers)
</para>
</section>

View File

@@ -0,0 +1,51 @@
<section id="lj.install.ljconfig.disabled">
<title><varname>%LJ::DISABLED</varname></title>
<para><varname>%LJ::DISABLED</varname> is a hash that defines parts of the installation that
are CPU or database intensive as <quote>active</quote> or <quote>inactive</quote>.
This following list briefly explains each option.</para>
<variablelist>
<title>Optional Features</title>
<varlistentry>
<term>interests-findsim</term>
<listitem><simpara>The <quote>Find Users by Similar Interests</quote> feature.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>directory</term>
<listitem><simpara>The user directory, which houses some of the largest and slowest database queries.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>stats-recentupdates</term>
<listitem><simpara>Logs the most recent updates to the stats page.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>stats-newjournals</term>
<listitem><simpara>Logs the most recently created journals to the stats page.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>show-talkleft</term>
<listitem><simpara>Show the received and posted comment counts for each account on the <filename>userinfo.bml</filename> page.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>memories</term>
<listitem><simpara>Show the <quote>Add to Memories</quote> button on comment pages.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>topicdir</term>
<listitem><simpara>The topic directory, which hasn't yet been rewritten to support clustered installations.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>tellafriend</term>
<listitem><simpara>Show the <quote>Tell a Friend</quote> button on comment pages.</simpara></listitem>
</varlistentry>
<varlistentry>
<term>clientversionlog</term>
<listitem><simpara>Show the client usage statistics on the <filename>stats.bml</filename> page.</simpara></listitem>
</varlistentry>
</variablelist>
</section>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("ljconfig.xml" "chapter" "section")
End:
-->

View File

@@ -0,0 +1,45 @@
<section id="lj.install.ljconfig.helpurls">
<title><varname>%LJ::HELPURLS</varname></title>
<para>
<varname>%LJ::HELPURLS</varname> is a hash that defines <abbrev>URL</abbrev>s to
supplemental documentation regarding a specific feature or widget in the LiveJournal interface.
The following list describes the suggested content of each URL.
</para>
<variablelist>
<title>Help URL Keys &amp; Values</title>
<varlistentry>
<term>security</term>
<listitem><simpara>Explains the different security settings available for posts</simpara></listitem>
</varlistentry>
<varlistentry>
<term>noautoformat</term>
<listitem><simpara>Explains how the <quote>Don't automatically format</quote> option works</simpara></listitem>
</varlistentry>
<varlistentry>
<term>userpics</term>
<listitem><simpara>Explains the differing amount of userpics available to each capability class</simpara></listitem>
</varlistentry>
<varlistentry>
<term>iplogging</term>
<listitem><simpara>Explains what the <quote>IP Logging</quote> feature is, and what it is useful for</simpara></listitem>
</varlistentry>
<varlistentry>
<term>s2propoff</term>
<listitem><simpara>Explains why certain <acronym>S2</acronym> settings might not be available to certain capability classes</simpara></listitem>
</varlistentry>
<varlistentry>
<term>userpic_inactive</term>
<listitem><simpara>Explains why a userpic may be inactive for, and how to make the userpic active again</simpara></listitem>
</varlistentry>
<varlistentry>
<term>textmessaging_about</term>
<listitem><simpara>Explains what the text messaging feature is and how it works</simpara></listitem>
</varlistentry>
</variablelist>
</section>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("ljconfig.xml" "section")
End:
-->

View File

@@ -0,0 +1,11 @@
<section id="lj.install.ljconfig.vars">
<title><literal>$LJ::</literal> Variables</title>
<para>
Each <literal>$LJ::</literal> 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.
</para>
&lj.install.ljconfig.vars.gen;
</section>

View File

@@ -0,0 +1,34 @@
<chapter id="lj.install.ljconfig">
<chapterinfo>
<title>Configuring ljconfig.pl</title>
</chapterinfo>
<title>Configuring ljconfig.pl</title>
<para>
You need to make a LiveJournal configuration file. There's an
example <literal>ljconfig.pl</literal> in the doc directory by the
name of "<filename>ljconfig.pl.txt</filename>". You need to copy
this file to <filename>cgi-bin/ljconfig.pl</filename> and then
edit it to suit your needs.
</para>
<para>
<screen>
<prompt>$</prompt> <userinput>cd <replaceable>/home/lj</replaceable></userinput>
<prompt>$</prompt> <userinput>cp doc/ljconfig.pl.txt cgi-bin/ljconfig.pl</userinput></screen>
</para>
<para>
The reason it's not there already is so that future upgrades don't
destroy your configuration. The end of
<filename>ljconfig.pl</filename> reads in
<filename>ljdefaults.pl</filename> so that if we add new options,
<filename>ljdefaults.pl</filename> will be updated and will set
sane defaults. After an upgrade you want to glance at
<filename>ljdefaults.pl</filename> (or the original
<filename>doc/ljconfig.pl.txt</filename>) and see if there are any
new options you feel like setting.
</para>
&lj.install.ljconfig.vars;
&lj.install.ljconfig.helpurls;
&lj.install.ljconfig.disabled;
&lj.install.ljconfig.dbinfo;
&lj.install.ljconfig.caps;
</chapter>

View File

@@ -0,0 +1,72 @@
<chapter id="lj.install.mysql_setup">
<title>MySQL</title>
<abstract><para>
There are a few simple reasons why we chose MySQL when picking a database backend for LiveJournal:
It's <ulink url="http://www.mysql.com/information/benchmarks-old.html">fast</ulink>,
<ulink url="http://www.mysql.com/doc/en/Using_the_MySQL_software_for_free_under_GPL.html">free</ulink>,
<ulink url="http://www.mysql.com/doc/en/Stability.html">stable</ulink>,
<ulink url="http://www.mysql.com/doc/en/Privilege_system.html">secure</ulink>, and well supported
by a large community of users. In this chapter we'll deal with installing and setting up MySQL on
your server, then we'll show you how to populate your installation with the required base data.
</para></abstract>
<section id="lj.install.mysql_setup.install">
<title>Install MySQL</title>
<para>
LiveJournal requires a MySQL install of at least version 3.23.x,
but highly recommends installing the latest stable release that is
available, expecially if you're going to need clustering and
replication abilities.
</para>
<para>
MySQL offers binaries for many operating aystems, including Win32
and several different <quote>flavors</quote> of Unix.
Installations on any of these systems should be fairly easy, as
most offer a simple installation program that guides you through
setup.
</para>
<tip><title>Debian</title>
<simpara>The MySQL server package for Debian is <filename>mysql-server</filename>.</simpara>
</tip>
</section>
<section id="lj.install.mysql_setup.create_db">
<title>Create the LiveJournal Database</title>
<para>
Login to MySQL as the root MySQL user and create the database that
will hold the LiveJournal data:
</para>
<screen><prompt>$</prompt> <userinput>mysql -uroot -p</userinput>
<prompt>mysql></prompt> <userinput>CREATE DATABASE livejournal;</userinput>
<prompt>mysql></prompt> <userinput>GRANT ALL PRIVILEGES ON livejournal.* TO </userinput>
<prompt> ></prompt> <userinput>lj@'localhost' IDENTIFIED BY 'ljpass';</userinput></screen>
<para>
If you know what you're doing, you can set this up however you
like. You tell LiveJournal how to connect to its database server(s)
in your <filename>ljconfig.pl</filename>, as
detailed in: <xref linkend="lj.install.ljconfig.dbinfo" />.
</para>
</section>
<section id="lj.install.mysql_setup.pop_db">
<title>Populate the Database</title>
<para>
In order to use your site, you're going to need to populate your MySQL
database with the required information to get the service started.
</para>
<screen><prompt>$</prompt> <userinput>cd <envar><link linkend='lj.install.ljhome'>$LJHOME</link></envar></userinput>
<prompt>$</prompt> <userinput>bin/upgrading/update-db.pl --runsql --populate</userinput>
<prompt>$</prompt> <userinput>bin/upgrading/texttool.pl load</userinput></screen>
<para>
That'll bring your database schema up-to-date and populate it with any
look-up data it needs.
</para>
</section>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->

View File

@@ -0,0 +1,77 @@
<chapter id="lj.install.perl_setup">
<title>Perl</title>
<abstract>
<simpara>The Perl motto is <quote>There is more than one way to do it</quote> and the three principles for any
programmer are Laziness, Impatience, &amp; Hubris, according to the Perl manual. On top of that, Perl is
well suited for any purpose, and. Why not use Perl? Anyways, in this chapter we'll briefly cover a Perl installation,
and then we'll show you which Perl modules are required for a working LiveJournal installation.</simpara>
</abstract>
<section id="lj.install.perl_setup.install">
<title>Installing Perl</title>
<para>
Perl offers distributions for many operating systems, including Win32 and
almost all of the different <quote>flavors</quote> of Unix. Installations
on any of these systems should be fairly easy, as most offer a simple
installation program that guides you through setup.
</para>
<para>
The complete Perl documentation is included with every Perl install, so if
you have any Perl specific questions, you might want to refer to the
specific documentation first. As quoted from the Perl FAQs: <quote>The
complete Perl documentation is available with the Perl distribution. If you
have Perl installed locally, you probably have the documentation installed
as well: type man perl if you're on a system resembling Unix. This will lead
you to other important man pages, including how to set your $MANPATH. If you're
not on a Unix system, access to the documentation will be different; for
example, it might be only in HTML format. But all proper Perl installations
have fully-accessible documentation.</quote>
<footnote><para>
Consult <citetitle pubwork="article"><ulink url="http://www.perldoc.com/perl5.6/pod/perlfaq2.html">
Obtaining and Learning about Perl (perlfaq2)</ulink></citetitle>
</para></footnote>
</para>
<tip><title>Debian</title>
<simpara>If you're using Debian, Perl should already be installed. If not, the required package is
simply <filename>perl</filename></simpara>
</tip>
</section>
<section id="lj.install.perl_setup.modules">
<title>Installing Perl Modules</title>
<para>
LiveJournal requires several Perl modules to be installed. Installing these
modules requires a fully working perl and C development environment
(including a C compiler and make tool).
</para>
<note><para>
Some modules such as GD and Compress::Zlib require certain C libraries to be pre-installed
on your machine in order to work. Please read the author-provided README files for each
module before proceeding further.
</para></note>
&lj.install.perl.module.list;
<warning>
<para>
There used to be a few custom <filename>LJ::</filename> modules that
needed installing. Those no longer need to be installed on the system,
as LJ uses them right out of <filename>/cgi-bin/*</filename> instead.
If by chance you have those old LJ modules installed, it's best to go
remove them since Perl will prefer system-level ones over the (newer)
local ones.
</para>
</warning>
<important><para>
To ensure that you have installed the necessary modules, be sure to
run the included tool: <filename><envar>$LJHOME</envar>/bin/checkconfig.pl</filename>.
If <application>checkconfig.pl</application> doesn't detect all of the
required modules, it will tell you which ones you are missing. Note that this tool will
fail after checking for modules, because it will also check for a database connection, which
hasn't been set up yet. This will be fixed later when we add options to
<application>checkconfig.pl</application> to detect for specific sections of installation.
</para></important>
</section>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->

View File

@@ -0,0 +1,46 @@
<chapter id="lj.install.reqs">
<title>Requirements</title>
<formalpara><title>Software</title><para>
The main software components you need for a working LiveJournal installation
are as follows (the recommended version is noted):
<variablelist>
<varlistentry>
<term>Perl</term>
<listitem><simpara>Version 5.6.1</simpara></listitem>
</varlistentry>
<varlistentry>
<term>MySQL</term>
<listitem><simpara>Version 3.23.57</simpara></listitem>
</varlistentry>
<varlistentry>
<term>Apache</term>
<listitem><simpara>Version 1.3.28</simpara></listitem>
</varlistentry>
<varlistentry>
<term>mod_perl</term>
<listitem><simpara>Version 1.28</simpara></listitem>
</varlistentry>
</variablelist>
</para></formalpara>
<warning><title>Apache 2 &amp; mod_perl 2</title>
<simpara>At this time, LiveJournal has not been ported to &amp; will not work with Apache 2 &amp; mod_perl 2.</simpara>
</warning>
<formalpara><title>Perl Module Dependencies</title>
A complete list of modules need to run a LiveJournal installation can be found at <xref linkend="lj.install.perl_setup.modules" />.
Some modules such as GD and Compress::Zlib require certain system libraries to be pre-installed
on your machine in order to work. The author-provided README files for perl modules explain what is necessary.
</formalpara>
<formalpara><title>Hardware</title><para>
There are no specific hardware requirements for a LiveJournal installation, but Apache/mod_perl
and MySQL can utilize a lot of memory very quickly. Determining the right amount of processor
speed, storage space, and RAM depends on how busy your LiveJournal installation will be. A
simple rule of thumb to remember is that posts and comments drive site traffic, not necessarily the presence
of more users.
</para></formalpara>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "chapter")
End:
-->

View File

@@ -0,0 +1,64 @@
<chapter id="lj.install.schedule_tasks">
<title>Scheduling Maintenence tasks</title>
<para>
From the LiveJournal user account (or whatever user is running LJ), you need to
install some crontabs. These are periodic commands that run and manage your
LiveJournal installation.
</para>
<screen><prompt>$</prompt> <userinput>crontab -e</userinput></screen>
<note>
<para>This will bring up either your <envar>$EDITOR</envar>, or <application>vi</application>.
If you want to set your editor explicitly, do:
<screen><prompt>$</prompt> <command>EDITOR=<replaceable>pico</replaceable> crontab -e</command></screen>
</para>
</note>
<para>
Now, enter the following stuff between the dotted lines below. Not all of it is necessary.
See the comments below. The <literal>LJHOME=</literal> line is required. See the section
above about how the <envar><link linkend='lj.install.ljhome'>$LJHOME</link></envar> environment
variable is required everywhere. This is another place.
</para>
<programlisting><![CDATA[LJHOME=/home/lj
MAILTO=youremail@wherever.com
# Essential:
* */12 * * * /home/lj/bin/ljmaint.pl clean_caches >/dev/null
# Optional, if you want birthday mail, and the random user feature:
# (you can remove parts)
5 1 * * * /home/lj/bin/ljmaint.pl bdaymail build_randomuserset >/dev/null
# If you want statistics:
30 1 * * * /home/lj/bin/ljmaint.pl genstats genstatspics genstats_size >/dev/null
5 2 * * 0 /home/lj/bin/ljmaint.pl genstats_weekly > /dev/null
# Various tasks
15 1 * * * /home/lj/bin/ljmaint.pl joinmail > /dev/null
30 * * * * /home/lj/bin/ljmaint.pl synsuck > /dev/null
5 2 * * 0 /home/lj/bin/ljmaint.pl memeclean > /dev/null
# If you're running a high-load site with $LJ::BUFFER_QUERIES on,
# there's another one to install:
*/5 * * * * /home/lj/bin/qbufferd.pl >/dev/null
]]></programlisting>
<para>
If query buffering is off, you can still run that, but it's not needed.
Packagers should make their packages install it, since it doesn't hurt if it's
running and not used. It'll die off right away if it realizes it's not needed.
Otherwise it'll start up in the background and run every 10 seconds or so.
Future startups by cron will only make sure it hasn't died (like if the database dies).
</para>
</chapter>
<!--
Local Variables:
mode:sgml
sgml-parent-document: ("index.xml" "part" "chapter")
End:
-->