Installing TestLog Web Access (CGI)

Top  Previous  Next

Setting Up TestLog Web Access

 

The CGI version of TestLog is included in the normal TestLog installer, if you browse to where TestLog was installed through explorer (default C:\Program Files\TestLog) there will be CGI directory that contains TestLogCGI.cgi and cgiconfig.cfg. These files will need to be placed in a directory on your web server that supports script and executable execution and you will then need to edit the cgiconfig.cfg file to set up the location of the directories TestLog will need and the databases that will be viewable via the web server. TestLogCGI.cgi is a Windows executable and as such will only work on machines running Windows and using Apache, IIS (version 5.1 or higher) or other Windows web servers.

 

Installing TestLog Web Access on will require knowledge and experience with IIS or Apache and Windows security permissions.

 

Installing on IIS (Version 5.1 or higher)

 

Create a TestLog directory in the document root folder (eg C:\Inetpub\wwwroot\TestLog)
Copy the TestLogCGI.cgi and cgiconfig.cfg from the TestLog install directory (default C:\Program Files\TestLog\CGI\) to the previously created TestLog folder.
Copy the "Images" and "Help" directories from the TestLog  install directory (default C:\Program Files\TestLog) to the previously created TestLog folder. These directories are also used by the standalone EXE version of TestLog so do not remove them from the install directory.
Edit the cgiconfig.cfg file and add references to the help, images and template directories and the databases you want to be accessible from the web.The config file is explained in more detail in the CGI Config File section below. To make sure the web server is setup and TestLog is working correctly use the default sample database (C:\Documents and Settings\All Users\Application Data\PassMark\TestLog\SampleDB) for the databases section of the config file.
Open the IIS manager from Control Panel, you should see the TestLog directory under the Default Web Site. Right click on the TestLog folder and go to Properties, under Execute Permissions on the first tab (Directory) ensure that "Scripts and Executables" is selected. Save the changes and restart the default web site.
You should now be able to access the web version by typing in http://localhost/TestLog/TestLogCGI.cgi (changing localhost to the web server address as required). To login into the sample database use the Tester ID "DAVIDW" and the password "Test".
Now you can install any web access licence keys you have and setup tester passwords and access for other databases you have added.

 

In IIS manager, on the Directory Security tab of the TestLog website properties "Anonymous Access" should be enabled and set to the default IIS user. If this is not turned on, depending on what sort of  security options you are using, you will have to enter a user name and password before you can access TestLog. The file permissions needed by the databases and temp folders will also depend on your security setup and will have to be changed to allow the same users that can log into the web server to read and write these folders.

 

There may be some extra steps involved to allow CGI files to be run on IIS, this is covered in this topic.

 

TestLog can't be used with Version 5 of IIS due to a set cookie/redirection problem (http://support.microsoft.com/kb/176113) that prevents TestLog from setting a cookie correctly when logging in.

 

Installing on IIS (Version 7)

 

The above directions can be followed for moving the files to the required locations and setting up the configuration. There are some extra steps that may be required to ensure IIS 7 is setup too allow execution of CGI files. There is an example using the zoom search engine that details this process available at http://www.wrensoft.com/zoom/support/faq_cgi_iis.html., to summarise;

 

Check the CGI role is enabled for IIS
Convert the TestLog folder in IIS manager to an application
Add the CGI module mapping to TestLog in IIS manager
Add the full path to the TestLog CGI file (eg C:\inetpub\wwwroot\TestLog\TestLogCGI.cgi) to the ISAPI and CGI Restrictions for the server and allow it to execute.

 

 

Installing on Apache

Create a TestLog directory in the document root folder (eg C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\TestLog)
Copy the TestLogCGI.cgi and cgiconfig.cfg from the TestLog install directory (default C:\Program Files\TestLog\CGI\) to the previously created TestLog folder.
Copy the "Images" and "Help" directories from where TestLog was installed (default C:\Program Files\TestLog) to the previously created TestLog folder. These directories are also used by the standalone EXE version of TestLog so do not remove them from the install directory.
Edit the cgiconfig.cfg file and add references to the help, images and template directories and the databases you want to be accessible from the web. You also need to add a link to a temporary folder to store session files. The config file is explained in more detail in the CGI Config File section below. To make sure the web server is setup and TestLog is working correctly use the default sample database (C:\Documents and Settings\All Users\Application Data\PassMark\TestLog\SampleDB) for the databases section of the config file.
Edit the httpd.conf to allow script execution otherwise it will try to download the TestLogCGI.cgi file instead of execute it;

Uncomment the "AddHandler cgi-script .cgi" line

Add a <Directory> section for the TestLog folder
       <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/TestLog">

   Options Indexes FollowSymLinks ExecCGI

   AllowOverride None

   Order allow,deny

   Allow from all
</Directory>

Making sure ExecCGI has been added to the Options line of the section

Save the changes and restart the Apache service
You should now be able to access the web version by typing in http://localhost/TestLog/TestLogCGI.cgi (changing localhost to the web server address as required). To login into the sample database use the Tester ID "DAVIDW" and the password "Test".
Now you can install any web access licence keys you have and setup tester passwords and access for other databases you have added.

 

 

Note on accessing databases from the web server across a network

 

By default the user a web server runs as does not have permissions to access files across the network. If your database are not local to the web server and you are adding them to the cgiconfig.cfg file in the form //servername/databasepath then you may need to change the user the web server runs as described in Apache and UNC  and IIS and UNC. It is best to get TestLog Web Access working correctly with the sample database on the local hard drive before making changes to allow access to network databases.

 

 

Installing Web Access Licence Key

 

You can either add your key manually to the KEYSECTION part of the CGI config file or by going to the settings menu of the TestLog standalone EXE version and choosing "Install Web Access Licence". This will let you browse to the CGI config file, enter your web access licence key and save the licence key into the config file.

 

Setting Up Testers - Passwords and Permissions

 

After adding a database to the DATABASES_START section of the config file you will need to set-up passwords for any testers that need access. For each tester in a database there is a "Remote Access" section which can be accessed via the standalone EXE version of TestLog. Once you have enabled this checkbox you can select the level of access granted to the user and enter a password. Now the tester can log into the CGI version using their Tester ID and password. You will need to do this for any database that is added to the databases section of the config file otherwise you will not be able to log in.

 

tester-edit

The Tester edit dialog as seen in the TestLog EXE version

 

 

CGI Config File

 

In the same directory as the TestLogCGI.cgi file is a config file named "cgiconfig.cfg". This file contains the location of image directories, template directories and the paths to the database available to be viewed online. You can edit this file using a text editor like notepad. Lines that begin with the "#" symbol are treated as comments and ignored. Each section uses a keyword between two ":" characters, eg ":TIMEOUT:", with the appropriate value straight after the keyword. Sections that can be a list of values, such as the available databases, use a ":XXXX_START:" ""XXXX_END:" pair to indicate the start and end of the list with each element on a separate line.

 

#TestLogCgi config file

#The location of the TestLog directory for images, relative to the base URL of your web server

:IMAGESREL:/Testlog/Images/

 

#The location of the TestLog directory for images, absolute path (same location as above but absolute)

:IMAGESABS:C:\Program Files\Apache Group\Apache2\htdocs\Testlog\Images\

 

#The location of the TestLog directory for help, relative to the base URL of your web server

:HELPREL:/Testlog/Help/

 

#Temp folder location, used for sesssion files etc

:TEMPDIRABS:C:\temp\Testlogcgi

 

#Session timeout value in minutes

:TIMEOUT:60

 

#The location of the Templates directory, absolute path

#You do not need to include the "Templates" part of the path

:TEMPLATEABS:C:\Program Files\TestLog\

 

#The paths to the databases, absolute paths

:DATABASES_START:

C:\Documents and Settings\All Users\Application Data\PassMark\TestLog\SampleDB

:DATABASES_END:

 

#Key Section - Purchased licence keys

:KEYSECTION_START:

45B5A2C4010967B6A785306EA1990B1F649C800D92

:KEYSECTION_END:

Example CGI config file

 

:IMAGESREL: Path to where the images TestLog uses are stored, this needs to be a path relative to the base URL of your web server so image links can be created in the manner http://webservername/TestLog/tllogo.png. For the above example the images were stored in a directory named "Images" in the htdocs\TestLog directory (for an Apache install). The images needed by the TestLog CGI are located in the "Images" directory where TestLog was installed, these images are also used by the Web export function in the standalone version of TestLog so you should copy them instead of moving them.

 

:IMAGESABS: Absolute path to the IMAGESREL directory. When viewing reports TestLog will generate GIF files so the reports can be displayed graphically, and need to be stored temporarily. The image will be created in this directory and then linked to using the above relative link. Any images generated by TestLog will be deleted after approximately 30 minutes so they don't take too much space on the server.

 

:HELPREL: The path where the TestLog help files are located, this needs to be a path relative to the base URL of your web server so html links to the various help pages can be created and opened. The above example has the "Help" folder that contains the help files copied from the directory where TestLog was installed to the "TestLog" directory in the htdocs directory (for Apache).

 

:TEMPDIRABS: The absolute path of a directory on the server that TestLog can use for storing temporary files such as the session file for user logins.

 

:TIMEOUT: The session timeout value in minutes, once a user has logged in and not had any activity for this length of time they will be forced to re-login for the next action they take, this can be a value between 1 minute and 1440 minutes (24 hours), if a value outside this range is entered the default 60 minutes will be used.

 

:TEMPLATEABS: The location of the Templates directory. This need to be an absolute path as the template files are opened by the TestLog CGI and their contents used to create the displayed HTML. The example uses the default directory where TestLog was installed, C:\Program Files\TestLog, if you move the Templates directory to the same folder as the images and help folders remember to update this section.

 

:DATABASES_START: (:DATABASES_END:) Absolute paths for each database to be accessed via the CGI up to a maximum of 50. If you are using Apache and entering UNC paths to databases on network shares please see the Apache and UNC section below, there is also a section for IIS and UNC.

 

:KEYSECTION_START: (:KEYSECTION_END:) The list of purchased licence keys, each time you purchase a key and add it to the list it will increase the number of simultaneous logins. Do not replace old keys with new ones as they are cumulative, so if you purchase two licence's you should have them both in this section.

 

:ADDBUGPATH:  Optional tag, used for linking to an external bug tracking tool, web access module equivalent of the “Add bug” path in the standalone TestLog options, once a path is entered  for this a "Add Bug" button will appear on the edit screen for a project test case, next to the Fault Report field. This is only valid in the web access module if it is link to an online tool, eg "http://server/bugzilla/enter_bug.cgi?".

 

:VIEWBUGPATH: Optional tag, used for linking to an external bug tracking tool, web access module equivalent of the “View bug” path in the standalone TestLog options. This is only valid in the web access module if it is link to an online too, eg "http://server/bugzilla/show_bug.cgi?".

 

:VIEWREQPATH: Optional tag, a path to an external tool or web service for your requirements management tool, web access module equivalent of the Requirements Path in the standalone TestLog options, as with the VIEWBUGPATH it is only valid if it is a link to an online tool.

 

:LOCKTIMEOUT: Optional tag, the time in minutes before a lock file is automatically ignored when editing a file. This should be a large value to avoid ignoring the lock file when the file is still genuinely being edited. By default this is commented out in the provided config so it is not enabled.

 

:CHARSET: Optional tag, allows the specification of a particular character set. Although TestLog is not a Unicode application this can be useful for non-English languages if characters (like month abbreviations) are not being displayed correctly. For example it can be set to GB2312 to UTF-8 to fix some output problems caused when the web server is running Chinese language versions of windows.

 

:DEBUGMODE: Optional tag, turns on debug logging for the web access module. The log is written to the directory setup in TEMPDIRABS.

 

 

 

Apache and UNC Paths

 

When using UNC paths to databases located on network shares Apache will need to be setup to be run as a user with these permissions. By default when Apache is run as a service it run under the SYSTEM user. This user doesn't have permission to access the network, so any databases accessed by a UNC path, such as \\examplepc\share\database, will fail with an "Access denied" error. See the section "User Account for Apache Service to Run As" in the Apache help docs for more information on setting Apache to run a different user. The correct permissions will need to be set on the machine storing the database to allow the user Apache is now running as to read and write the database files.

 

IIS and UNC Paths

 

Similar to Apache,  IIS runs a user that doesn't have access to the network. Rather than set the whole IIS server to run as a different user you can use the application pool to run as different user just for the TestLog installation.

       

For versions of IIS that have application pools (version 6+)

 

On the server running IIS create a new user, eg TestLogIIS, ensuring that the "User must change password at next login" is unchecked (if available) and the "Password never expires" option is checked (if available). On the machine with the database create the exact same username and password and give read and write permission to the datbase for this user
Once the user has been created add them as a member of the "IIS_WPG" group, this will enable the access permissions it requires to run.
Open the IIS Manager, create a new application pool, eg TestLog.
Open the properties for it and click on the Identity tab, set the user name to the previously created user and enter the password.
Go to the Testlog directory under the websites (or the directory where you have placed the Testlog files in your IIS folder) and go to it's properties. Change the application pool to the one just created.
Restart the application pool and you should be able to view the database with the UNC path.

 

For versions of IIS without application pools (version 5.1, though this may also work for version 6 and higher as well)

 

On the server running IIS create a new user, eg TestLogIIS, ensuring that the "User must change password at next login" is unchecked (if available) and the "Password never expires" option is checked (if available). On the machine with the database create the exact same username and password and give read and write permission to the datbase for this user
Make the newly created user a member of the Users group.
Open the IIS manager, navigate to the TestLog web site, right click on it and go to the properties
Click on the Directory security tab, click the Edit button and enable Anonymous access. Add the new user and password here and save the changes.
Stop and restart the default web site

 

Setting Up Binary CGI Support For A Windows IIS Server

 

Your IIS server may not be configured for executing binary CGIs. Note that this is not the same as having Perl support. You will need to contact your web host or have direct access to the server to change this by following the instructions below.

 

First, you will need to access the IIS window on the web server (Control Panel -> Administrative Tools -> Internet Information Services). Next, locate the folder for your website, and select the folder  (TestLog) where you will be running the CGI file. Right click on the folder, and select "Properties". Now look for "Execute Permissions" and change the setting to "Scripts and Executables".

 

If the "Configuration" button is enabled, you can click on it to check if the ".cgi" extension is mapped to an application. If not, then it should be fine for the CGI file to run. However, some servers may have the ".cgi" extension mapped to ActivePerl. This means that your binary CGI would not execute properly when executed, because it gets treated as a Perl script. In this case, you can work-around the problem by renaming the ".cgi" file to ".exe" though this may cause some linking issues when running TestLog.

 

For IIS 7 there is an example using the zoom search engine that details this process available at http://www.wrensoft.com/zoom/support/faq_cgi_iis.html that can be applied to installing TestLog.

 

Note: If you are running IIS 6.0 on Windows Server 2003, you may need to configure some extra options to enable CGI (due to additional security requirements enforced in this OS). Namely, you will need to allow the Web Service Extension for CGI in the IIS Manager window.

 

This can be done from the IIS Manager window, by locating "Web Service Extensions", and changing the "All Unknown CGI Extensions" status to "Allow". However, this would allow any CGI applications to run on the server. If you wish to specifically allow ONLY the "TestLogCGI.cgi" application to run, you should create a new Web Service Extension. Do this by right-clicking in the web service extensions list, and selecting "Add a New web service extension". Enter a name (eg. "TestLog CGI"), and click on "Add". You will have to specify the path to the "TestLogCGI.cgi" file here, and click "OK". Once you have done this, change the status for the new extension to "Allow". For more information, refer to the above link and the Microsoft documentation for Configuring CGI Applications (IIS 6.0).

 

Troubleshooting - Common error messages and their solutions

404

"Scripts and Executables" has not been enabled for the execute permissions of the TestLog website in IIS manager. For Apache see the step "Edit the httpd.conf to allow script execution" for installing on Apache.
404.2 "Web service extension lockdown policy prevents this request" - see Web Service Extension for CGI above
Case sensitivity, some web browser and servers can be case sensitive and will not find address when the incorrect case is used
Spelling mistake in web address

 

See a Description of Microsoft Internet Information Services (IIS) 5.0 and 6.0 status codes and HTTP status codes in IIS 7.0 for other IIS error codes and their meanings.