ISFDB:Personal Linux Website

From ISFDB
Jump to navigation Jump to search

Follow these instruction to create a version of the ISFDB to run on your home Linux system. These instruction do not include setting up the ISFDB wiki.

Setup the Web server

The ISFDB code relies on a web server. Apache is a good choice for this. The basic instructions are:

  1. Download the software. For Linux this is generally a source distribution, found at http://httpd.apache.org/download.cgi.
  2. Following the build instructions. In general, you should expect to uncompress, untar, run configure, run make, and run make install.
  3. Setup the system so that apache start automatically after a boot. First copy the startup/kill script from the apache installation to the standard Linux location:
   cd /usr/local/apache2/bin
   cp apachectl /etc/init.d/httpd
Next setup the Start and Kill scripts from runstate 3 by creating symbolic links:
   cd /etc/rc3.d
   ln -s ../init.d/httpd S85httpd
   ln -s ../init.d/httpd K85httpd
Next setup the Start and Kill scripts from runstate 5 by creating symbolic links:
   cd /etc/rc5.d
   ln -s ../init.d/httpd S85httpd
   ln -s ../init.d/httpd K85httpd
Finally, if you want to startup Apache without a reboot:
   cd /etc/init.d
   sh httpd start
You should now be able to point a browser at you machine's IP address and see something.

Set up the MySQL server

For this step, follow the Linux instructions found in ISFDB:MySQL Only Setup. This will load in the current version of the ISFDB data.

People familiar with SQL can also create a blank version of the database, which can then be used to track other types of books, e.g.:

  • the books in your library
  • Westerns
  • Romance novels, etc.

The easiest way to do this is to install the latest ISFDB backup and then delete all ISFDB-specific data using the "truncate" command. See Database Schema for the latest version of the ISFDB database schema.

Install Python

Install Python 2.5.4. You can download it from python.org. Note that earlier and later versions of Python may not work with the ISFDB software.

Install MySQLdb

MySQLdb is a python module that allows a python script to interface with the MySQL database. The module includes C code, so it requires the standard Linux development tools. It uses the MySQL libraries, so MySQL must be installed prior to this step. Finally, it is installed in the python modules area, so python must be installed prior to this step.

1. Install the development tools. This contains the C compiler, which is needed in order to compile and link elements of the MySQLdb module. You can test if the development tools are present by typing cc. If cc is present it will output:

  $ cc
  cc: no input files

If the tools are not present you will see:

  $ cc
  -bash: cc: command not found

2. Install python-devel. This module is required in order to install additional python packages, such as MySQLdb. Your version of python may already have this module installed.

3. Install the MySQLdb python module. This can be found at http://sourceforge.net/projects/mysql-python. At this point python will be able to interact with MySQL.

Download the ISFDB Source

Use your browser to download the latest version of the ISFDB software from SourceForge.

Developer Download From SourceForge

TBA

Install the ISFDB

1. Edit isfdb/common/localdefs.py:

  HTMLLOC         = "your_host_name"
  HTFAKE          = "/your_host_name/cgi-bin"
  DBASEHOST       = "localhost"
  HTMLHOST        = "your_host_name"
  COOKIEHOST      = "your_host_name"
  LOCALFILES      = "directory where files generated by the night job reside"
  USERNAME        = "root"
  PASSWORD        = ""
  DBASE           = "isfdb"
  UNICODE         = "iso-8859-1"
  DO_ANALYTICS    = 0

2. Then edit isfdb/INSTALLDIRS:

  INSTALL_CGI     = Local CGI binary directory
  INSTALL_HTML    = Local HTML directory

3. Check the directory permissions on your INSTALL_CGI and INSTALL_HTML directories. You'll either need to do the install as a user who has permission to write there or you'll need to modify the permissions on the directories.

4. Then execute:

  cd isfdb
  make -B install

The "-B" is needed only the first time, or you will get an error about not knowing how to build ".TARGETS". Subsequent rebuilds do not need this.

5. Save copies of your versions of isfdb/INSTALLDIRS and isfdb/common/localdefs.py someplace safe. If you download a new version of the ISFDB software and someone has checked in new versions of those files, you'll need to restore your settings before rerunning "make install".

Configure Nightly Processing

See ISFDB:Configure Nightly Processing.

Enable ISFDB Editing

The ISFDB relies on MediaWiki to register users. In the personal Linux setup without the Wiki, this is not possible. A script is provided to update the appropriate tables to allow editing permissions. After everything is installed and you are able to view pages in the isfdb, execute:

isfdb/scripts/create_user.py LoginName password

This will insert the login name and encrypted password into the correct tables.