Difference between revisions of "Installation"

From BioCASe Provider Software
Jump to: navigation, search
(Installing Additional Python Packages)
(Installing BioCASe from a Docker image)
 
(108 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This part of the wiki explains how to install the BioCASe Provider Software. Depending on your skills, it should take between 15 and 60 minutes. If you’re a beginner, please read the ___Introduction___ and the ___Beginner’s Guide___ first.
+
This part of the wiki explains how to install the BioCASe Provider Software. Depending on your skills, it should take between 15 and 60 minutes. If you’re a beginner, please read the [[BeginnersGuide|Beginner’s Guide]] first.
  
== Requirements ==
+
== Requirements and Considerations ==
Before installing, please make sure that the system you’re intending to install the BPS on meets the following requirements:
+
Before installing, please make sure that the system you’re intending to install the BPS on meets the following requirements (If you find out one of these items is not met, please ask your system administrator for help, read the [[FAQ]] or get in [[Special:Contact|contact with the BioCASe Team]].):
  
 
# You have administrative privileges on this machine, i.e. the user rights to install new software packages.
 
# You have administrative privileges on this machine, i.e. the user rights to install new software packages.
 
# It is accessible from outside your institution. This means it either needs to be outside any institutional firewall or, more likely, the HTTP port is open for an existing firewall.
 
# It is accessible from outside your institution. This means it either needs to be outside any institutional firewall or, more likely, the HTTP port is open for an existing firewall.
# A direct connection can be established from this machine to the database to be published – either because there’s no firewall in between, or the port used by the DBMS is open (e.g. 3306 for MySQL).
+
# A direct connection can be established from this machine to the database to be published – either because there’s no firewall in between, or the port used by the DBMS is open (e. g. 3306 for MySQL).
  
If you find out one of these items is not met, please ask your system administrator for help, read the ___FAQs___ or ___get in contact with the BioCASE Team___.
+
In addition to the regular installation, you can install BioCASe from a Docker image. Docker is an operating-system-level virtualization software that allows easy software deployment in so-called containers. If you don't know yet what Docker is, you should read the [https://docs.docker.com/get-started/ Get Started Guide]. '''If you're famliar with Docker, we'd suggest to use the Docker path for installing BioCASe''' - read more in section [[Installation#Installing_BioCASe_from_a_Docker_image | Installing from a Docker image]] below.'''
  
== Installing Apache/IIS and Python ==
+
== Installing BioCASe from a Docker image ==
 +
 
 +
Good choice! Installing BioCASe from a Docker image is much easer than installing the required components step-by-step. In addition, it's easier to update an existing installation. If you don't know yet what Docker is, you should read the [https://docs.docker.com/get-started/ Get Started Guide] first.
 +
 
 +
'''Important note:''' BioCASe requires Docker version 17 or later. If you already have Docker installed, run ''docker --version'' in a terminal and make sure the version number is 17+.
 +
 
 +
For installing BioCASe from the Docker image, please follow these steps:
 +
 
 +
# If you're not using Linux, install the ''make'' tool from https://gnuwin32.sourceforge.net/packages/make.htm.
 +
# Install Docker Community Edition (Docker CE). For detailed instructions, see [https://docs.docker.com/install/ About Docker CE] and choose the tutorial for your platform. To make sure Docker is properly installed, run ''docker --version'' in a terminal and make sure the version number is 17+.
 +
# Download the [http://ww2.biocase.org/svn/bps2/trunk/Makefile Makefile] that contains the commands for installing and updating BioCASe. Use "Save as..." to store it to your home folder on the server machine.
 +
# Open a terminal window and change the work directory to the location you've just saved the Makefile to. Then type in ''make install'' and press enter. This should download the latest BioCASe image, create a BioCASe container and run it.
 +
 
 +
Per default, Docker will use port 80 for BioCASe. If this port is already used by another application on your server, you can instruct Docker to use another port. For using port 8181, for example, type in ''make install PORT=8181'' instead:
 +
 
 +
[[File:DockerInstall.png|650px]]
 +
 
 +
Voilà, that's it! To check your BioCASe installation, use your Browser to go to ''http://localhost/biocase''. Don't forget to [[Installation#Changing_the_Default_Password | change the default password]].
 +
 
 +
You can also use the Makefile for stopping and starting the BioCASe container (for example, if you restart your server each night automatically) - just type ''make stop'' and ''make start''. For removing the container, use ''make remove'', for updating your BioCASe installation ''make update''.
 +
 
 +
'''Important note:''' The configuration and the log files of your BioCASe installation, as well as any XML and DwC archives created, will be stored in Docker hosted volumes. That means they are stored outside of the BioCASe container and will be preserved, even when the container is removed (actually, that's what happens if you update your installation). Docker hosted volumes are stored in the ''volumes'' folder of your docker installation, e.g. /var/lib/docker/volumes. If you want to backup the configuration of your BioCASe installation, just backup the folder /var/lib/docker/volumes/bps_config. To learn more about docker hosted volumes, please refer to the [https://docs.docker.com/storage/volumes/ Docker guide].
 +
 
 +
== Regular BioCASe Installation ==
 +
This is the path to choose if you haven't heard of [https://www.docker.com/ Docker] yet. If you have experience with this virtualisation software, we'd suggest to install BioCASe from the Docker image (instructions in section [[Installation#Installing_BioCASe_from_a_Docker_image | Installing from a Docker image]]).
 +
 
 +
BioCASe runs on both Windows and Linux machines. Two thoughts to consider for you:
 +
* If you want to use ODBC to connect to your database (for example to an Access database), you should make sure that an ODBC driver is available for the OS of your choice. For an Access database, for example, such a ODBC driver is available only for Windows - so you should go for Windows.
 +
* If you don't wanna use ODBC, because you plan to connect to a wide-spread DB system such as MySQL, Postgres or MS SQL Server, we recommend Linux (Debian).
 +
 
 +
=== Installing Apache/IIS and Python ===
 
If you’re using a Linux system, you probably don’t need to install either, since Apache and Python are usually preinstalled. Same holds true for MacOS, but you should have a look at one of the articles on the web to find out about the file locations.
 
If you’re using a Linux system, you probably don’t need to install either, since Apache and Python are usually preinstalled. Same holds true for MacOS, but you should have a look at one of the articles on the web to find out about the file locations.
  
Even though the BPS runs with both Apache and Internet Information Server (IIS), we recommend using Apache, which is much easier to configure. However, if you’re already using IIS, you might want to stick with that. Recommended Apache versions are 2.0 and 2.2.
+
Even though the BPS runs with both Apache and Internet Information Server (IIS), we recommend using Apache, which is much easier to configure. However, if you’re already using IIS, you might want to stick with that.
  
The BPS requires Python 2.5+ to run. Even though it also works with versions 2.6 and 2.7, the recommended Python version is 2.5. For later versions, the package required for connecting the BPS to the database used may be not available yet. You can go to the [http://ww3.bgbm.org/biocase/utilities/testlibs.cgi libs test page of the BGBM installation], find the package required for your DBMS and check out the availability for newer Python versions on the respective website (for example, the 4SuiteXML library required for running the Local Query Tool is currently only available for Python 2.5). By the way: You can install several different Python versions on the same machine without any conflicts.
+
The BPS requires Python 3.7+ to run, it doesn't work with Python 2, which ended its life cycle in 2020 (same is true for Python 3 versions < 3.7). On most Linux systems, Python 3 will be pre-installed. If not, you should be able to install Python using ''apt-get update'' and ''apt-get install python''. (By the way: You can install several different Python versions on the same machine without any conflicts.)
  
 
If you’re installing on a Windows Vista (poor you) or Windows 7 machine, we recommend not to install Apache in the default program files folder, since there is some magic spell on that which can get you into trouble when changing Apache’s configuration files. Just choose another path (Apache Software Foundation?) to spare that hassle.
 
If you’re installing on a Windows Vista (poor you) or Windows 7 machine, we recommend not to install Apache in the default program files folder, since there is some magic spell on that which can get you into trouble when changing Apache’s configuration files. Just choose another path (Apache Software Foundation?) to spare that hassle.
Line 21: Line 51:
 
Once you’ve successfully installed Apache and Python, you can proceed to the next step.
 
Once you’ve successfully installed Apache and Python, you can proceed to the next step.
  
== Downloading the Provider Software ==
+
=== Downloading the Provider Software ===
 
You can download the BPS either as a g-zipped archive or directly from our Subversion repository. First option is the easiest if you’re not familiar with Subversion; the second option makes it easier for you to update your installation later. So if you’ve never used Subversion before and plan not to keep your installation up-to-date, choose the archive. If you plan to set up a productive installation, which should be kept up-to-date, you should opt for the subversion repository.  
 
You can download the BPS either as a g-zipped archive or directly from our Subversion repository. First option is the easiest if you’re not familiar with Subversion; the second option makes it easier for you to update your installation later. So if you’ve never used Subversion before and plan not to keep your installation up-to-date, choose the archive. If you plan to set up a productive installation, which should be kept up-to-date, you should opt for the subversion repository.  
  
=== Downloading the Archive File ===
+
==== Downloading the Archive File ====
 
Just download the archive from the [http://www.biocase.org/products/provider_software Download section of the BioCASe site] and unpack the contents to the destination folder.
 
Just download the archive from the [http://www.biocase.org/products/provider_software Download section of the BioCASe site] and unpack the contents to the destination folder.
  
=== Downloading from the Subversion Repository ===
+
==== Downloading from the Subversion Repository ====
 
If you’re using Windows, you need to install a Subversion client first (try [http://tortoisesvn.net Tortoise], which comes with a nice user interface). Linux and MacOS usually have Subversion preinstalled.
 
If you’re using Windows, you need to install a Subversion client first (try [http://tortoisesvn.net Tortoise], which comes with a nice user interface). Linux and MacOS usually have Subversion preinstalled.
  
The URL for the latest stable version is http://ww2.biocase.org/svn/bps2/branches/stable, which we recommend to use. Updating your installation to the latest BPS version is then as easy as just running the Subversion update command. If you want to download a defined version, the URL would be http://ww2.biocase.org/svn/bps2/tags/release_2.6.0.
+
The URL for the latest stable version is http://ww2.biocase.org/svn/bps2/branches/stable, which we recommend to use. Updating your installation to the latest BPS version is then as easy as just running the Subversion update command. If you want to download a defined version, the URL would be http://ww2.biocase.org/svn/bps2/tags/release_3.8.0.
  
 
In order to download the BPS from subversion with the Subversion command line client (preinstalled on Linux/MacOS), just go to the destination and type in <pre>svn co http://ww2.biocase.org/svn/bps2/branches/stable biocase</pre>This will connect to our server with anonymous access and download all files to the folder ''biocase''. In case you’re using Tortoise on Windows, right-click on the destination in the Windows explorer and choose <small>Checkout</small>. Fill in the URL, change the destination folder name into something meaningful and press OK:
 
In order to download the BPS from subversion with the Subversion command line client (preinstalled on Linux/MacOS), just go to the destination and type in <pre>svn co http://ww2.biocase.org/svn/bps2/branches/stable biocase</pre>This will connect to our server with anonymous access and download all files to the folder ''biocase''. In case you’re using Tortoise on Windows, right-click on the destination in the Windows explorer and choose <small>Checkout</small>. Fill in the URL, change the destination folder name into something meaningful and press OK:
  
[[image:instTortoiseMenu.png|200px]][[image:instTortoiseDialog.png|500px]]
+
[[image:instTortoiseMenu.png|300px]][[image:instTortoiseDialog.png|450px]]
  
 
For the remainder of this guide, we will assume you’ve installed the BPS into a folder named ''biocase'', which should look like this by now:
 
For the remainder of this guide, we will assume you’ve installed the BPS into a folder named ''biocase'', which should look like this by now:
  
[[image:instBiocaseFolder.png]]
+
[[image:instBiocaseFolder.png|650px]]
  
== Running the Setup Script ==
+
=== Running the Setup Script ===
 
The setup script will initiate the configuration files with values you provide and point the script files to your Python installation (you can re-run the setup script in case that location changes). If you want to modify any of settings you made during the setup, you can change the values in the configuration tool later.
 
The setup script will initiate the configuration files with values you provide and point the script files to your Python installation (you can re-run the setup script in case that location changes). If you want to modify any of settings you made during the setup, you can change the values in the configuration tool later.
  
In order to run the script, open a terminal window (or “command prompt” in Windows). Change the working directory to the folder you’ve downloaded the BPS to (''biocase'') and type in (in case Python is not found, you’ll have to add the full path name to the Python executable):<pre>python setup.py</pre>Make sure the Python version given at the beginning out the output is the one you desire (otherwise add the path to the correct executable):
+
In order to run the script, open a terminal window (or “command prompt” in Windows). Change the working directory to the folder you’ve downloaded the BPS to (''biocase'') and type in:<pre>python setup.py</pre> In case Python is not found, you’ll have to add the full path name to the Python executable. Make sure the Python version given in the fifth line of the output is the one you desire (otherwise add the path to the correct executable):
 
 
[[image:instSetupScriptStart.png]]
 
  
All of the questions do have defaults. If you want to keep them, just press <small>Return</small>.  
+
[[image:instSetupScriptStart.png|550px]]
  
<strong>Import configuration from existing installation:</strong> Not implemented yet. Sorry. But this is easy to overcome: Just keep the defaults, then copy the configuration files manually.
+
The questions asked by the setup script do have defaults. If you want to keep them, just press <small>Return</small>.  
  
<strong>Webserver domain:</strong> This is the domain name of the web server you’re installing BioCASe on, e.g. ''http://www.foobar.org''.  You can keep the default ''localhost'' as long as you’re configuring and testing the installation locally; for production you’ll need to change that into the correct domain name (or IP address) later.
+
<strong>Webserver domain:</strong> This is the domain name of the web server you’re installing BioCASe on, e.g. ''http://www.myinstitution.org''.  You can keep the default ''localhost'' as long as you’re configuring and testing the installation locally; for production you’ll need to change that into the correct domain name (or IP address) later.
  
<strong>Base URL:</strong> This will become the second part of the URL your installation will use. If you keep the default biocase, your installation will be accessible later at ''www.foobar.org/biocase'', for example.
+
<strong>Base URL:</strong> This will become the second part of the URL your installation will use. If you keep the default biocase, your installation will be accessible later at ''www.myinstitution.org/biocase'', for example.
  
After answering these three questions, the script will update your files. At the end of the output it will print the lines you will need later to create the link, so do not close the window!  
+
After answering these two questions, the script will update your files. At the end of the output you can find the lines you'll need later to create the link between BioCASe and your web server, so do not close the window!  
  
[[image:instSetupScriptDone.png]]  
+
[[image:instSetupScriptDone.png|550px]]
  
== Linking BioCASe and Your Web Server ==
+
=== Linking BioCASe and Your Web Server ===
  
The public part of the provider software is stored in the ''www'' subfolder of your BioCASe installation and must be configured in your web server as a public folder. You should always make this folder public using a virtual directory: This means that you should never install BioCASe under the default root folder of your web server. Doing so will compromise your server security and will allow people to see your configuration files (which include passwords). So since we installed BioCASe in ''c:\biocase'', the folder that must be published with a virtual directory is ''c:\biocase\www'' and will be accessible later through ''http://www.foobar.org/biocase''.
+
The public part of the provider software is stored in the ''www'' subfolder of your BioCASe installation and must be configured in your web server as a public folder. You should always make this folder public using a virtual directory: This means that you should never install BioCASe under the default root folder of your web server. Doing so can compromise your server security and will allow people to see your configuration files (which include passwords). So since we installed BioCASe in ''c:\biocase'', the folder that must be published with a virtual directory is ''c:\biocase\www'' and will be accessible later through ''http://www.myinstitution.org/biocase''.
  
 +
==== Apache ====
 
If you use Apache, adding the BioCASe folder to your web server environment is as simple as copying the lines printed at the end of the setup script to the end of the Apache configuration file ''httpd.conf''. This can typically be found in the ''conf'' folder of your Apache installation. If you’re adding BioCASe to an already productive web server, please ask the server admin before doing any changes!
 
If you use Apache, adding the BioCASe folder to your web server environment is as simple as copying the lines printed at the end of the setup script to the end of the Apache configuration file ''httpd.conf''. This can typically be found in the ''conf'' folder of your Apache installation. If you’re adding BioCASe to an already productive web server, please ask the server admin before doing any changes!
  
[[image:instHttpdConf.png]]  
+
[[image:instHttpdConf.png|550px]]  
  
 
Save the file and restart Apache for the changes to take effect.
 
Save the file and restart Apache for the changes to take effect.
  
If you use Internet Information Server, you need to create a virtual directory for the folder ''c:\biocase\www'' using the IIS Server Manager. Grant all rights for this directory (Read, Write, Script Execution, Directory listing) and use the <small>Configure</small> button on the virtual directory tab and associate the file extensions .cgi and .py with Python. You should also add ''index.html'' to the list of default documents (<small>Virtual Directory > Properties > Documents > Default</small>).
+
==== Internet Information Server ====
 +
 
 +
If you use Internet Information Server, you need to create a virtual directory for the folder ''c:\biocase\www'' using the IIS Server Manager. Grant all rights for this directory (Read, Write, Script Execution, Directory listing). You should also add ''index.html'' to the list of default documents (<small>Virtual Directory > Properties > Documents > Default</small>).
 +
 
 +
In order to associate Python scripts with Python in IIS 5/6, you need to use the <small>Configure</small> button on the virtual directory tab and associate the file extensions .cgi and .py with Python (see screenshot below). In IIS 7, you can open this dialog by choosing <small>Add Script Map</small>. Note the placeholders ''%s %s'' after the Python executable!
 +
 
 +
[[File:instAddScriptMap.png|330px]]
  
We know that configuring Python for IIS can be cumbersome; however, there are several good tutorials on the web, for example
+
If you run into problems configuring IIS, you should have a look at the tutorials available on the web, for example
* http://www.ecp.cc/pyiis.html
+
* http://haishibai.blogspot.de/2011/02/setting-up-python-on-iis-7_01.html
 
* http://support.microsoft.com/kb/276494
 
* http://support.microsoft.com/kb/276494
* http://python.markrowsoft.com/iiswse.asp
+
 
 +
==== Testing the Link ====
  
 
Once you’re done, you can test your BioCASe Installation by opening a browser and typing in ''http://localhost/biocase'' (replace ''localhost'' with the domain name of the machine you installed BioCASe on, if you’re not working locally). You should then see the start page of the BPS:
 
Once you’re done, you can test your BioCASe Installation by opening a browser and typing in ''http://localhost/biocase'' (replace ''localhost'' with the domain name of the machine you installed BioCASe on, if you’re not working locally). You should then see the start page of the BPS:
  
[[image:instBiocaseStartpage.png]]
+
[[image:instBiocaseStartpage.png|550px]]
  
== Installing Additional Python Packages ==
+
=== Installing Additional Python Packages/Java/Graphviz ===
  
Before you can start configuring your installation, you need to install additional packages, depending on the DBMS used by the database to be published and the functions of the BPS you intend to use.
+
Before you can start configuring your installation, you need to install additional packages, depending on the management system used for the database to be published and the functions of the BPS you intend to use.
  
On the BPS start page, click on <small>Utilities</small>, then <small>library test</small> in order to navigate to he library test page that shows the status of installed libraries. On a vanilla BPS installation, it should look similar to this:
+
On the BPS start page, click on <small>Utilities</small>, then <small>library test</small> in order to navigate to the library test page that shows the status of installed libraries. On a fresh BPS installation, only the BioCASe libraries should be installed, since they're part of the archive file you’ve downloaded (or the Subversion repository you checked out from):
  
[[image:instLibrariesVanilla.png]]
+
[[image:instLibrariesVanilla.png|550px]]
  
The BioCASe libraries ship with the archive file you’ve downloaded (or the Subversion repository you checked out from). The 4SuiteXML library is required only for the Local Query Tool – if you don’t plan to use it, you can ignore it. Otherwise click on the Download link, find the installer appropriate for your operating system and install it.
+
If you plan to use the Local Query Tool (a small portal for querying and browsing your BioCASe webservice), you need to install the lxml library. You can do this easily by running the Python Package Installer (PIP): ''pip install lxml''.
  
For each DBMS you plan to use with BioCASe (i.e. you have a database you want to publish with BioCASe), you’ll have to install the corresponding package. So if your collection is stored in a MySQL database, for example, click on the download link for the MySQL module, find the correct installer for your Python version and operating system and install. Once the installation is done, after reloading the libraries test page in the browser, the according list entry should turn from an orange ‘not installed’ into a green version number. Redo this process for all DBMS you want to connect to.
+
For each DBMS you plan to use with BioCASe (i.e. you have a database you want to publish with BioCASe), you’ll have to install the corresponding package. So if your collection is stored in a MySQL database, you'll need the MySQLdb library; the table shows you the command to run for installing it using pip: ''pip install mysqlclient''. Once pip has installed the package, reload the libraries test page. The according list entry should turn from an orange ''not installed'' into a green version number. Redo this process for all DBMS you want to connect to.
  
The Graphviz library listed under optional external binaries is used by the BPS to create a graph of your database’s data model in the table setup (you will learn in the configuration How To about this). If the data model is very simple (i.e., not more than 3 or 4 tables), you probably can spare the effort of installing Graphviz. Otherwise we recommend installing it: Simply click on the Download link, find the correct installer, and… you know the story.
+
The Graphviz library listed under optional external binaries is used by the BPS to create a graph of your database’s data model in the table setup (you will learn in the [[DatasourceSetup#Setting_up_the_Database_Structure|Table Setup]] about this). If the data model is very simple (i.e., not more than 3 or 4 tables), you probably can spare the effort of installing Graphviz. Otherwise we recommend installing it: Simply click on the Download link and install the package using an installer file or a package manager on Linux.
  
==Changing the Default Password==
+
If you want to create DarwinCore Archives for your web services, you also need to install a Java Runtime Environment (JRE). BioCASe requires Java 1.8 or later for creating DarwinCore archives, so please check the version listed on the Testlibs page if it's already installed on the server.
 +
 
 +
=== Changing the Default Password ===
  
 
The configuration tool is a browser interface that allows you to configure almost every aspect of the BPS. As a last step of the setup, you should change the password.
 
The configuration tool is a browser interface that allows you to configure almost every aspect of the BPS. As a last step of the setup, you should change the password.
  
Go back to the Start page of the BPS (by clicking “Start” at the top of the page, or by retyping http://localhost/biocase in the browser window), choose “Config Tool”, then “System Administration”. You will then be prompted for a password. Type in the default ACDC, then click “Submit”.
+
Go back to the Start page of the BPS (by clicking <small>Start</small> at the top of the page, or by retyping ''http://localhost/biocase'' if the server is running on your computer), choose <small>Config Tool</small>, then <small>System Administration</small>. You will then be prompted for a password. Type in the default ''ACDC'', then click <small>Submit</small>.
  
 
The top of the configuration page you’ll be directed to should look similar to this:
 
The top of the configuration page you’ll be directed to should look similar to this:
 
  
In the first two lines, you’ll see the values you entered during the setup script (in this case, the defaults localhost and biocase). In the fourth line, enter a new password. Please be careful when typing (if you forget the password some day, you can reset it by directly editing the configuration file). Press “update config” to save the new password to the configuration file.
+
[[image:instConfigTool.png|500px]]
  
In case you’ve installed Graphviz, you need to tell the BPS the location of the binaries, since it is not a Python package that will be registered automatically. In order to do so, locate the Graphviz installation on your local disk and enter the path to the binary executable into the text box labelled “Graphviz dot binary”. On Linux machines it might look similar to the default (/usr/local/bin/dot), on Windows machines it will be probably something like C:\Program Files\Graphviz2.26.3\bin\dot.exe. Press “update config” to save the path.
+
In the first two lines, you’ll see the values you entered during the setup script (in this case, the defaults ''localhost'' and ''biocase''). In the fourth line, enter a new password. Please be careful when typing (if you forget the password some day, you can reset it by directly editing the configuration file). Press <small>update config</small> to save the new password to the configuration file.
  
==Checking Your Installation==
+
In case you’ve installed Graphviz, you need to tell the BPS the location of the binaries, since it is not a Python package that will be registered automatically. In order to do so, locate the Graphviz installation on your local disk and enter the path to the binary executable into the text box labelled <small>Path to Graphviz executable</small>. On Linux machines it might look similar to the default (''/usr/local/bin/dot''), on Windows machines it will be probably something like ''C:/Program Files/Graphviz 2.44.1/bin/''. Press <small>update config</small> to save the path.
 +
 
 +
=== Checking Your Installation ===
  
 
Before you proceed to the configuration, you should make sure everything is installed correctly:
 
Before you proceed to the configuration, you should make sure everything is installed correctly:
  
1. Typing in http://localhost/biocase (or the appropriate values of your installation) takes you to the entry page of the provider software (as shown here)
+
# Typing in ''http://localhost/biocase'' (or the appropriate values of your installation) takes you to the entry page of the provider software (as shown in the section [[#Linking_BioCASe_and_Your_Web_Server|Linking BioCASe and Your Web Server]]).
 +
# The libraries test page (<small>Utilities > library test</small>) shows you’ve installed the packages for your DBMS, lxml (if you want to use the Local Query Tool), Java (if you want to create DarwinCore Archives) and the Graphviz dot (if you decided so).
 +
# <small>Status of writeable directories</small> shows a green <small>writeable</small> for all four directories. If not, the path to problematic file will be given – please grant write access to Python.
 +
 
 +
If you want to connect BioCASe to a variety of different database management systems, create DarwinCore archives and use the QueryTool, the libraries test pages should look like this:
 +
 
 +
[[image:instLibrariesDone.png|650px]]
 +
 
 +
== Updating an existing BioCASe Installation ==
 +
 
 +
=== Updating a BioCASe Docker installation ===
 +
This is very simple with the [http://ww2.biocase.org/svn/bps2/trunk/Makefile Makefile] you downloaded for installing BioCASe. Just go to the folder where you stored the file and run ''make update''. This will stop and remove the BioCASe container, download the latest BioCASe image and create/start a new BioCASe container. Since the configuration files are not stored within the container, all your data sources will be preserved.
 +
 
 +
=== Updating a regular BioCASe installation ===
 +
 
 +
'''<u>Important Note</u>''': If you have a running BioCASe installation, you shouldn’t touch it until you’ve successfully installed a new version. So keep the old installation instead of replacing it!
 +
 
 +
==== Updating from version 2.5 or later ====
  
2. The libraries test page (Utilities/library test) shows you’ve installed the packages for you DBMS, 4SuiteXML (if you want to use the Local Query Tool) and the Graphviz Dot (if you decided so).
+
# Rename the folder of the old installation to something meaningful, for example ''biocase_old'', and memorise its old name. By doing this, you can always revert to this working version.
 +
# Download the new version as described above into a directory with the name you just memorised.
 +
# Change directory to the new installation and run setup script. When asked whether to import the configuration from an old installation, answer yes. The setup script will now import the configuration of the old installation, including the data sources.
 +
# Done! [[Installation#Checking_Your_Installation|Try out your new installation]] to make sure it is working.
  
3. “Status of writeable directories” shows a green writeable for both the Logs and the Configuration. If not, the path to problematic file will be given – please grant write access to Python.
+
==== Updating from older versions < 2.5 ====
  
Let’s assume you want to use BioCASe in conjunction with a MySQL and an Access database (which will be connected to through ODBC) and you don’t care for the Query Tool, the libs page should look like this:
+
# Rename the folder of the old installation to something meaningful, for example ''biocase_old'', and memorise its old name. By doing this, you can always revert to this working version; moreover, you will need the configuration files later.
 +
# Download the new version as described above into a directory with the name you just memorised.
 +
# [[Installation#Running_the_Setup_Script|Run the setup script]]. When asked whether to import the configuration from an old installation, just press Return (defaults to no). Make sure to provide the the same base URL that was used by the old installation (for example ''/biocase'').
 +
# [[Installation#Changing_the_Default_Password|Change the default password]] of the new installation to the one you used in the old installation.
 +
# Open the file ''config/config.ini'' of your old installation in a text editor. Open the config tool of the new installation and navigate to the System Administration page. Compare the settings in the section <small>Server configuration</small> with the values you can find in the old configuration file and change them, if necessary (leave values unchanged if you don't find them in the old file). Press <small>Update config</small>.
 +
# Last, copy the configuration of the BioCASe web services: Open the folder ''config/datasources'' of your old installation and copy all subfolders to ''config/datasources'' of your new installation.
 +
# Done! [[Installation#Checking_Your_Installation|Try out your new installation]] to make sure it is working.

Latest revision as of 14:55, 11 June 2024

This part of the wiki explains how to install the BioCASe Provider Software. Depending on your skills, it should take between 15 and 60 minutes. If you’re a beginner, please read the Beginner’s Guide first.

Requirements and Considerations

Before installing, please make sure that the system you’re intending to install the BPS on meets the following requirements (If you find out one of these items is not met, please ask your system administrator for help, read the FAQ or get in contact with the BioCASe Team.):

  1. You have administrative privileges on this machine, i.e. the user rights to install new software packages.
  2. It is accessible from outside your institution. This means it either needs to be outside any institutional firewall or, more likely, the HTTP port is open for an existing firewall.
  3. A direct connection can be established from this machine to the database to be published – either because there’s no firewall in between, or the port used by the DBMS is open (e. g. 3306 for MySQL).

In addition to the regular installation, you can install BioCASe from a Docker image. Docker is an operating-system-level virtualization software that allows easy software deployment in so-called containers. If you don't know yet what Docker is, you should read the Get Started Guide. If you're famliar with Docker, we'd suggest to use the Docker path for installing BioCASe - read more in section Installing from a Docker image below.

Installing BioCASe from a Docker image

Good choice! Installing BioCASe from a Docker image is much easer than installing the required components step-by-step. In addition, it's easier to update an existing installation. If you don't know yet what Docker is, you should read the Get Started Guide first.

Important note: BioCASe requires Docker version 17 or later. If you already have Docker installed, run docker --version in a terminal and make sure the version number is 17+.

For installing BioCASe from the Docker image, please follow these steps:

  1. If you're not using Linux, install the make tool from https://gnuwin32.sourceforge.net/packages/make.htm.
  2. Install Docker Community Edition (Docker CE). For detailed instructions, see About Docker CE and choose the tutorial for your platform. To make sure Docker is properly installed, run docker --version in a terminal and make sure the version number is 17+.
  3. Download the Makefile that contains the commands for installing and updating BioCASe. Use "Save as..." to store it to your home folder on the server machine.
  4. Open a terminal window and change the work directory to the location you've just saved the Makefile to. Then type in make install and press enter. This should download the latest BioCASe image, create a BioCASe container and run it.

Per default, Docker will use port 80 for BioCASe. If this port is already used by another application on your server, you can instruct Docker to use another port. For using port 8181, for example, type in make install PORT=8181 instead:

DockerInstall.png

Voilà, that's it! To check your BioCASe installation, use your Browser to go to http://localhost/biocase. Don't forget to change the default password.

You can also use the Makefile for stopping and starting the BioCASe container (for example, if you restart your server each night automatically) - just type make stop and make start. For removing the container, use make remove, for updating your BioCASe installation make update.

Important note: The configuration and the log files of your BioCASe installation, as well as any XML and DwC archives created, will be stored in Docker hosted volumes. That means they are stored outside of the BioCASe container and will be preserved, even when the container is removed (actually, that's what happens if you update your installation). Docker hosted volumes are stored in the volumes folder of your docker installation, e.g. /var/lib/docker/volumes. If you want to backup the configuration of your BioCASe installation, just backup the folder /var/lib/docker/volumes/bps_config. To learn more about docker hosted volumes, please refer to the Docker guide.

Regular BioCASe Installation

This is the path to choose if you haven't heard of Docker yet. If you have experience with this virtualisation software, we'd suggest to install BioCASe from the Docker image (instructions in section Installing from a Docker image).

BioCASe runs on both Windows and Linux machines. Two thoughts to consider for you:

  • If you want to use ODBC to connect to your database (for example to an Access database), you should make sure that an ODBC driver is available for the OS of your choice. For an Access database, for example, such a ODBC driver is available only for Windows - so you should go for Windows.
  • If you don't wanna use ODBC, because you plan to connect to a wide-spread DB system such as MySQL, Postgres or MS SQL Server, we recommend Linux (Debian).

Installing Apache/IIS and Python

If you’re using a Linux system, you probably don’t need to install either, since Apache and Python are usually preinstalled. Same holds true for MacOS, but you should have a look at one of the articles on the web to find out about the file locations.

Even though the BPS runs with both Apache and Internet Information Server (IIS), we recommend using Apache, which is much easier to configure. However, if you’re already using IIS, you might want to stick with that.

The BPS requires Python 3.7+ to run, it doesn't work with Python 2, which ended its life cycle in 2020 (same is true for Python 3 versions < 3.7). On most Linux systems, Python 3 will be pre-installed. If not, you should be able to install Python using apt-get update and apt-get install python. (By the way: You can install several different Python versions on the same machine without any conflicts.)

If you’re installing on a Windows Vista (poor you) or Windows 7 machine, we recommend not to install Apache in the default program files folder, since there is some magic spell on that which can get you into trouble when changing Apache’s configuration files. Just choose another path (Apache Software Foundation?) to spare that hassle.

Once you’ve successfully installed Apache and Python, you can proceed to the next step.

Downloading the Provider Software

You can download the BPS either as a g-zipped archive or directly from our Subversion repository. First option is the easiest if you’re not familiar with Subversion; the second option makes it easier for you to update your installation later. So if you’ve never used Subversion before and plan not to keep your installation up-to-date, choose the archive. If you plan to set up a productive installation, which should be kept up-to-date, you should opt for the subversion repository.

Downloading the Archive File

Just download the archive from the Download section of the BioCASe site and unpack the contents to the destination folder.

Downloading from the Subversion Repository

If you’re using Windows, you need to install a Subversion client first (try Tortoise, which comes with a nice user interface). Linux and MacOS usually have Subversion preinstalled.

The URL for the latest stable version is http://ww2.biocase.org/svn/bps2/branches/stable, which we recommend to use. Updating your installation to the latest BPS version is then as easy as just running the Subversion update command. If you want to download a defined version, the URL would be http://ww2.biocase.org/svn/bps2/tags/release_3.8.0.

In order to download the BPS from subversion with the Subversion command line client (preinstalled on Linux/MacOS), just go to the destination and type in
svn co http://ww2.biocase.org/svn/bps2/branches/stable biocase
This will connect to our server with anonymous access and download all files to the folder biocase. In case you’re using Tortoise on Windows, right-click on the destination in the Windows explorer and choose Checkout. Fill in the URL, change the destination folder name into something meaningful and press OK:

InstTortoiseMenu.pngInstTortoiseDialog.png

For the remainder of this guide, we will assume you’ve installed the BPS into a folder named biocase, which should look like this by now:

InstBiocaseFolder.png

Running the Setup Script

The setup script will initiate the configuration files with values you provide and point the script files to your Python installation (you can re-run the setup script in case that location changes). If you want to modify any of settings you made during the setup, you can change the values in the configuration tool later.

In order to run the script, open a terminal window (or “command prompt” in Windows). Change the working directory to the folder you’ve downloaded the BPS to (biocase) and type in:
python setup.py
In case Python is not found, you’ll have to add the full path name to the Python executable. Make sure the Python version given in the fifth line of the output is the one you desire (otherwise add the path to the correct executable):

InstSetupScriptStart.png

The questions asked by the setup script do have defaults. If you want to keep them, just press Return.

Webserver domain: This is the domain name of the web server you’re installing BioCASe on, e.g. http://www.myinstitution.org. You can keep the default localhost as long as you’re configuring and testing the installation locally; for production you’ll need to change that into the correct domain name (or IP address) later.

Base URL: This will become the second part of the URL your installation will use. If you keep the default biocase, your installation will be accessible later at www.myinstitution.org/biocase, for example.

After answering these two questions, the script will update your files. At the end of the output you can find the lines you'll need later to create the link between BioCASe and your web server, so do not close the window!

InstSetupScriptDone.png

Linking BioCASe and Your Web Server

The public part of the provider software is stored in the www subfolder of your BioCASe installation and must be configured in your web server as a public folder. You should always make this folder public using a virtual directory: This means that you should never install BioCASe under the default root folder of your web server. Doing so can compromise your server security and will allow people to see your configuration files (which include passwords). So since we installed BioCASe in c:\biocase, the folder that must be published with a virtual directory is c:\biocase\www and will be accessible later through http://www.myinstitution.org/biocase.

Apache

If you use Apache, adding the BioCASe folder to your web server environment is as simple as copying the lines printed at the end of the setup script to the end of the Apache configuration file httpd.conf. This can typically be found in the conf folder of your Apache installation. If you’re adding BioCASe to an already productive web server, please ask the server admin before doing any changes!

InstHttpdConf.png

Save the file and restart Apache for the changes to take effect.

Internet Information Server

If you use Internet Information Server, you need to create a virtual directory for the folder c:\biocase\www using the IIS Server Manager. Grant all rights for this directory (Read, Write, Script Execution, Directory listing). You should also add index.html to the list of default documents (Virtual Directory > Properties > Documents > Default).

In order to associate Python scripts with Python in IIS 5/6, you need to use the Configure button on the virtual directory tab and associate the file extensions .cgi and .py with Python (see screenshot below). In IIS 7, you can open this dialog by choosing Add Script Map. Note the placeholders %s %s after the Python executable!

InstAddScriptMap.png

If you run into problems configuring IIS, you should have a look at the tutorials available on the web, for example

Testing the Link

Once you’re done, you can test your BioCASe Installation by opening a browser and typing in http://localhost/biocase (replace localhost with the domain name of the machine you installed BioCASe on, if you’re not working locally). You should then see the start page of the BPS:

InstBiocaseStartpage.png

Installing Additional Python Packages/Java/Graphviz

Before you can start configuring your installation, you need to install additional packages, depending on the management system used for the database to be published and the functions of the BPS you intend to use.

On the BPS start page, click on Utilities, then library test in order to navigate to the library test page that shows the status of installed libraries. On a fresh BPS installation, only the BioCASe libraries should be installed, since they're part of the archive file you’ve downloaded (or the Subversion repository you checked out from):

InstLibrariesVanilla.png

If you plan to use the Local Query Tool (a small portal for querying and browsing your BioCASe webservice), you need to install the lxml library. You can do this easily by running the Python Package Installer (PIP): pip install lxml.

For each DBMS you plan to use with BioCASe (i.e. you have a database you want to publish with BioCASe), you’ll have to install the corresponding package. So if your collection is stored in a MySQL database, you'll need the MySQLdb library; the table shows you the command to run for installing it using pip: pip install mysqlclient. Once pip has installed the package, reload the libraries test page. The according list entry should turn from an orange not installed into a green version number. Redo this process for all DBMS you want to connect to.

The Graphviz library listed under optional external binaries is used by the BPS to create a graph of your database’s data model in the table setup (you will learn in the Table Setup about this). If the data model is very simple (i.e., not more than 3 or 4 tables), you probably can spare the effort of installing Graphviz. Otherwise we recommend installing it: Simply click on the Download link and install the package using an installer file or a package manager on Linux.

If you want to create DarwinCore Archives for your web services, you also need to install a Java Runtime Environment (JRE). BioCASe requires Java 1.8 or later for creating DarwinCore archives, so please check the version listed on the Testlibs page if it's already installed on the server.

Changing the Default Password

The configuration tool is a browser interface that allows you to configure almost every aspect of the BPS. As a last step of the setup, you should change the password.

Go back to the Start page of the BPS (by clicking Start at the top of the page, or by retyping http://localhost/biocase if the server is running on your computer), choose Config Tool, then System Administration. You will then be prompted for a password. Type in the default ACDC, then click Submit.

The top of the configuration page you’ll be directed to should look similar to this:

InstConfigTool.png

In the first two lines, you’ll see the values you entered during the setup script (in this case, the defaults localhost and biocase). In the fourth line, enter a new password. Please be careful when typing (if you forget the password some day, you can reset it by directly editing the configuration file). Press update config to save the new password to the configuration file.

In case you’ve installed Graphviz, you need to tell the BPS the location of the binaries, since it is not a Python package that will be registered automatically. In order to do so, locate the Graphviz installation on your local disk and enter the path to the binary executable into the text box labelled Path to Graphviz executable. On Linux machines it might look similar to the default (/usr/local/bin/dot), on Windows machines it will be probably something like C:/Program Files/Graphviz 2.44.1/bin/. Press update config to save the path.

Checking Your Installation

Before you proceed to the configuration, you should make sure everything is installed correctly:

  1. Typing in http://localhost/biocase (or the appropriate values of your installation) takes you to the entry page of the provider software (as shown in the section Linking BioCASe and Your Web Server).
  2. The libraries test page (Utilities > library test) shows you’ve installed the packages for your DBMS, lxml (if you want to use the Local Query Tool), Java (if you want to create DarwinCore Archives) and the Graphviz dot (if you decided so).
  3. Status of writeable directories shows a green writeable for all four directories. If not, the path to problematic file will be given – please grant write access to Python.

If you want to connect BioCASe to a variety of different database management systems, create DarwinCore archives and use the QueryTool, the libraries test pages should look like this:

InstLibrariesDone.png

Updating an existing BioCASe Installation

Updating a BioCASe Docker installation

This is very simple with the Makefile you downloaded for installing BioCASe. Just go to the folder where you stored the file and run make update. This will stop and remove the BioCASe container, download the latest BioCASe image and create/start a new BioCASe container. Since the configuration files are not stored within the container, all your data sources will be preserved.

Updating a regular BioCASe installation

Important Note: If you have a running BioCASe installation, you shouldn’t touch it until you’ve successfully installed a new version. So keep the old installation instead of replacing it!

Updating from version 2.5 or later

  1. Rename the folder of the old installation to something meaningful, for example biocase_old, and memorise its old name. By doing this, you can always revert to this working version.
  2. Download the new version as described above into a directory with the name you just memorised.
  3. Change directory to the new installation and run setup script. When asked whether to import the configuration from an old installation, answer yes. The setup script will now import the configuration of the old installation, including the data sources.
  4. Done! Try out your new installation to make sure it is working.

Updating from older versions < 2.5

  1. Rename the folder of the old installation to something meaningful, for example biocase_old, and memorise its old name. By doing this, you can always revert to this working version; moreover, you will need the configuration files later.
  2. Download the new version as described above into a directory with the name you just memorised.
  3. Run the setup script. When asked whether to import the configuration from an old installation, just press Return (defaults to no). Make sure to provide the the same base URL that was used by the old installation (for example /biocase).
  4. Change the default password of the new installation to the one you used in the old installation.
  5. Open the file config/config.ini of your old installation in a text editor. Open the config tool of the new installation and navigate to the System Administration page. Compare the settings in the section Server configuration with the values you can find in the old configuration file and change them, if necessary (leave values unchanged if you don't find them in the old file). Press Update config.
  6. Last, copy the configuration of the BioCASe web services: Open the folder config/datasources of your old installation and copy all subfolders to config/datasources of your new installation.
  7. Done! Try out your new installation to make sure it is working.