Installation on Win2012R2 with Microsoft SQL Server 2014, IIS 8.5 and OTRS 4(0.5)

From OtterHub - OTRS Community Wiki
Jump to: navigation, search

This document has been copied from [1] and was altered to suite Windows Server 2012 R2, IIs 8.5, SQL Server 2014 Express and OTRS 4(.0.5).

This tutorial will guide you through installing OTRS 3.3.11 using the windows installer first and then upgrading on OTRS 4 on a Microsoft Windows 2012 R2 (64bit) server with Microsoft IIS 8.5 as the web server and Microsoft SQL Server 2014 Express Advanced as the database server. This page does not discuss how to set up Microsoft IIS or Microsoft SQL server. Also, we'll assume you have SQL Server set to allow for 'mixed mode authentication' and installed the server with the standard instance.

If you should find any omissions in this tutorial, or would like to enhance it, please do. If you're not sure if your additions are appropriate, please use the discussion page for his article.

SQL Server Configuration

Make sure the database accepts connections over TCP/IP. To verify this, start SQL Server Configuration Manager, select SQL Server Network Configuration, Protocols for MSSQLSERVER and verify that TCP/IP is set to Enabled.
Important is, that you have a working "sa"-account for the SQL Server. You can (and should) create a otrs-db-user later on during the installer.pl-routine. Else you are done here

Installation of ActivePerl

There are two major Perl distributions to choose from: Strawberry Perl and ActivePerl. The two distributions are both very good and comparable. Strawberry Perl is re-distributable, which is the reason why the OTRS Windows installer comes along with this distribution.

If you install OTRS with the windows installer right now, it will complain, that no ActivePerl installation was found and if you continue the setup will install Strawberry Perl and the Apache webserver. So prior to the OTRS windows installer you should install ActivePerl (I tested successfully “ActivePerl-5.16.3.1604”). Any other version, i.e. higher than 5.16 and also 5.12 didn’t work. The PerlEx is in that version not included anymore as there is a "Business Edition" of ActiveState Perl. I don't know of any perfomance differences between ActiveState and Strawberry regarding the use of "perl.exe"-Handler, but ActivePerl did work for me. Furthermore I used the 32 bit version, so you might have to configure the IIS later on to use 32 Bit applications.

The PATH enviremont variable should be altered during the installation process.

Installation of OTRS 3.3.11

What is described now is basically the installation of OTRS 3.3.11 and an upgrade to 4 afterwards. The reasson is simple: There is no windows installer available (yet).

Installation using the windows install for OTRS

Download the latest Windows Installer for version 3.3.11 from the official OTRS Website. Go through the whole process and after finishing the installtion a website should open (h**p://<OTRSSERVER>/otrs/installer.pl) showing an error message. Keep that page open and continue reading, it will work eventually.

Install additional modules

You'll need to add some additional modules to make OTRS work. Some are optional, some are required.

First of all, make sure you can add modules by setting the windows access rights to the folder. I keep it simple and give read-wirte-permission to "everyone" for the whole perl-directory and the whole otrs-directory. After that remove the "read only" tag in the folder property. Of course you should tighte the security settings later on, but for now I'm focusing on getting the whole OTRS system running and not making it safe.

Open a cmd window and cd to the OTRS directory. Run perl bin\otrs.CheckModules.pl to see which modules are missing.

You can install them typing the following command in a cmd.exe window:

ppm install My::Module

if you can't find the module you need on the ActiveState PPM repository you can install them from CPAN:

cpan My::Module

Note that you can't install all modules from CPAN without issues; for instance if you would require DBD::mysql when connecting to a remote database the cpan will require that you also have the libraries and header files for MySQL available on your system. In this case it's much easier to install the module using PPM.

Configuring the IIS to use Perl

  • Open the IIS Manager.
  • Go to the "<OTRSSERVER> (Domain/user)" in the tree on the left hand site.
  • Double click on handler mappings.
  • You will find the PerlEx-mapping, which (as I mentioned above) is not working. Delete that entry.
  • Create a new mapping using "Add Script Map" in the action menu.
  • Type in Request path "*.pl", Executable "C:\Perl\bin\perl.exe "%s" %s", Name "Perl-pl".
  • Click OK and the new handler should be active.

Configuring Internet Explorer

One of the known issues is, that the IE's "Compatibility View" is causing trouble. Simply go in the Internet Explorer to Extras (press "Alt" to activate the menu) and deactivate "Display intranet sites in compatibility mode". Take care to activate that option on every client later on, too.

Initial Configuration of OTRS 3.3.11

Now that the IIS and the Internet Explorer are configured, let's reload the page (h**p://<OTRSSERVER>/otrs/installer.pl) and see, if you can start the second part of the OTRS setup. You might have to add the page to trusted sites and so on, but I won't go into detail about it here. Go through all the steps, use the "sa"-account to authenticate against the SQL server and when asked, create a new database with a new DB-User solely for OTRS. As the password for that user will be written clearly in the config-files later on, I strongly advise to do so. It will take a bit to create the database and when done you will get the success message. If you got this far, the rest is a piece of cake. Fill in the E-Mail details for the postmaster, test it and you are done. Afer finishing the installer.pl you should get the password for root@localhost and the link to index.pl. You are done here. Write down the root-password and click on the link for the index.pl

First Login

Prior to logging in for the first time, you have to find the "Layout.pm" under "otrs\Kernel\Output\HTML". Open it and search within the file for "IIS 6". You will get to a block that looks that this:

if ( $ENV{SERVER_SOFTWARE} =~ /^microsoft\-iis\/6/i ) {
       my $Host = $ENV{HTTP_HOST} || $Self->{ConfigObject}->Get('FQDN');
       my $HttpType = $Self->{ConfigObject}->Get('HttpType');
       $Param{Redirect} = $HttpType . '://' . $Host . $Param{Redirect};
   }

Copy the whole things twice and alter it to

if ( $ENV{SERVER_SOFTWARE} =~ /^microsoft\-iis\/7/i ) {
       my $Host = $ENV{HTTP_HOST} || $Self->{ConfigObject}->Get('FQDN');
       my $HttpType = $Self->{ConfigObject}->Get('HttpType');
       $Param{Redirect} = $HttpType . '://' . $Host . $Param{Redirect};
   }
if ( $ENV{SERVER_SOFTWARE} =~ /^microsoft\-iis\/8/i ) {
       my $Host = $ENV{HTTP_HOST} || $Self->{ConfigObject}->Get('FQDN');
       my $HttpType = $Self->{ConfigObject}->Get('HttpType');
       $Param{Redirect} = $HttpType . '://' . $Host . $Param{Redirect};
   }

Go ahead and try to login with the root-user now.

Post checkup

  • Check that you can login.
  • Check the task manager in Windows, that Cron Service (CRONw) is running (listed below "Perl Command Line Interpreter").
  • Check the task manager in Windows, that OTRS Scheduler is running (listed below "Perl Command Line Interpreter").
  • Test, if OTRS picks up E-Mails and converts them to Tickets (that is also done by a cron-controlled script).

Upgrade to OTRS 4.0.5

If everything is running now, you are ready to upgrade to the latest version of OTRS.
Basically you only have to follow the official OTRS documentation about (http://otrs.github.io/doc/manual/admin/4.0/en/html/upgrading.html Upgrading OTRS from 3.3 to 4). Here's a summary.

Get latest release

As you don't want to work with Linux and are not keen on the appliance you got to get the ZIP-File with all necessary files. Unzip them move them to the otrs directory. The file structure should like the same then the one from your existing installation.

Stop services

Stop all OTRS related services

  • IIS services with the IIS-Manager
  • OTRSScheduler
  • Cron Service (CRONw)

Backup Files and DB

Backup the following files

  • Kernel\Config.pm
  • Kernel\Config\GenericAgent.pm
  • Kernel\Config\Files\ZZZAuto.pm
  • var\*

Backup the DB using the SQL Server Manager.

Install the new release

Rename the old installation otrs_old and the new one otrs. Replace files in the new installation with the backuped files

  • old configuration files
  • TicketCounter.log (within the var-folder)
  • article data (within the var-folder)

Also, re-apply the changes made to Layout.pm as described under First Login.

NOTE: If you are having trouble logging in, and the page just refreshes without appearing to submit the information, it is probably because the changes made to Layout.pm have not been made or are incorrect.

Check needed Perl modules

Open a cmd window and cd to the OTRS directory. Run

perl bin\otrs.CheckModules.pl

to see which modules are missing.

You can install them typing the following command in a cmd.exe window:

ppm install My::Module

if you can't find the module you need on the ActiveState PPM repository you can install them from CPAN:

cpan My::Module

Apply the database changes

Find the script "DBUpdate-to-4.mssql.sql" in the folder "Scripts" and execute the SQL command through the SQL Server Manager. That will tell you, if something goes wrong. Run the migration script afterwards:

perl scripts\DBUpdate-to-4.pl

Refresh the configuration cache and delete caches

perl bin\otrs.RebuildConfig.pl
perl bin\otrs.DeleteCache.pl

start services

  • Cron Service (CRONw)
  • OTRSScheduler
  • IIS services with the IIS-Manager

Rebuild Ticket index

perl bin\otrs.RebuildTicketIndex.pl

Final remarks

These are the steps that lead to a "virgin", working installation of OTRS 4.0.5 on a pure Windows based system. Yes, a lot of points expecially in the upgrade process have been skipped, but I think the result counts. I found the system rather slow due to the use of "perl.exe" instead of "PerlEx" I assume. Sadly, I couldn't test "PerlEx" (yet).
Espicially when NOT using the windows installer you have to configure a lot more, that's why I described it the way above. Based on this setup you can go ahead and try AD-authentification now. I won't make it part of this tutorial.
If you encounter any problems with this tutorial feel free to contact me. I won't make any promises for finding a solution but I'm glad to help, if I can.