Difference between revisions of "ISFDB:Personal Windows Website"

From ISFDB
Jump to navigation Jump to search
(→‎Mainstream x64 / EM64T/AMD64: Formatting + clarification that Cygwin 64-bit works out of the box)
 
(45 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Follow these instruction to create a version of the ISFDB to run on your home Windows system.  These instructions were developed on a Windows XP system and may need adjustment for Vista and later editions.  If you are running 64-bit Windows, see the section on [[#Windows x64 Considerations| Windows x64 Considerations]].
+
Follow these instruction to create a version of the ISFDB to run on a Windows system. These instruction do not include setting up the ISFDB wiki.
 
 
These instruction do not include setting up the ISFDB wiki.
 
  
 
==Current Kits==
 
==Current Kits==
Line 7: Line 5:
 
This is a list of the recent versions of the kits referred to in these instructions.  Binary installation packages are available for all external application used.
 
This is a list of the recent versions of the kits referred to in these instructions.  Binary installation packages are available for all external application used.
  
List last updated '''August 15, 2009'''.
+
List last updated '''July 14, 2023'''.
  
:{|border="1"
+
:{|class="wikitable"
 
|-
 
|-
! Application !! Main Download Area !! Recent Version !! Kit
+
! Application !! Main Download Area !! Current Version !! Kit
 
|-
 
|-
 
|rowspan="2"|Apache
 
|rowspan="2"|Apache
|rowspan="2"|[http://httpd.apache.org/download.cgi http://httpd.apache.org/download.cgi]
+
|rowspan="2"|[https://archive.apache.org/dist/httpd/binaries/win32/ Archive of Wins32 Apache binaries]
|2.2.13 (no SSL)
+
|[https://archive.apache.org/dist/httpd/binaries/win32/httpd-2.2.25-win32-x86-no_ssl.msi 2.2.25 (no SSL)]
|[http://www.apache.org/dist/httpd/binaries/win32/apache_2.2.13-win32-x86-no_ssl.msi apache_2.2.13-win32-x86-no_ssl.msi]
+
|
|-
 
|2.2.13 (SSL)
 
|[http://www.apache.org/dist/httpd/binaries/win32/apache_2.2.13-win32-x86-openssl-0.9.8k.msi apache_2.2.13-win32-x86-openssl-0.9.8k.msi]
 
 
|-
 
|-
|IIS
+
|[https://archive.apache.org/dist/httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi 2.2.25 (SSL)]
|On O/S media only
+
|
|6.0
 
|n/a
 
 
|-
 
|-
 
|MySQL
 
|MySQL
|[http://dev.mysql.com/downloads/mysql/?rz=gdl#downloads http://dev.mysql.com/downloads/]
+
|[https://downloads.mysql.com/archives/community/ MySQL Product Archives]
|5.1.x
+
|5.5.62 (32-bit Windows) - last 5.5 version and the highest Windows version successfully tested so far; works under Windows 32 as well as Windows 64
|[http://dev.mysql.com/downloads/mysql/5.1.html#win32 5.1.html#win32]
+
|[https://downloads.mysql.com/archives/get/p/23/file/mysql-5.5.62-win32.msi mysql-5.5.62-win32.msi]
 
|-
 
|-
 
|Python
 
|Python
|[http://www.python.org/download/ http://www.python.org/download/]
+
|[https://www.python.org/download/ http://www.python.org/download/]
|2.5.4
+
|2.7.18 for Windows32
|[http://www.python.org/ftp/python/2.5.4/python-2.5.4.msi python-2.5.4.msi]
+
|[https://www.python.org/ftp/python/2.7.18/python-2.7.18.msi python-2.7.18.msi]
 
|-
 
|-
 
|MySQLdb
 
|MySQLdb
|[http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=15775 http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=15775]
+
|[https://sourceforge.net/projects/mysql-python/files/mysql-python/ MySQL for Python download files]
|1.2.2-py2.5
+
|1.2.4b4 for Python 2.7
|[http://sourceforge.net/project/downloading.php?group_id=22307&filename=MySQL-python-1.2.2.win32-py2.5.exe&a=16883869 MySQL-python-1.2.2.win32-py2.5.exe]
+
|[https://sourceforge.net/projects/mysql-python/files/latest/download MySQL-python-1.2.4b4.win32-py2.7.exe]
|-
 
|TortoiseCVS<sup>1</sup>
 
|[http://sourceforge.net/project/showfiles.php?group_id=48103&package_id=41194 http://sourceforge.net/project/showfiles.php?group_id=48103&package_id=41194]
 
|1.10.10
 
|[http://sourceforge.net/project/downloading.php?group_id=48103&filename=TortoiseCVS-1.10.10.exe TortoiseCVS-1.10.10.exe]
 
 
|-
 
|-
|Cygwin<sup>1</sup>
+
|Cygwin
|[http://www.cygwin.com http://www.cygwin.com]
+
|[https://cygwin.com https://cygwin.com]
|1.5.25
+
|3.4.7 (2023) Setup version 2.925
|[http://www.cygwin.com/setup.exe setup.exe]
+
|[https://cygwin.com/setup-x86.exe 32-bit version] or [https://cygwin.com/setup-x86_64.exe 64-bit version]
 
|-
 
|-
 
|}
 
|}
 
<small>
 
:<sup>1</sup>The Cygwin Linux emulation environment for Windows has available a command-line CVS.
 
</small>
 
  
 
==Set up the Web server==
 
==Set up the Web server==
Line 69: Line 53:
 
===Setting up Apache===
 
===Setting up Apache===
  
# Download the Windows binary (MSI installer) listed in [[#Current Kits|Current Kits above]].  Use the most recent "stable" version.  The ISFDB does not require SSL, so either package may be used.
+
# Download the Windows binary (MSI installer) listed in [[#Current Kits|Current Kits above]].  Use the most recent "stable" version.  A personal version of the ISFDB system does not require SSL/HTTPS, so either package may be used.
 
# Run the downloaded file.  The installation wizard will prompt for information used to set up an initial configuration:
 
# Run the downloaded file.  The installation wizard will prompt for information used to set up an initial configuration:
 
#* ''Network Domain'' can be anything (blank is not allowed)
 
#* ''Network Domain'' can be anything (blank is not allowed)
Line 78: Line 62:
 
#* Use the default location or specify some other directory
 
#* Use the default location or specify some other directory
  
At this point "http://localhost" in your browser should show you a page saying '''It Works!'''.
+
At this point "http://127.0.0.1" in your browser should show you a page saying '''It Works!'''.
  
 
==Set up the MySQL server==
 
==Set up the MySQL server==
  
<ol>
+
* Download the Windows binary (MSI installer) listed in [[#Current Kits|Current Kits above]].
<li>Download the Windows binary (MSI installer) listed in [[#Current Kits|Current Kits above]].</li>
+
* Follow the [[ISFDB:MySQL Only Setup#Windows Installation|Windows instructions in ISDFB:MySQL Only Setup]]. This will load the current version of the ISFDB data.
<li>Follow the [[ISFDB:MySQL Only Setup#Windows Installation|Windows instructions in ISDFB:MySQL Only Setup]]. This will load in the current version of the ISFDB data. The MySQL Only Setup does not contain all of the tables used by the web browser access.  A symptom of missing tables is a SQL error that "mw_user_groups" does not exist.  To get any missing tables, follow these steps additional steps:
 
<ul>
 
<li>Download [http://www.isfdb.org/isfdb.sql http://www.isfdb.org/isfdb.sql].</li>
 
<li>Start up the mysql client and issue the following commands:
 
<pre>
 
  mysql> connect isfdb;
 
  mysql> source isfdb.sql;
 
</pre>
 
Errors about existing tables, etc. are normal and can be ignored.</li>
 
</ul>
 
</li>
 
</ol>
 
 
 
'''NOTE:''' Windows Vista users will probably have to disable User Account Control (UAC) before installing MySQL.
 
 
 
===Setting up an Empty Database===
 
 
 
It is also possible to construct a blank version of the database, which can then be used to track the books in your library, or to create a different database altogether - like a database of Westerns, or Romance Novels. To follow this path:
 
 
 
#Download [http://www.isfdb.org/isfdb.sql http://www.isfdb.org/isfdb.sql].
 
#Start up the mysql client and issue the following commands:
 
  
  mysql> drop database isfdb;
+
'''NOTE:''' Windows Vista (and later) users may need to disable User Account Control (UAC) before installing MySQL.
  mysql> create database isfdb;
 
  mysql> connect isfdb;
 
  mysql> source isfdb.sql;
 
  
 
==Set up Python==
 
==Set up Python==
 
MySQLdb (see [[#Install MySQLdb| Install MySQLdb below]]) is available for specific versions of Python, so you should check MySQLdb's Python version availability and download a matched set of Python and MySQLdb.
 
  
 
# Download the Windows binary (MSI installer) listed in [[#Current Kits|Current Kits above]].
 
# Download the Windows binary (MSI installer) listed in [[#Current Kits|Current Kits above]].
Line 121: Line 79:
 
#* After the installation completes, add the Python installation directory to the system Path. (You may need to restart your machine for the System Path changes to take effect.)
 
#* After the installation completes, add the Python installation directory to the system Path. (You may need to restart your machine for the System Path changes to take effect.)
  
'''NOTE:''' Without changes, the ISFDB build environment will construct scripts expecting to find \usr\bin\python.exe <u>on the same drive as the Apache process' working directory</u> (by default, the same drive onto which Apache was installed).  You can either install Python into \usr\bin instead of the default location, or you can install elsewhere and then '''mkdir \usr\bin''' and copy python.exe from the Python installation directory into it.
+
'''NOTE:''' Without changes, the ISFDB build environment will construct scripts expecting to find \usr\bin\python.exe <u>on the same drive as the Apache process' working directory</u> (by default, the same drive onto which Apache was installed).  You can either install Python into \usr\bin instead of the default location, or you can install elsewhere and then (from a Command Prompt or Cygwin window) '''mkdir \usr\bin''' and copy python.exe from the Python installation directory into it.
  
 
===Install MySQLdb===
 
===Install MySQLdb===
  
MySQLdb is a python module that allows a python script to interface with the MySQL database. It uses the MySQL libraries, so MySQL must be installed prior to this step. It is installed into the Python modules area, so Python must be installed prior to this step.
+
MySQLdb is a Python module that allows a python script to interface with the MySQL database. It uses the MySQL libraries, so MySQL must be installed prior to this step. It is installed into the Python modules area, so Python must be installed prior to this step.
  
# Download the Windows binary (EXE) listed in [[#Current Kits|Current Kits above]].
+
# Download the Windows binary (EXE) listed in [[#Current Kits|Current Kits above]]. (Note that the versions of Python and MySQLdb should match.)
 
# Run the downloaded file. (If you get an "Unable to create Key" error message, you may need to right-click and choose Run as Administrator, even if the user you are logged in as has admin privileges.)
 
# Run the downloaded file. (If you get an "Unable to create Key" error message, you may need to right-click and choose Run as Administrator, even if the user you are logged in as has admin privileges.)
 
#* The Python installation just done above should be listed and selected.
 
#* The Python installation just done above should be listed and selected.
Line 136: Line 94:
 
==Set up Unix Utilities==
 
==Set up Unix Utilities==
  
CVS and the build process use various Unix utilities (make, diff, etc.).  There are several packages of ports of GNU utilities to Windows available.  Cygwin is heavier-weight than some of the other options but provides the most complete environment and works well with the Unix-centric ISFDB build process.
+
The ISFDB build process uses various Unix utilities (make, diff, etc.).  There are several ports of GNU utilities to Windows available.  For our purposes, Cygwin is the recommended package. Although it is heavier-weight than some other options, it provides the most complete environment and works well with the Unix-centric ISFDB build process.
  
 
# Download the setup.exe file listed in [[#Current Kits|Current Kits above]].
 
# Download the setup.exe file listed in [[#Current Kits|Current Kits above]].
Line 144: Line 102:
 
#* In the Packages list, expand Devel and
 
#* In the Packages list, expand Devel and
 
#** Select "make" (not installed by default)
 
#** Select "make" (not installed by default)
#** If you want to run command-line CVS, you can also select "cvs".
 
 
#* In the Packages list, expand Utils and
 
#* In the Packages list, expand Utils and
#** Select "diffutils" (not required; for using diff with CVS)
+
#** Select "diffutils" (not required)
 
#* Complete the installation. A desktop icon is not needed unless you want easy access to a shell environment.
 
#* Complete the installation. A desktop icon is not needed unless you want easy access to a shell environment.
 
# Add the Cygwin bin directory (e.g., C:\cygwin\bin) to your system Path. (You may need to restart your machine for the System Path changes to take effect.)  
 
# Add the Cygwin bin directory (e.g., C:\cygwin\bin) to your system Path. (You may need to restart your machine for the System Path changes to take effect.)  
  
Typing '''make -v''' at the Cygwin command prompt should report "GNU Make 3.81" or a later version.
+
Typing '''make -v''' in a Command Prompt or Cygwin window should report "GNU Make 3.81" or a later version.
 
 
==Set up CVS==
 
 
 
In order to be able to retrieve the ISFDB source code from SourceForge, you must use CVS.  Several CVS packages for Windows are available.  A port of the Unix command line CVS is available for Cygwin (see above).  For a more Windows-standard interface, TortoiseCVS provides a tight integration into Windows Explorer, without the need to work from the command line.
 
 
 
# Download the Windows binary (EXE) listed in [[#Current Kits|Current Kits above]].
 
# Run the downloaded file.
 
#* Take the defaults
 
#* Do a full installation
 
#* Allow the installation to restart Windows Explorer
 
  
 
==Download the ISFDB Source==
 
==Download the ISFDB Source==
  
The ISFDB source is stored at SourceForge and is accessed via CVS.  Anonymous CVS can be used to get a read-only copy.  Developer access is required to modify the source and submit the changes.
+
Use your browser to download the [https://sourceforge.net/p/isfdb/code-svn/HEAD/tarball latest version of the ISFDB software] from SourceForge. Unpack it in the directory tree of your choice. For the purposes of these instruction we will assume that you will call the top level directory "isfdb".
 
 
===Anonymous CVS Download From SourceForge===
 
 
 
Anyone can get a copy of the ISFDB source via anonymous CVS access.
 
 
 
====TortoiseCVS====
 
 
 
Using TortoiseCVS, right-click on the folder in which you want the ISFDB root source folder to be created (e.g., C:\), and pick CVS Checkout... from the context menu. Copy and paste this line into the CVSROOT field of the Checkout dialog:
 
 
 
  :pserver:anonymous@isfdb.cvs.sourceforge.net:/cvsroot/isfdb
 
 
 
or use the following configuration:
 
 
 
  ''Protocol'':          Password server (:pserver:)
 
  ''Server'':            isfdb.cvs.sourceforge.net
 
  ''Repository folder'': /cvsroot/isfdb
 
  ''User name'':        anonymous
 
 
 
Leave the "Edit" option un-checked.  The module is "isfdb2", but the "Fetch list..." button can be used to retrieve a list from the CVS server.
 
 
 
====CVS Command Line====
 
 
 
If you have a CVS command line tool installed, you can perform the download using the following command:
 
 
 
  cvs -z3 -d:pserver:anonymous@isfdb.cvs.sourceforge.net:/cvsroot/isfdb co -P isfdb2
 
 
 
If you receive a "cannot rename file" error, change permissions on the newly created isfdb2 directory, e.g. "chmod 777 isfdb2", and rerun the cvs command.
 
 
 
===Developer CVS Download From SourceForge===
 
 
 
If you are an ISFDB developer, you can check out views, make changes, and check in updates. Requests to be an ISFDB developer must be approved by an ISFDB administrator at SourceForge. Developer checkouts also require that you obtain a login at SourceForge, generate an SSH key on your home system, and record your public key on the SourceForge site. Once those steps are complete, you can extract a developer view.
 
 
 
====TortoiseCVS====
 
 
 
Using TortoiseCVS, right-click on the folder in which you want the ISFDB root source folder to be created (e.g., C:\), and pick CVS Checkout... from the context menu.  Paste this line into the CVSROOT field of the Checkout dialog, replacing ''login_name'' with your SourceForge login:
 
 
 
  :ext:login_name@isfdb.cvs.sourceforge.net:/cvsroot/isfdb
 
 
 
or use the following configuration (again, replacing ''login_name'' with your SourceForge login):
 
 
 
  ''Protocol'':          Secure shell (:ext:)
 
  ''Server'':            isfdb.cvs.sourceforge.net
 
  ''Repository folder'': /cvsroot/isfdb
 
  ''User name'':        login_name
 
 
 
Check the "Edit" option.  The module is "isfdb2", but the "Fetch list..." button can be used to retrieve a list from the CVS server.
 
 
 
====CVS Command Line====
 
 
 
If you have a CVS command line tool installed, you can perform the download using the following command:
 
 
 
  set CVS_RSH=ssh
 
  set CVSROOT=login_name@isfdb.cvs.sourceforge.net:/cvsroot/isfdb
 
  cvs -z3 -d:ext:login_name@isfdb.cvs.sourceforge.net:/cvsroot/isfdb co -P isfdb2
 
  
 
==Install the ISFDB==
 
==Install the ISFDB==
  
 
<ol>
 
<ol>
<li> Edit isfdb2\common\localdefs.py:
+
<li> Edit isfdb\common\localdefs.py:
 
<pre>
 
<pre>
   HTMLLOC        = "127.0.0.1"
+
   DBASE          = "isfdb"
 +
  DBASEHOST      = "localhost"
 +
  DO_ANALYTICS    = 0
 
   HTFAKE          = "cgi-bin" (if using IIS, this should be "cgi")
 
   HTFAKE          = "cgi-bin" (if using IIS, this should be "cgi")
  DBASEHOST      = "localhost"
 
  WIKILOC        = "www.isfdb.org/wiki"
 
 
   HTMLHOST        = "127.0.0.1"
 
   HTMLHOST        = "127.0.0.1"
   COOKIEHOST      = "127.0.0.1"
+
   HTMLHOST_ALT    = ""
 +
  HTMLLOC        = "127.0.0.1"
 +
  PASSWORD        = "the password" (the password you set up for MySQL)
 +
  PROTOCOL        = "http"
 
   USERNAME        = "root"
 
   USERNAME        = "root"
   PASSWORD        = "the password" (the password you set during the MySQL set-up)
+
   LEGACY_PASSWORDS= 1
  DBASE          = "isfdb"
 
 
   UNICODE        = "iso-8859-1"
 
   UNICODE        = "iso-8859-1"
   DO_ANALYTICS    = 0
+
   WIKILOC        = "www.isfdb.org/wiki (or 127.0.0.1/wiki if the ISFDB Wiki is installed locally)"
 
</pre>
 
</pre>
  
 
'''NOTE:''' Do not use "localhost" for HTMLLOC and HTMLHOST.  Doing so causes IE7 (and possibly other browsers) to decide to ignore the cookies delivered by the ISFDB software when you log in.  Using "localhost" will result in the login's succeeding but then your still being in a "not logged in" state.
 
'''NOTE:''' Do not use "localhost" for HTMLLOC and HTMLHOST.  Doing so causes IE7 (and possibly other browsers) to decide to ignore the cookies delivered by the ISFDB software when you log in.  Using "localhost" will result in the login's succeeding but then your still being in a "not logged in" state.
 +
* Note that HTMLHOST_ALT is normally set to an empty string for personal Web sites. You can set it to an alternative host name if using a real domain name as opposed to "127.0.0.1", e.g. "isfdb.org" if HTMLHOST is "www.isfdb.org".
  
 
You will also need to access your ISFDB installation using the IP address for logging in to work. E.g., using:
 
You will also need to access your ISFDB installation using the IP address for logging in to work. E.g., using:
Line 245: Line 141:
  
 
</li>
 
</li>
<li> Then edit isfdb2\INSTALLDIRS:
+
<li> Then edit isfdb\INSTALLDIRS:
 
<pre>
 
<pre>
 
   INSTALL_CGI    = path to Apache's cgi-bin (or IIS' cgi)
 
   INSTALL_CGI    = path to Apache's cgi-bin (or IIS' cgi)
Line 261: Line 157:
 
<li> Check the directory permissions on your INSTALL_CGI and INSTALL_HTML directories. You'll either need to do the install as a user that has permission to write there, or you'll need to modify the permissions on the directories.
 
<li> Check the directory permissions on your INSTALL_CGI and INSTALL_HTML directories. You'll either need to do the install as a user that has permission to write there, or you'll need to modify the permissions on the directories.
 
</li>
 
</li>
<li> Then in Cygwin, execute:
+
<li> Then, in a Command Prompt or Cygwin window, execute:
 
<pre>
 
<pre>
     cd isfdb2
+
     cd isfdb
 
     make -B install
 
     make -B install
 
</pre>
 
</pre>
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.
+
The "-B" is needed the first time or when adding a new file name to one of the TARGETS file. Without the "-B" you will get an error about not knowing how to build ".TARGETS". Subsequent rebuilds which do not add new file names to TARGETS files can use "make install", which is much faster.
 
</li>
 
</li>
<li> Place copies of isfdb2\INSTALLDIRS and isfdb2\common\localdefs.py someplace safe. If you do a cvs update on your source directory, and someone has checked in new versions of those files, you'll need to merge in your settings before installing again.
+
<li> Place copies 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".
 
</li>
 
</li>
 
</ol>
 
</ol>
 +
 +
==Configure Nightly Processing==
 +
 +
See [[ISFDB:Configure Nightly Processing]]
  
 
==Enable ISFDB Editing==
 
==Enable ISFDB Editing==
  
The ISFDB relies on MediaWiki to register users. In a personal 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:
+
The ISFDB relies on MediaWiki to register users. In a personal 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, in a Command Prompt or Cygwin window, execute:
  
   python isfdb2\scripts\create_user.py LoginName password
+
   <nowiki>python isfdb\scripts\create_user.py LoginName password</nowiki>
  
This will insert the login name and encrypted password into the correct tables.
+
replacing LoginName and password above with the actual login name and password you want to use on your local install. This will insert the login name and encrypted password into the correct tables.
  
 
==Windows x64 Considerations==
 
==Windows x64 Considerations==
Line 286: Line 186:
 
===Mainstream x64 / EM64T/AMD64===
 
===Mainstream x64 / EM64T/AMD64===
  
*Apache: No MSI installer available. x64-compiled binaries are available from [http://www.blackdot.be/?inc=apache/binaries http://www.blackdot.be/?inc=apache/binaries].  Ok to use.
+
*Apache: <font color="red">As of 2023-07-17 these instructions are out of date and will need to be updated:</font> x64-compiled 2.2.34 binaries (no MSI installer) are available from [https://www.apachelounge.com/download/win64/ https://www.apachelounge.com/download/win64/]. Old 2.2.24 MSI installer available at [https://www.anindya.com/apache-http-server-2-4-4-and-2-2-24-x86-32-bit-and-x64-64-bit-windows-installers/ https://www.anindya.com/apache-http-server-2-4-4-and-2-2-24-x86-32-bit-and-x64-64-bit-windows-installers/].  Latest 2.4.57 binaries (no MSI installer) are available at [https://www.apachelounge.com/download/VS17/binaries/httpd-2.4.57-win64-VS17.zip https://www.apachelounge.com/download/VS17/binaries/httpd-2.4.57-win64-VS17.zip].  Old 2.4.23 MSI installer available at [https://www.anindya.com/apache-http-server-2-4-23-x86-32-bit-and-x64-64-bit-windows-installers/ https://www.anindya.com/apache-http-server-2-4-23-x86-32-bit-and-x64-64-bit-windows-installers/].
 
*IIS: x64 status unknown.
 
*IIS: x64 status unknown.
*MySQL: x64 MSI available at [http://dev.mysql.com/downloads/mysql/5.1.html#winx64 http://dev.mysql.com/downloads/mysql/5.1.html#winx64].  Ok to use.
+
*MySQL: x64 MSI, version 5.5.62, is available at [https://downloads.mysql.com/archives/community/ https://downloads.mysql.com/archives/community/].  Ok to use.
*Python: x64 MSI available, BUT MySQLdb has no x64 version and will not work with x64-compiled Python.  The win32 version must be installed anyway, so there's little to be gained by installing the x64 version.
+
*Python: x64 MSI is available, BUT MySQLdb has no x64 version and will not work with x64-compiled Python.  The win32 version must be installed anyway, so there's little to be gained by installing the x64 version.
 
*MySQLdb: No x64 version available.  Because it is win32, it requires a win32 version of Python be used.  Trying to use it with the x64 Python will report that a suitable version of Python is not installed.
 
*MySQLdb: No x64 version available.  Because it is win32, it requires a win32 version of Python be used.  Trying to use it with the x64 Python will report that a suitable version of Python is not installed.
*Cygwin: Works on x64 as-is.
+
*Cygwin: Both the 32-bit version and the 64-bit version work on x64 as-is -- the "Current Kits" version above has links to both.
*TortoiseCVS: The kit is x64-aware and will install x64 native automatically (needed for context menues to work).  Ok to use.
 
  
 
===Itanium / IA64===
 
===Itanium / IA64===

Latest revision as of 13:21, 17 July 2023

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

Current Kits

This is a list of the recent versions of the kits referred to in these instructions. Binary installation packages are available for all external application used.

List last updated July 14, 2023.

Application Main Download Area Current Version Kit
Apache Archive of Wins32 Apache binaries 2.2.25 (no SSL)
2.2.25 (SSL)
MySQL MySQL Product Archives 5.5.62 (32-bit Windows) - last 5.5 version and the highest Windows version successfully tested so far; works under Windows 32 as well as Windows 64 mysql-5.5.62-win32.msi
Python http://www.python.org/download/ 2.7.18 for Windows32 python-2.7.18.msi
MySQLdb MySQL for Python download files 1.2.4b4 for Python 2.7 MySQL-python-1.2.4b4.win32-py2.7.exe
Cygwin https://cygwin.com 3.4.7 (2023) Setup version 2.925 32-bit version or 64-bit version

Set up the Web server

The ISFDB code relies on a web server. Two widely used choices on Windows are Microsoft IIS and the Apache HTTP Server. IIS is only available with Windows Server releases, so Apache is usually a more practical choice.

WARNING: The instructions here cover a basic installation of the web server and do not address properly securing a web server that is exposed to the Internet. If your web server is not behind a firewall or router set up to block inbound traffic, refer to the server's documentation and other sources for securing its configuration.

Setting up IIS

TBS

Setting up Apache

  1. Download the Windows binary (MSI installer) listed in Current Kits above. Use the most recent "stable" version. A personal version of the ISFDB system does not require SSL/HTTPS, so either package may be used.
  2. Run the downloaded file. The installation wizard will prompt for information used to set up an initial configuration:
    • Network Domain can be anything (blank is not allowed)
    • Server Name should be "localhost"
    • Administrator Email can be anything (it is displayed in error pages)
    • Choose for All users, on Port 80, run as a service
    • Perform a Typical installation
    • Use the default location or specify some other directory

At this point "http://127.0.0.1" in your browser should show you a page saying It Works!.

Set up the MySQL server

NOTE: Windows Vista (and later) users may need to disable User Account Control (UAC) before installing MySQL.

Set up Python

  1. Download the Windows binary (MSI installer) listed in Current Kits above.
  2. Run the downloaded file.
    • Install for all users
    • You can take all of the defaults or make changes as you deem appropriate.
    • After the installation completes, add the Python installation directory to the system Path. (You may need to restart your machine for the System Path changes to take effect.)

NOTE: Without changes, the ISFDB build environment will construct scripts expecting to find \usr\bin\python.exe on the same drive as the Apache process' working directory (by default, the same drive onto which Apache was installed). You can either install Python into \usr\bin instead of the default location, or you can install elsewhere and then (from a Command Prompt or Cygwin window) mkdir \usr\bin and copy python.exe from the Python installation directory into it.

Install MySQLdb

MySQLdb is a Python module that allows a python script to interface with the MySQL database. It uses the MySQL libraries, so MySQL must be installed prior to this step. It is installed into the Python modules area, so Python must be installed prior to this step.

  1. Download the Windows binary (EXE) listed in Current Kits above. (Note that the versions of Python and MySQLdb should match.)
  2. Run the downloaded file. (If you get an "Unable to create Key" error message, you may need to right-click and choose Run as Administrator, even if the user you are logged in as has admin privileges.)
    • The Python installation just done above should be listed and selected.
    • Complete the installation

Python is now able to interact with the MySQL database.

Set up Unix Utilities

The ISFDB build process uses various Unix utilities (make, diff, etc.). There are several ports of GNU utilities to Windows available. For our purposes, Cygwin is the recommended package. Although it is heavier-weight than some other options, it provides the most complete environment and works well with the Unix-centric ISFDB build process.

  1. Download the setup.exe file listed in Current Kits above.
  2. Run this file.
    • Take the defaults, changing locations to suit your environment
    • Pick a mirror near you
    • In the Packages list, expand Devel and
      • Select "make" (not installed by default)
    • In the Packages list, expand Utils and
      • Select "diffutils" (not required)
    • Complete the installation. A desktop icon is not needed unless you want easy access to a shell environment.
  3. Add the Cygwin bin directory (e.g., C:\cygwin\bin) to your system Path. (You may need to restart your machine for the System Path changes to take effect.)

Typing make -v in a Command Prompt or Cygwin window should report "GNU Make 3.81" or a later version.

Download the ISFDB Source

Use your browser to download the latest version of the ISFDB software from SourceForge. Unpack it in the directory tree of your choice. For the purposes of these instruction we will assume that you will call the top level directory "isfdb".

Install the ISFDB

  1. Edit isfdb\common\localdefs.py:
       DBASE           = "isfdb"
       DBASEHOST       = "localhost"
       DO_ANALYTICS    = 0
       HTFAKE          = "cgi-bin" (if using IIS, this should be "cgi")
       HTMLHOST        = "127.0.0.1"
       HTMLHOST_ALT    = ""
       HTMLLOC         = "127.0.0.1"
       PASSWORD        = "the password" (the password you set up for MySQL)
       PROTOCOL        = "http"
       USERNAME        = "root"
       LEGACY_PASSWORDS= 1
       UNICODE         = "iso-8859-1"
       WIKILOC         = "www.isfdb.org/wiki (or 127.0.0.1/wiki if the ISFDB Wiki is installed locally)"
    

    NOTE: Do not use "localhost" for HTMLLOC and HTMLHOST. Doing so causes IE7 (and possibly other browsers) to decide to ignore the cookies delivered by the ISFDB software when you log in. Using "localhost" will result in the login's succeeding but then your still being in a "not logged in" state.

    • Note that HTMLHOST_ALT is normally set to an empty string for personal Web sites. You can set it to an alternative host name if using a real domain name as opposed to "127.0.0.1", e.g. "isfdb.org" if HTMLHOST is "www.isfdb.org".

    You will also need to access your ISFDB installation using the IP address for logging in to work. E.g., using:

      http://127.0.0.1/cgi-bin/index.cgi
    
  2. Then edit isfdb\INSTALLDIRS:
       INSTALL_CGI     = path to Apache's cgi-bin (or IIS' cgi)
       INSTALL_HTML    = path to Apache's htdocs (or IIS' wwwroot)
    

    NOTE: Several utilities do not handle directory names with spaces, parentheses, etc. Also, backslash is a special character to some of the utilities, while all GNU utility ports can map Unix-style forward slashes to Windows-style backslashes. So use 8.3 names and forward slashes. E.g.,

       INSTALL_CGI     = c:/PROGRA~1/APACHE~1/Apache2.2/cgi-bin
       INSTALL_HTML    = c:/PROGRA~1/APACHE~1/Apache2.2/htdocs
    
  3. Check the directory permissions on your INSTALL_CGI and INSTALL_HTML directories. You'll either need to do the install as a user that has permission to write there, or you'll need to modify the permissions on the directories.
  4. Then, in a Command Prompt or Cygwin window, execute:
        cd isfdb
        make -B install
    

    The "-B" is needed the first time or when adding a new file name to one of the TARGETS file. Without the "-B" you will get an error about not knowing how to build ".TARGETS". Subsequent rebuilds which do not add new file names to TARGETS files can use "make install", which is much faster.

  5. Place copies 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 a personal 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, in a Command Prompt or Cygwin window, execute:

  python isfdb\scripts\create_user.py LoginName password

replacing LoginName and password above with the actual login name and password you want to use on your local install. This will insert the login name and encrypted password into the correct tables.

Windows x64 Considerations

Some portions of the ISFDB environment can be set up using native Windows x64 variants instead of win32 (x86) files.

Mainstream x64 / EM64T/AMD64

Itanium / IA64

If your machine is Itanium (IA64 vs. AMD64/EM64T), you're on your own. Software availability for this platform is very limited, and you are probably best off sticking with the 32-bit versions of all of the packages.