[mirrorbrain-commits] r8000 - in /trunk/docs: ./ installation/

From: <poeml_at_mirrorbrain.org>
Date: Sun, 14 Mar 2010 20:29:49 -0000
Author: poeml
Date: Sun Mar 14 21:29:48 2010
New Revision: 8000

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8000&view=rev
Log:
restructure the installation docs: Now there's a new section explaining the
initial configuration, and this part is linked from all platform-specific
sections as "next step" at their end. This should avoid some confusion. Hand in
hand with this change, a cleanup of things scattered in all places is in progress.

Modified:
    trunk/docs/installation/debian.rst
    trunk/docs/installation/gentoo.rst
    trunk/docs/installation/index.rst
    trunk/docs/installation/opensuse.rst
    trunk/docs/installation/source.rst
    trunk/docs/installation/troubleshooting.rst
    trunk/docs/mirrors.rst

Modified: trunk/docs/installation/debian.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/debian.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/installation/debian.rst (original)
+++ trunk/docs/installation/debian.rst Sun Mar 14 21:29:48 2010
_at_@ -62,8 +62,8 @@
   libapache2-mod-mirrorbrain libapache2-mod-autoindex-mb
 
 
-Install an Apache MPM
----------------------
+Select and install an Apache MPM
+--------------------------------
 
 The MirrorBrain packages have dependencies on the Apache common packages, but
 not on a MPM, since the choice of an MPM is one that the system admin must
_at_@ -199,97 +199,7 @@
   sudo chmod 0750 /var/log/mirrorbrain
 
 
-Create mirrorbrain.conf
-~~~~~~~~~~~~~~~~~~~~~~~
-
-Create a configuration file named :file:`mirrorbrain.conf`::
-
-  sudo sh -c "cat > /etc/mirrorbrain.conf << EOF
-  [general]
-  instances = main
-  
-  [main]
-  dbuser = mirrorbrain
-  dbpass = 12345
-  dbdriver = postgresql
-  dbhost = 127.0.0.1
-  # optional: dbport = ...
-  dbname = mirrorbrain
-  
-  [mirrorprobe]
-  # logfile = /var/log/mirrorbrain/mirrorprobe.log
-  # loglevel = INFO
-
-  EOF
-  "
-
-.. note::
-   The database password in the above template is only a placeholder and you
-   need to edit it: change it to the actual password, the one that you gave
-   when you ran PostgreSQL's :program:`createuser` command. Likewise, make sure
-   that you picked the same username.
-
-Set permission and privileges on the file::
-
-  sudo chmod 0640 /etc/mirrorbrain.conf 
-  sudo chown root:mirrorbrain /etc/mirrorbrain.conf
-
-
-Test mirrorbrain
-~~~~~~~~~~~~~~~~
-
-If the following command returns no error, but rather displays its usage info,
-the installation should be quite fine::
-
-  mb help
-
-
-Create a virtual host
----------------------
-
-The following snippet would create a new site as virtual host::
-
-  sudo sh -c "cat > /etc/apache2/sites-available/mirrorbrain << EOF
-  <VirtualHost 127.0.0.1>
-      ServerName mirrors.example.org
-      ServerAdmin webmaster_at_example.org
-      DocumentRoot /var/www/downloads
-      ErrorLog     /var/log/apache2/mirrors.example.org/error.log
-      CustomLog    /var/log/apache2/mirrors.example.org/access.log combined
-      <Directory /var/www/downloads>
-          MirrorBrainEngine On
-          MirrorBrainDebug Off
-          FormGET On
-          MirrorBrainHandleHEADRequestLocally Off
-          MirrorBrainMinSize 2048
-          MirrorBrainExcludeUserAgent rpm/4.4.2*
-          MirrorBrainExcludeUserAgent *APT-HTTP*
-          MirrorBrainExcludeMimeType application/pgp-keys
-          Options FollowSymLinks Indexes
-          AllowOverride None
-          Order allow,deny
-          Allow from all
-      </Directory>
-  </VirtualHost>
-  EOF
-  "
-
-Make the log directory::
-
-  sudo mkdir /var/log/apache2/mirrors.example.org/
-
-Make the download directory::
-
-  sudo mkdir /var/www/downloads
-
-Enable the site::
-
-  sudo a2ensite mirrorbrain
-
-
-Restart Apache, best while watching the error log::
-
-  sudo tail -f /var/log/apache2/error.log &
-  sudo /etc/init.d/apache2 restart
-
-
+Next steps
+----------
+
+From here, follow on with :ref:`initial_configuration`.

Modified: trunk/docs/installation/gentoo.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/gentoo.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/installation/gentoo.rst (original)
+++ trunk/docs/installation/gentoo.rst Sun Mar 14 21:29:48 2010
_at_@ -1,6 +1,7 @@
 Installation on Gentoo Linux
 ================================================================================
 
+These are very rough notes, which might be helpful for someone as a start maybe.
 
 .. note::
    See also
_at_@ -121,4 +122,7 @@
   ...
 
 
+Next steps
+----------
 
+From here, follow on with :ref:`initial_configuration`.

Modified: trunk/docs/installation/index.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/index.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/installation/index.rst (original)
+++ trunk/docs/installation/index.rst Sun Mar 14 21:29:48 2010
_at_@ -10,5 +10,6 @@
     debian
     gentoo
     mod_asn
+    initial_config
     troubleshooting
 

Modified: trunk/docs/installation/opensuse.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/opensuse.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/installation/opensuse.rst (original)
+++ trunk/docs/installation/opensuse.rst Sun Mar 14 21:29:48 2010
_at_@ -1,9 +1,13 @@
 
 
 Installation on openSUSE Linux or SLE
--------------------------------------
+=====================================
 
-Add the needed repositories (use the subdirectory matching your distribution):
+Adding package repositories
+---------------------------
+
+Add the needed repositories, using the subdirectory that matches your
+distribution version:
 
 * http://download.opensuse.org/repositories/Apache:/MirrorBrain/
 * http://download.opensuse.org/repositories/devel:/languages:/python/
_at_@ -15,7 +19,12 @@
   zypper ar http://download.opensuse.org/repositories/devel:/languages:/python/openSUSE_11.1 devel:languages:python 
   zypper ar http://download.opensuse.org/repositories/server:/database:/postgresql/openSUSE_11.1 server:database:postgresql
 
-Here's a list of packages needed to have one host running the database and the redirector:
+
+Installing the MirrorBrain packages
+-----------------------------------
+
+Here's a list of packages needed to have one host running the database and the
+redirector:
 
   apache2 apache2-mod_asn apache2-mod_geoip apache2-mod_mirrorbrain
   apache2-mod_form apache2-worker GeoIP libapr-util1-dbd-pgsql
_at_@ -39,27 +48,7 @@
 dependencies.
 
 
-.. Configure GeoIP
-.. ----------------------------------------------
-.. 
-.. Edit /etc/apache2/conf.d/mod_geoip.conf:
-.. 
-.. <IfModule mod_geoip.c>
-..    GeoIPEnable On
-..    GeoIPDBFile /var/lib/GeoIP/GeoIP.dat
-..    #GeoIPOutput [Notes|Env|All]
-..    GeoIPOutput Env
-.. </IfModule>
-.. 
-.. (Change GeoIPOutput All to GeoIPOutput Env)
-.. 
-..         Note that a caching mode like MMapCache needs to be used, when Apache runs with the worker MPM.In this case, use
-.. 
-..         <IfModule mod_geoip.c>
-.. [50px-]    GeoIPEnable On
-..            GeoIPDBFile /var/lib/GeoIP/GeoIP.dat MMapCache
-..            GeoIPOutput Env
-..         </IfModule>
+Next steps
+----------
 
-
-
+From here, follow on with :ref:`initial_configuration`.

Modified: trunk/docs/installation/source.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/source.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/installation/source.rst (original)
+++ trunk/docs/installation/source.rst Sun Mar 14 21:29:48 2010
_at_@ -3,383 +3,248 @@
 ======================
 
 
-Install Apache 2.2.6 or later. 
-
-The main Apache module can be built with the following steps::
-
-  # unpack the tarball
+Installing Apache
+-----------------
+
+Build or install Apache 2.2.6 or later. 
+
+When installing/building the Apache Portable Runtime (APR), make sure that you
+build the required database adapter for the DBD module for PostgreSQL.
+
+
+Building Apache modules
+-----------------------
+
+mod_form
+~~~~~~~~
+
+Install mod_form. The sources are here:
+
+* http://apache.webthing.com/svn/apache/forms/mod_form.c
+* http://apache.webthing.com/svn/apache/forms/mod_form.h
+
+Its header file will be needed later to compile mod_mirrorbrain.
+
+It is useful to apply the following patch to mod_form.c::
+
+  Tue Mar 13 15:16:30 CET 2007 - poeml_at_cmdline.net
+  
+  preserve r->args (apr_strtok is destructive in this regard). Makes
+  mod_autoindex work again in conjunction with directories where FormGET is
+  enabled.
+  
+  --- mod_form.c.old      2007-03-13 15:05:13.872945000 +0100
+  +++ mod_form.c  2007-03-13 15:06:26.378367000 +0100
+  _at_@ -61,6 +61,7 @@
+     char* pair ;
+     char* last = NULL ;
+     char* eq ;
+  +  char* a ;
+     if ( ! ctx ) {
+       ctx = apr_pcalloc(r->pool, sizeof(form_ctx)) ;
+       ctx->delim = delim[0];
+  _at_@ -69,7 +70,8 @@
+     if ( ! ctx->vars ) {
+       ctx->vars = apr_table_make(r->pool, 10) ;
+     }
+  -  for ( pair = apr_strtok(args, delim, &last) ; pair ;
+  +  a = apr_pstrdup(r->pool, args);
+  +  for ( pair = apr_strtok(a, delim, &last) ; pair ;
+           pair = apr_strtok(NULL, delim, &last) ) {
+       for (eq = pair ; *eq ; ++eq)
+         if ( *eq == '+' )
+
+
+mod_mirrorbrain
+~~~~~~~~~~~~~~~
+
+The main Apache module, :program:`mod_mirrorbrain`, can be built with the
+following steps::
+
+  # unpack the tarball and go inside the source tree
   cd mod_mirrorbrain
-  apxs2 -c mod_mirrorbrain.c
-
-To install the module in the right place, you would typically call::
-
-  apxs2 -i mod_mirrorbrain.c
-
-Building, installing and activation can typically be combined in one apxs call::
-
-  apxs2 -cia mod_mirrorbrain.c
-
-
-After installation of mod_mirrorbrain, you'll need to:
-
-
-* install GeoIP library, commandline tools, and geoip apache module
-  (openSUSE/SLE packages: GeoIP, libGeoIP1, apache2-mod_geoip)
-
-* configure mod_geoip::
-
-    GeoIPEnable On
-    GeoIPOutput Env
-    GeoIPDBFile /var/lib/GeoIP/GeoIP.dat MMapCache
-
-  (You would typically put this into the server-wide context of a virtual host.)
-
-  Note that a caching mode like MMapCache needs to be used, when Apache runs with the worker MPM.
-  See http://forum.maxmind.com/viewtopic.php?p=2078 for more information.
-
-* install mod_form. The sources are here:
-
-  * http://apache.webthing.com/svn/apache/forms/mod_form.c
-  * http://apache.webthing.com/svn/apache/forms/mod_form.h
-
-  It is useful to apply the following patch to mod_form.c::
-
-    Tue Mar 13 15:16:30 CET 2007 - poeml_at_cmdline.net
-    
-    preserve r->args (apr_strtok is destructive in this regard). Makes
-    mod_autoindex work again in conjunction with directories where FormGET is
-    enabled.
-    
-    --- mod_form.c.old      2007-03-13 15:05:13.872945000 +0100
-    +++ mod_form.c  2007-03-13 15:06:26.378367000 +0100
-    _at_@ -61,6 +61,7 @@
-       char* pair ;
-       char* last = NULL ;
-       char* eq ;
-    +  char* a ;
-       if ( ! ctx ) {
-         ctx = apr_pcalloc(r->pool, sizeof(form_ctx)) ;
-         ctx->delim = delim[0];
-    _at_@ -69,7 +70,8 @@
-       if ( ! ctx->vars ) {
-         ctx->vars = apr_table_make(r->pool, 10) ;
-       }
-    -  for ( pair = apr_strtok(args, delim, &last) ; pair ;
-    +  a = apr_pstrdup(r->pool, args);
-    +  for ( pair = apr_strtok(a, delim, &last) ; pair ;
-             pair = apr_strtok(NULL, delim, &last) ) {
-         for (eq = pair ; *eq ; ++eq)
-           if ( *eq == '+' )
-
-
-- install the following Python modules:
-
-  * python-cmdln
-  * python-sqlobject
-  * python-psycopg2
-
-- for the scanner, which is written in Perl, a few Perl modules are required:
-
-  * perl-Config-IniFiles
-  * perl-libwww-perl
-  * perl-DBD-Pg
-  * perl-TimeDate
-  * perl-Digest-MD4 (it is not *really* needed, but prevents an ugly error message)
-
-- configure the database to use with MirrorBrain, and continue with the respective
-  description below:
-
-
-  * install the PostgreSQL database adapter for the DBD library
-    Note that if the web server is set up seperately from the database server,
-    only the web server needs this package.
-  
-  * install postgresql and start it
-
-  * create the postgresql user account and database::
-
-
-       su - postgres
-       
-       root_at_powerpc:~ # su - postgres
-       postgres_at_powerpc:~> createuser -P mirrorbrain
-       Enter password for new role: 
-       Enter it again: 
-       Shall the new role be a superuser? (y/n) n
-       Shall the new role be allowed to create databases? (y/n) n
-       Shall the new role be allowed to create more new roles? (y/n) n
-       CREATE ROLE
-       
-       postgres_at_powerpc:~> createdb -O mirrorbrain mirrorbrain
-       CREATE DATABASE
-       postgres_at_powerpc:~> createlang plpgsql mirrorbrain
-       postgres_at_powerpc:~> 
-
-
-       postgres_at_powerpc:~> cp data/pg_hba.conf data/pg_hba.conf.orig
-       postgres_at_powerpc:~> vi data/pg_hba.conf
-
-       # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
-       # "local" is for Unix domain socket connections only
-       #local   all         all                               ident
-       local   all         all                               password
-       # IPv4 local connections:
-       host    all         all         127.0.0.1/32          password
-       # IPv6 local connections:
-       host    all         all         ::1/128               password
-       # remote connections:
-       host    mirrorbrain mirrorbrain 10.10.2.3/32          md5
-
-       
-      
-  *  Tuning:
-
-     If the database will be large, reserve enough memory for it (mainly
-     by setting shared_buffers), and in any case you should switch off
-     synchronous commit mode (synchronous_commit = off). This can be set in
-     data/postgresql.conf.
-
-     Start the server::
-
-       root_at_powerpc:~ # rcpostgresql restart
-
-  * import table structure, and initial data::
-
-       psql -U mirrorbrain -f sql/schema-postgresql.sql mirrorbrain
-       psql -U mirrorbrain -f sql/initialdata-postgresql.sql mirrorbrain
-
-
-* Create a user and group::
-
-    groupadd -r mirrorbrain
-    useradd -r -o -g mirrorbrain -s /bin/bash -c "MirrorBrain user" -d /home/mirrorbrain mirrorbrain
-
-* create :file:`/etc/mirrorbrain.conf` with the content below. File permissions
-  should be 0640, ownership root:mirrorbrain::
-
-    [general]
-    instances = main
-  
-    [main]
-    dbuser = mirrorbrain
-    dbpass = 12345
-    dbdriver = postgresql
-    dbhost = your_host.example.com
-    # optional: dbport = ...
-    dbname = mirrorbrain
-    
-    [mirrorprobe]
-    # logfile = /var/log/mirrorbrain/mirrorprobe.log
-    # loglevel = INFO
-    
-
-* Note: the "mb" tool referenced below is (for convenience) a symlink to the
-  mirrordoctor.py script.
-
-* now you should be able to type 'mb list' without getting an error.
-  It'll produce no output, but exit with 0. If it gives an error, something is
-  wrong.
-
-* collect a list of mirrors (their HTTP baseurl, and their rsync or FTP baseurl
-  for scanning). For example::
-
-    http://ftp.isr.ist.utl.pt/pub/MIRRORS/ftp.suse.com/projects/
-    rsync://ftp.isr.ist.utl.pt/suse/projects/
-
-    http://ftp.kddilabs.jp/Linux/distributions/ftp.suse.com/projects/
-    rsync://ftp.kddilabs.jp/suse/projects/
-
-
-
-  Now you need to enter the mirrors into the database; it could be done using the
-  "mb" mirrorbrain tool. (See 'mb help new' for full option list.)::
-
-    mb new ftp.isr.ist.utl.pt \
-           --http http://ftp.isr.ist.utl.pt/pub/MIRRORS/ftp.suse.com/projects/ \
-           --rsync rsync://ftp.isr.ist.utl.pt/suse/projects/
-
-    mb new ftp.kddilabs.jp \
-           --http http://ftp.kddilabs.jp/Linux/distributions/ftp.suse.com/projects/ \
-           --rsync rsync://ftp.kddilabs.jp/suse/projects/
-
-
-  The tool automatically figures out the GeoIP location of each mirror by itself.
-  But you could also specify them on the commandline.
-
-  If you want to edit a mirror later, use::
-
-    mb edit <identifier>
-
-  To simply display a mirror, you could use 'mb show kddi', for instance.
-
-  Finally, each mirror needs to be scanned and enabled::
-
-    mb scan --enable <identifier>
-
-  See the output of 'mb help' for more commands.
-
-
-
-* configure Apache:
-
-  * load the Apache modules::
-
-     a2enmod form
-     a2enmod geoip
-     a2enmod dbd
-     a2enmod mirrorbrain
-
-  * create a DNS alias for your web host, if needed
-
-  * configure the database adapter (mod_dbd), resp. its connection pool.
-    Put the configuration into server-wide context. Config example::
-
-      # for prefork, this configuration is inactive. prefork simply uses 1
-      # connection per child.
-      <IfModule !prefork.c>
-              DBDMin  0
-              DBDMax  32
-              DBDKeep 4
-              DBDExptime 10
-      </IfModule>
-
-  * configure the database driver.
-    Put the following configuration into server-wide OR vhost context. Make the file
-    chmod 0640, owned root:root because it will contain the database password::
-
-      DBDriver pgsql
-      # note that the connection string (which is passed straight through to
-      # PGconnectdb in this case) looks slightly different - pass vs. password
-      DBDParams "host=localhost user=mirrorbrain password=12345 dbname=mirrorbrain connect_timeout=15"
-
-
-    .. note:: The database connection string must be unique per virtual host.
-              This matters if several MirrorBrain instances are set up in one
-              Apache. If the database connection string is identical in
-              different virtual hosts, mod_dbd may fail to associate the
-              connection string with the correct virtual host.
-
-
-  * configure mod_mirrorbrain.
-    You probably want to reate a vhost (e.g.
-    /etc/apache2/vhosts.d/samba.mirrorbrain.org.conf) and add the MirrorBrain
-    configuration like shown here::
-
-      <VirtualHost your.host.name:80>
-          ServerName samba.mirrorbrain.org
-      
-          ServerAdmin webmaster_at_example.org
-      
-          DocumentRoot /srv/samba/pub/projects
-      
-          ErrorLog     /var/log/apache/samba.mirrorbrain.org/logs/error_log
-          CustomLog    /var/log/apache/samba.mirrorbrain.org/logs/access_log combined
-
-          <Directory /srv/samba/pub/projects>
-              MirrorBrainEngine On
-              MirrorBrainDebug Off
-              FormGET On
-              MirrorBrainHandleHEADRequestLocally Off
-              MirrorBrainMinSize 2048
-              MirrorBrainExcludeUserAgent rpm/4.4.2*
-              MirrorBrainExcludeUserAgent *APT-HTTP*
-              MirrorBrainExcludeMimeType application/pgp-keys
-
-              Options FollowSymLinks Indexes
-              AllowOverride None
-              Order allow,deny
-              Allow from all
-          </Directory>
-      
-      </VirtualHost>
-
-  * restart Apache, best while watching the error log::
-
-      tail -F /var/log/apache/*_log &
-      apachectl restart
-
-    
-  * mirror surveillance needs to be configured. Put this into /etc/crontab::
-
-      -* * * * *                mirrorbrain   mirrorprobe
-
-    configure mirror scanning::
-
-      45 * * * *                mirrorbrain   mb scan -j 3 -a
-
-    another cron job can remove unreferenced files from the database::
-
-      # Monday: database clean-up day...
-      30 1 * * mon              mirrorbrain   mb db vacuum
-
-
-
-TODO: describe how to test that the install was successful
-    (When testing, consider any excludes that you configured, and which might
-    introduce confusion.)
-
-* Many HTTP clients can be used for testing, but `cURL`_ is a most helpful tool
-  for that. Here are some examples.
-
-  Showy the HTTP response code and the Location header pointing to the new location::
-
-    curl -sI <url>
-
-  Display the metalink::
-
-    curl -s <url>.metalink
-
-  Show a HTML list with the available mirrors::
-
-    curl -s <url>?mirrorlist
-
-.. _`cURL`: http://curl.haxx.se/
-
-
-TODO: describe a decent logging setup
-
-
-* further things that you might want to configure:
-
-  * mod_autoindex_mb, a replacement for the standard module mod_autoindex::
-
-      a2dismod autoindex
-      a2enmod autoindex_mb
-      Add IndexOptions Metalink Mirrorlist
-      # or IndexOptions +Metalink +Mirrorlist, depending on your config
-
-  * add a link to a CSS stylesheet for mirror lists::
-
-      MirrorBrainMirrorlistStylesheet "http://static.opensuse.org/css/mirrorbrain.css"
-
-    and for the autoindex::
-
-      IndexStyleSheet "http://static.opensuse.org/css/mirrorbrain.css"
-
-  * prepare the metalink hashes. 
-
-    * First, add some configuration::
-
-        MirrorBrainMetalinkPublisher "openSUSE" http://download.opensuse.org
-        MirrorBrainMetalinkHashesPathPrefix /srv/hashes/srv/opensuse
-
-    * install the "metalink" tool from http://metamirrors.nl/metalinks_project
-      (openSUSE/Debian/Ubuntu package called metalink, to be found at
-      http://download.opensuse.org/repositories/Apache:/MirrorBrain/)
-
-    * you need to create a directory where to store the hashes. For instance,
-      :file:`/srv/hashes/srv/opensuse`. Note that the full pathname to
-      the filetree (``/srv/opensuse``) is part of this target path.
-      
-      Make the directory owned by the ``mirrorbrain`` user.
-
-    * now, create the hashes with the following command. It is best run as
-      unprivileged user (``mirrorbrain``)::
-
-        mb makehashes /srv/opensuse -t /srv/hashes/srv/opensuse
-
-
-    * add the hashing command to /etc/crontab to be run every few hours. Alternatively, run
-      it after changes in the file tree happen.
-
-
+  apxs -c mod_mirrorbrain.c
+
+To install the module in the right place, you would normally call::
+
+  apxs -i mod_mirrorbrain.c
+
+Building, installing and activation can typically be combined in one :program:`apxs` call::
+
+  apxs -cia mod_mirrorbrain.c
+
+
+mod_autoindex_mb
+~~~~~~~~~~~~~~~~
+
+Build and install mod_autoindex_mb::
+
+  # in mirrorbrain source tree
+  cd mod_autoindex_mb
+  apxs -cia mod_autoindex_mb.c
+
+
+mod_geoip
+~~~~~~~~~
+
+Install the GeoIP library, the accompanying commandline tools, and the geoip Apache module.
+
+Configure mod_geoip::
+
+  GeoIPEnable On
+  GeoIPOutput Env
+  GeoIPDBFile /var/lib/GeoIP/GeoIP.dat MMapCache
+
+(You would typically put this into the server-wide context of a virtual host.)
+
+Note that a caching mode like MMapCache needs to be used, when Apache runs with the worker MPM.
+See http://forum.maxmind.com/viewtopic.php?p=2078 for more information.
+
+You need to build two commandline tools for GeoIP::
+
+  cd tools
+  gcc -Wall -o geoiplookup_continent geoiplookup_continent.c -lGeoIP
+  gcc -Wall -o geoiplookup_city geoiplookup_city.c -lGeoIP
+
+
+
+Installing Python and Perl modules
+----------------------------------
+
+Install the following Python modules:
+
+* python-cmdln
+* python-sqlobject
+* python-psycopg2
+
+Install a few Perl modules as well (required for the mirror scanner, which is written in Perl):
+
+* perl-Config-IniFiles
+* perl-libwww-perl
+* perl-DBD-Pg
+* perl-TimeDate
+* perl-Digest-MD4 (it is not *really* needed, but prevents an ugly error message)
+
+
+Installing PostgreSQL
+---------------------
+
+Install the PostgreSQL server, start it and create a user and a database::
+
+  su - postgres
+  
+  root_at_powerpc:~ # su - postgres
+  postgres_at_powerpc:~> createuser -P mirrorbrain
+  Enter password for new role: 
+  Enter it again: 
+  Shall the new role be a superuser? (y/n) n
+  Shall the new role be allowed to create databases? (y/n) n
+  Shall the new role be allowed to create more new roles? (y/n) n
+  CREATE ROLE
+  
+  postgres_at_powerpc:~> createdb -O mirrorbrain mirrorbrain
+  CREATE DATABASE
+  postgres_at_powerpc:~> createlang plpgsql mirrorbrain
+  postgres_at_powerpc:~> 
+
+
+  postgres_at_powerpc:~> cp data/pg_hba.conf data/pg_hba.conf.orig
+  postgres_at_powerpc:~> vi data/pg_hba.conf
+
+  # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
+  # "local" is for Unix domain socket connections only
+  #local   all         all                               ident
+  local   all         all                               password
+  # IPv4 local connections:
+  host    all         all         127.0.0.1/32          password
+  # IPv6 local connections:
+  host    all         all         ::1/128               password
+  # remote connections:
+  host    mirrorbrain mirrorbrain 10.10.2.3/32          md5
+
+
+Install the ip4r data type.
+
+Import the table structure and initial data::
+
+  psql -U mirrorbrain -f sql/schema-postgresql.sql mirrorbrain
+  psql -U mirrorbrain -f sql/initialdata-postgresql.sql mirrorbrain
+
+
+
+Creating a "mirrorbrain" user and group
+---------------------------------------
+
+Create a "mirrorbrain" user and group::
+
+  groupadd -r mirrorbrain
+  useradd -r -o -g mirrorbrain -s /bin/bash -c "MirrorBrain user" -d /home/mirrorbrain mirrorbrain
+
+
+Installation of the tools
+-------------------------
+
+You need to install a number of the provided tools to a location in your $PATH.
+Unfortunately, there is no Makefile to take this work off you. Hopefully, one can
+be provided later::
+
+  install -m 755 tools/geoiplookup_continent /usr/bin/geoiplookup_continent
+  install -m 755 tools/geoiplookup_city      /usr/bin/geoiplookup_city
+  install -m 755 tools/geoip-lite-update     /usr/bin/geoip-lite-update
+  install -m 755 tools/null-rsync            /usr/bin/null-rsync
+  install -m 755 tools/scanner.pl            /usr/bin/scanner
+  install -m 755 mirrorprobe/mirrorprobe.py  /usr/bin/mirrorprobe
+
+
+The following command should build and install the :program:`mb` admin tool (a.k.a. :program:`mirrordoctor`)::
+
+  setup.py install [--prefix=...]
+  ln -s mirrordoctor.py /usr/bin/mb
+
+
+
+Configuring Apache
+------------------
+
+Load the Apache modules::
+
+  a2enmod form
+  a2enmod geoip
+  a2enmod dbd
+  a2enmod mirrorbrain
+
+
+Configure the database adapter (mod_dbd), resp. its connection pool.
+Put the configuration into server-wide context. Config example::
+
+  # for prefork, this configuration is inactive. prefork simply uses 1
+  # connection per child.
+  <IfModule !prefork.c>
+          DBDMin  0
+          DBDMax  32
+          DBDKeep 4
+          DBDExptime 10
+  </IfModule>
+
+Configure the database driver. Put the following configuration into server-wide
+OR vhost context. Make the file chmod 0640, owned root:root because it will
+contain the database password::
+
+  DBDriver pgsql
+  # note that the connection string (which is passed straight through to
+  # PGconnectdb in this case) looks slightly different - pass vs. password
+  DBDParams "host=localhost user=mirrorbrain password=12345 dbname=mirrorbrain connect_timeout=15"
+
+
+.. note:: The database connection string must be unique per virtual host.
+          This matters if several MirrorBrain instances are set up in one
+          Apache. If the database connection string is identical in
+          different virtual hosts, mod_dbd may fail to associate the
+          connection string with the correct virtual host.
+
+
+
+Next steps
+----------
+
+From here, follow on with :ref:`initial_configuration`.

Modified: trunk/docs/installation/troubleshooting.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/installation/troubleshooting.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/installation/troubleshooting.rst (original)
+++ trunk/docs/installation/troubleshooting.rst Sun Mar 14 21:29:48 2010
_at_@ -26,3 +26,6 @@
           http://mirrorbrain.org/communication .  Questions can be answered
           there, and all kind of feedback is appreciated.
 
+.. note:: Bugs should be reported via http://mirrorbrain.org/issues/ or via the
+          mailing list.
+

Modified: trunk/docs/mirrors.rst
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/docs/mirrors.rst?rev=8000&r1=7999&r2=8000&view=diff
==============================================================================
--- trunk/docs/mirrors.rst (original)
+++ trunk/docs/mirrors.rst Sun Mar 14 21:29:48 2010
_at_@ -725,11 +725,13 @@
 .. _`PostgreSQL interactive terminal`: http://www.postgresql.org/docs/8.4/static/app-psql.html
 
 
+.. _mb_db_sizes:
+
 Database size info with :program:`mb db size`
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The command :program:`mb db size` prints the size of each database relation.
-(In PostgreSQL speak, a A *relation* is a table or an index.) This provides
+(In PostgreSQL speak, a *relation* is a table or an index.) This provides
 insight for appropriate database tuning and planning. Here's an example::
 
      % mb db sizes       
_at_@ -751,8 +753,8 @@
       0.0    sql_sizing_profiles
     Total: 1145.9
 
-That's a really large database, containing nearly 3 millions (!) of files. It
-uses a good gigabyte of disk space.
+This example shows a really, really large database, containing nearly 3
+millions (!) of files. It uses a good gigabyte of disk space.
 
 ``filearr`` contains the file names and associations to the mirrors.
 ``filearr_path_key`` is the index on the file names. ``filearr_pkey`` is the




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sun Mar 14 2010 - 20:29:50 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT