Installation Guide for TAPIR PyWrapper draft release 2.0
Others docs available are: DraftConfigurationFiles
- Installing and running the PyWrapper
- Requiredconfiguration
- Getting the software and extracting it
- Setting up a public folder in your webserver
- Installing python
- Configure your webserver for python CGIs
- Modify the PyWrapper configuration file
- Test your python installation and virtual directory
- Run the adaptation tool for windows or unix
- Install third party packages
Installing and running the PyWrapper
This document describes the steps that are required to setup and configure your system to run the PyWrapper.
Required configuration
The PyWrapper runs on the following platforms
- Any CGI compliant web server: Apache, IIS, etc.
- Databases: currently only MySQL and PostgreSQL are supported, but there will soon be drivers for Oracle, SQLServer, Sybase, Access, Firebird, SQLite and others. Theoretically any database with a Python library should work.
- Python 2.3 or above installed on the server.
Getting the software package and extracting it
Please connect to the subversion repository directly and obtain the latest stable version from there:
svn export http://ww2.biocase.org/svn/tapir/branches/stable/
Alternatively the distribution is also provided as a simple archive (.tgz) to be extracted into wherever you want on your server. See the VersionHistory? for downloads.
/!\ Please note that the preferred method for now is to connect to the code repository directly (see below). The archives are not updated regularely, so to get the latest version please use subversion!
For example install it into C:\pywrapper . After decompressing it you will see the next structure
Setting up a public folder in your web server
The public part of the provider software that must be configured in your web server is the www folder. You should always make this folder public using a virtual directory. This means that you should never install the software 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 if you install your software in C:\pywrapper then the folder that must be published with a Virtual directory is C:\pywrapper\www and will be accessible trough http://localhost/pywrapper/
Of course this is just an example, install it wherever you want and give it the name you like.
Installing Python
First of all, you will have to download the Python interpreter. Go to http://www.python.org/download/ and download the latest 2.3.x version of Python available for your operating system. Python 2.4.x is very likely to work also, but hasn't been extensively tested. At the time of writing, the latest version of Python is "2.3.5" and the PyWrapper is known to work correctly with that version. When you have finished downloading Python you have to install it.
Install Python on Windows:
In Windows you will just use the windows installer that is very easy, follow our explanation below. For Unix please read the installation instructions. We recommend that in Windows you install Python in the proposed location.
All configurations are fine by default. The Python installation should run without problems.
Install Python on Unix:
In Unix you don't have to care about this, just install Python the way it is described in its installation instructions. The PyWrapper is prepared to find the Python interpreter with /usr/bin/env python. If you change the location of the Python interpreter and it is not accessible like this then you will have to modify the preferred shebang “#!” line in the adapt2unix.py tools script.
Configure your Webserver for Python CGIs
In order to use Python as a scripting language for CGIs, you have to tell your webserver where to find your Python installation and how to identify a Python CGI script. The procedure to do so is very much dependent upon your operating system, on the kind of webserver and how you installed your webserver.
Using Python with IIS
There are several tutorials on Internet about how to configure IIS for Python scripts check:
- http://www.urbanware.com/python/pythonIIS.html
- http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494
You should also set index.html to the list of default documents if it is not allready added (virtual directory; properties; documents; default documents).
Using Python with Apache
If you have an already existing installation of Apache, ask the IT responsible person for help. In case you have a fresh installation, it should be sufficient to add the following lines of code to the end of the httpd.conf configuration file in your Apache installation (also see biocase/examples/apache/httpd-biocase.conf):
AddHandler cgi-script .cgi Alias /pywrapper "c:/pywrapper/www" <Directory "C:/pywrapper/www"> Order Deny,Allow Allow from all Options +ExecCGI AllowOverride All </Directory>
Adjust the path C:/pywrapper/www to point your PyWrapper folder (see above). You need this to allow Apache to execute CGIs in your wrapper instance folder.
Remember to restart Apache so that the changes take place.
Modify the PyWrapper configuration file
Go to c:\pywrapper\configuration\ (modify according to your installation) and edit the file .configuration with any text editor (for example Notepad).
You will find two lines you have to adapt to your installation:
host = 'http://localhost' webroot = '/pywrapper'
To for example:
host = 'http://ww3.bgbm.org' webroot = '/pywrapper'
Test your Python installation and virtual directory
Now you will test your Python installation and install other software that is needed.
Go to http://localhost/pywrapper
You should already see something like this:
If you do not see something like this probably you have a problem with the configuration of Python for your Web server. Go back and check the configuration.
Run the adaptation tool for Windows or Unix
There is also another thing that you must do to successfully complete the installation. There is a program under /pywrapper/tools called adapt2unix.py and another called adapt2win.py. Run it depending on what operating system you are using. It will adjust permissions and break lines depending in what operating system you are installing the software.
In Windows you should be able to just double click on the icon. In unix you should execute the script with the help of python like this (assuming your current working directory is the tools folder): python adapt2unix.py
Install Third Party Packages
Now that Python is running as a CGI the next step is to install and test other necessary libraries. In the main web page were you were already click on the Utilities box.
This utilities page is there for helping you debugging problems with the software installation. We will skip most of the text. Click on the Test your Python CGI installation Part 2 link. You can optionally go directly to it at http://localhost/pywrapper/utilities/testlibs.cgi
You should see something like this:
As you see things that are in red are mandatory libraries to install, in orange depends on your database and in green is Ok.
You will have to go one by one downloading the necessary libraries and installing them.
The link to the official web page is provided on the right. We recommend you to open in a different window the links, download the file, install it, go back to this page and refresh to see that the library has been correctly installed. At the end you should not see anything in red.
The installation of the libraries depends on your operating systems.
- Unix: Download the packages, uncompress them in temporary folders and then execute for each one: python setup.py install from within the folders.
- Windows: After downloading it into a temporary folder, just double click on the installer and click several times ok in following windows.
Sometimes it may be difficult to find the correct file to download in the different library sites. If you do not manage to find them please contact us and we will help you.
Notice: We ask you to download the libraries from external sites because in this way you will always get the latest version and you can find related infor
Attachments
- folders.gif (11.2 kB) - added by markus 3 years ago.
- libraries.jpg (96.8 kB) - added by markus 3 years ago.
- main_page.jpg (71.2 kB) - added by markus 3 years ago.


