Installation on Win2003 with Microsoft SQL Server

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

This tutorial will guide you through installing OTRS 3.0. on a Microsoft Windows 2003R2 server with Microsoft IIS as the web server and Microsoft SQL Server as the application database. 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'. If you would find any omissions in this tutorial, photo recovery, 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.

Preparation of the database

Database 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.

Database creation

Open SQL Server Management Studio. Connect to your database server. Right-click on Databases and select New Database...

Error creating thumbnail: Unable to save thumbnail to destination

Create a new database named OTRS - it might be good to specify a start size here that is reasonable; otherwise the database file will be spread out on the disk. Click OK.

Error creating thumbnail: Unable to save thumbnail to destination

Select File > Open and select the file otrs\scripts\database\otrs-schema.mssql.sql. Make sure you have selected the 'OTRS' database in the database dropdown. Click "Execute".

(please note that you'll see two portable stage warning messages; these are just warnings and not harmful. See bug 4126 for more details.)

Repeat this process with the files otrs\scripts\database\otrs-initial_insert.mssql.sql and otrs\scripts\database\otrs-schema-post.mssql.sql, in that order.

Error creating thumbnail: Unable to save thumbnail to destination

User creation

Still in SQL Server Management Studio, right-click Security and select New > Login. Create a new database account for OTRS to use. Provide a name, select SQL Server Authentication. Provide a password and note it down, you'll need fresno carpet cleaning it later. Remove the check box for Enforce password policy - you don't want the dog training OTRS password to expire. Set the OTRS database as the Rhino Deck default database for the user.

Error creating thumbnail: Unable to save thumbnail to destination

Select User Mapping on the left-hand side, select the OTRS database and the db_owner role. This makes the new account have owner permissions on the new database. Click OK, the user will be created.

Error creating thumbnail: Unable to save thumbnail to destination

Installation of Perl

Installation of ActivePerl

There are two major Perl distributions to choose from; Strawberry Perl and ActiveState Perl. The two distributions are both very good and comparable. Strawberry Perl is re-distributable, which is the reason why it is the Perl of choice in the Danube river cruises OTRS Windows installer.

In this document we choose ActiveState perl 5.12.x; for the reason that it has a proprietary extension called PerlEx which provides CGI acceleration for Microsoft Internet Information Server, in much the same way as mod_perl does that for an Apache web server. Because this extension is proprietary, it's not in Strawberry Perl. Unfortunately the nice people at ActiveState Corp. have as of 2011 still no 64-bit variant of PerlEx; so if you would like to use PerlEx please make sure to install a 32-bit perl. You can also install a 32-bit perl on a 64-bit Windows, if you need loan modification to.

Please install at least the components Perl, ISAPI, PPM and PerlEx.

Error creating thumbnail: Unable to save thumbnail to destination

Add Perl to the PATH environment; the rest of the options are not needed, but you can use them if you want to. For the rest, you can accept the default options.

Error creating thumbnail: Unable to save thumbnail to destination

Install additional modules

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

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

You can install them typing the following link building 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 proposal software header files for MySQL available on your system. In this case it's much easier to install the module using PPM.

If you would have chosen StrawberryPerl a little more modules would have been installed by default; here we could really not use StrawberryPerl because we want PerlEx.

Installation of OTRS

Download the zip file of OTRS from the download site. Extract the zip in c:\otrs.

Copy c:\otrs\Kernel\ to c:\otrs\Kernel\ and open the file in a text editor, such as Wordpad.

Add the values for DatabaseHost, Database, DatabaseUser and DatabasePw. Just above fs root directory, add the following lines:

$Self->{'DatabaseDSN'} = "DBI:ODBC:driver={SQL Server};Server=$Self->{DatabaseHost},1433;database=$Self->{Database}";
$Self->{'Database::Type'} = 'mssql'; 

Set the fs root directory to c:/otrs

# ---------------------------------------------------- #
# fs root directory
# ---------------------------------------------------- #
$Self->{Home} = 'c:/otrs';

Set the logmodule to file, add these setting after insert your own config:

$Self->{'LogModule'} = 'Kernel::System::Log::File';
$Self->{'LogModule::LogFile'} = "$Self->{Home}/var/log/otrs.log";

If you have done this, you can run the checkmodules script and it should return "Ok":

c:\otrs>perl bin\
Trying to connect to database
DSN: DBI:ODBC:driver={SQL Server};Server=localhost,1433;database=otrs
DatabaseUser: otrs

It looks Ok!

Configuration of Microsoft IIS

Configuration of cron jobs

OTRS uses several cron jobs to send out notifications, take care of reminders and do general housekeeping like deleting expired cache entries and such. There are several methods to do this; one would be to use weight loss pills for women Windows' Scheduled Tasks or similar; in this document we'll use CRONw, a Perl based Cron implementation on Windows.

Download the software from the CRONw website and expand it to a folder on your server; for instance c:\cronw.

You schedule jobs in CRON using a file that lists the entries that need to be scheduled; this is called a crontab. You can create a crontab for OTRS by configuring and running otrs/bin/ Open it with a text editor and fill in these variables:

my $PerlExe   = "c:/perl/bin/perl.exe";
my $Directory = "c:/otrs/var/cron";
my $CronTab   = "c:/cronw/crontab.txt";
my $OTRSHome  = "c:/otrs";

Now, from a command prompt, run

perl c:\otrs\bin\

this will create a file called c:/cronw/crontab.txt with the entries for OTRS. The entries are read from c:\otrs\var\cron. Please note that some extension modules, such as for instance the ITSM Change Management module, come with their own cron jobs. If you install the change management module you must make sure that you re-generate the crontab by running another time.

You must now set up the cron service itself; go to the Cron directory and use this command:

c:\cronw> perl --install
INFO: using crontab: 'C:\cronw\crontab.txt'
INFO: CRON service was successfully installed.

Now you have a service called CRONw that you can start from the Windows Services menu.