OTRS (abbr. From the English. Open-source Ticket Request System) is an open application processing system. OTRS allows technical project organizations to work together to solve user problems. The program is written in Perl, supports many DBMSs (MySQL, PostgreSQL, etc.), can be integrated with the LDAP directory, distributed under a license - AGPL version 3.
OTRS perfectly and without any hassle is installed on any LAMP (Linux, Apache, MySQL, PHP). But what if there is no experience and administration of Linux?
The fourth version of OTRS does not have a Windows version installer. I decided to post my way of installing OTRS from source in a Windows environment. However, it is important to understand that the performance of OTRS running in the native Linux environment will be higher than on the same hardware in the Windows environment.
The biggest problem I encountered when installing OTRS is the mod_perl runtime for Apache. Fortunately, enthusiasts
regularly post fresh versions of the mod for new versions of Perl and Apache.
')
So, we will need:
•
MySQL Server v 5.5 64-bit .
•
Apache v 2.2 32-bit .
•
Strawberry Perl 5.20.1.1 32-bit .
• Well,
mod_perl itself.
•
Cron for Windows Scheduler (optional).
•
Visual C ++ 2008 SP1 Redistributable Package (x86) .
•
Visual C ++ 2010 SP1 Redistributable Package (x86) .
• Actually
OTRS itself.
Install Apache HTTP Server
Apache requires the Visual C ++ 2008 SP1 Redistributable Package to work. Download the link above and install.
Download the archive from Apache and unpack the apache2 folder from the archive into the folder c: / apache2 (by default, ServerRoot is located along this path). If you chose a different location for Apache, you need to change the ServerRoot in httpd.conf, as well as the location of Documenroot, Directories, ScriptAlias.
To install the Apache service from the c: \ Apache2 \ bin folder on the command line, enter
httpd.exe -k install

The service has been successfully installed.
Run the file c: \ Apache2 \ bin \ ApacheMonitor.exe and place it in autoload. Run the Apache service.

In the browser in the address bar go to
http: // localhost . If everything is good, then we will see a page with the text “It works!”.

Install Strawberry Perl
Download Strawberry Perl from the link above, unpack everything into the c: / strawberry folder. In the command line, run the following files.
c: \ strawberry \ relocation.pl.bat
c: \ strawberry \ update_env.pl.bat

Install mod_perl for Apache
Download mod_perl. The archive has two folders - with apache and perl. We unpack their contents with replacement of files respectively in folders where we have installed Apache and Perl.
Restart the Apache service.
Install MySQL Server
Download and run mysql-5.5.43-winx64.msi. Installation without features.
After the installation is complete, the Setup Wizard starts.

Choose a standard configuration.

We set the name for service.

We set the root password.

After the installation is completed, edit the file my.ini.

For better performance, in the file c: \ Program Files \ MySQL \ MySQL Server 5.5 \ my.ini, set the value of the parameter
query_cache_size = 32M
Restart the MySQL service.
Install OTRS
Download the zip-archive with the latest version of OTRS (at the time of this writing, version 4-0-8) and unpack it into the c: \ otrs \ folder
Almost everything is ready.
Install the necessary perl packages
From the command line from the folder c: \ otrs \ bin run the script
perl otrs.CheckModules.pl

Install the necessary packages. Among them are both mandatory (required) and optional (optional). Install everything except Encode :: HanExtra.
cpan Crypt :: Eksblowfish
cpan GD :: Text
cpan GD :: Graph
cpan Mail :: IMAPClient
cpan Net :: LDAP
cpan PDF :: API2
We also get one error on the DBD :: Oracle package.

The internal perfectionist requires the elimination of this error, although in this example the Oracle database is not used. Oci.dll is
an Oracle client library. We download the client, it is not necessary to install it, just pick up the Oci.dll library from the archive and put it in c: \ Windows \ System32 \.
Now a message appears about the missing library MSVCR100.dll.

Install the Visual C ++ 2010 SP1 Redistributable Package (x86).
Run the script again
perl otrs.CheckModules.pl

All necessary modules are installed.
Configure OTRS
All configuration is to change the installation path OTRS in the configuration files.
c: \ otrs \ scripts \ apache2-httpd.include.conf
Change it | … on this |
ScriptAlias / otrs / “/ opt / otrs / bin / cgi-bin /” | ScriptAlias / otrs / “c: / otrs / bin / cgi-bin /” |
Alias / otrs-web / “/ opt / otrs / var / httpd / htdocs /” | Alias / otrs-web / “c: / otrs / var / httpd / htdocs /” |
Perlrequire /opt/otrs/scripts/apache2-perl-startup.pl | Perlrequire c: /otrs/scripts/apache2-perl-startup.pl |
<Directory “/ opt / otrs / bin / cgi-bin /”> | <Directory “c: / otrs / bin / cgi-bin /”> |
<Directory “/ opt / otrs / var / httpd / htdocs /”> | <Directory “c: / otrs / var / httpd / htdocs /”> |
<Directory “/ opt / otrs / var / httpd / htdocs / skins / * / * / css-cache”> | <Directory “c: / otrs / var / httpd / htdocs / skins / * / * / css-cache”> |
<Directory “/ opt / otrs / var / httpd / htdocs / js / js-cache”> | <Directory “c: / otrs / var / httpd / htdocs / js / js-cache”> |
The easiest way to do a search / replace for “/ opt” with “from:”
c: \ otrs \ scripts \ apache2-perl-startup.pl
Change it | … on this |
use lib “/ opt / otrs /”; | use lib “c: / otrs /”; |
use lib “/ opt / otrs / Kernel / cpan-lib”; | use lib “c: / otrs / Kernel / cpan-lib”; |
use lib “/ opt / otrs / Custom”; | use lib “c: / otrs / Custom”; |
c: \ otrs \ Kernel \ Config.pm
Rename the file c: \ otrs \ Kernel \ Config.pm.dist to c: \ otrs \ Kernel \ Config.pm. In a text editor
Change it | … on this |
$ Self -> {Home} = '/ opt / otrs'; | $ Self -> {Home} = 'c: / otrs'; |
For logging, add the following lines:
$ Self -> {'LogModule'} = 'Kernel :: System :: Log :: File';
$ Self -> {'LogModule :: LogFile'} = "$ Self -> {Home} /var/log/otrs.log";
Configure Apache
In the folder c: \ Apache2 \ conf \ edit the httpd.conf file, add the following lines:
# specify the Apache where we installed the pearl
LoadFile “c: /strawberry/perl/bin/perl520.dll”
# load mod_perl
LoadModule perl_module modules / mod_perl.so
# Specify where OTRS is installed
Include “c: /otrs/scripts/apache2-httpd.include.conf”
Make sure the syntax is good. In the command line from the folder c: \ Apache2 \ bin we execute
httpd –t

Restart the Apache service.
If such an error occurs:

We need to check whether we changed the installation path in all configurations when configuring OTRS.
We start web installation
In the address bar, run
http: //localhost/otrs/installer.plAccept the license agreement, choose the type of MySQL database, enter the password from the root account.
When you click the button to check the database settings, we get an error. OTRS requests to increase the value of the max_allowed_packet parameter.
Add a line to the c: \ Program Files \ MySQL \ MySQL Server 5.5 \ my.ini file
max_allowed_packet = 20M
Restart the MySQL service and check the database again.

We get another message.
The innodb_log_file_size parameter is responsible for the size of MySQL logs. Stop the MySQL service. In this version of MySQL, the logs are located in the folder c: \ ProgramData \ MySQL \ MySQL Server 5.5 \ data \

Delete the ib_logfile0 and ib_logfile1 files. In the file my.ini set the value of the parameter
innodb_log_file_size = 512M
We start the MySQL service. We see that the files ib_logfile0 and ib_logfile1 become the right size.
Again, click on the button to check the database. Everything worked out. OTRS created a new account for the new OTRS database and generated a password.

At Step 3, you are prompted to configure the system and mail. This can be done at any time.
Finally, in Step 4, we generate a password for the root user @ localhost. We go under this account.

Scheduler Setup
At the entrance under the agent, we see a message that the scheduler is not running. This refers to the internal OTRS service.
At the command line, execute the script
c: \ otrs \ bin \ otrs.Scheduler4winInstaller.pl -a install

Then we start the service. We update the page, we see that the message has disappeared, and a new OTRS Scheduler has appeared in the services snap-in.
Now you need to configure the work of the actual scheduler. You can use either the Windows Task Scheduler or CRON.
CRON SetupOTRS uses the CRON scheduler natively. Scheduler is designed to clear the cache, update statistics, send notifications, etc.
Downloading CRONw and unpacking it in c: \ cronw folder. For CRONw to work correctly, we need to install several pearl modules.
In the command line we execute:
cpan Date :: Manip
cpan Log :: Dispatch
cpan Log :: Dispatch :: FileRotate
All tasks in CRONw are stored in a special crontab file. It can be created by running C: /otrs/bin/otrs.Cron4Win32.pl, having previously edited it as follows:
my $ PerlExe = "c: /strawberry/perl/bin/perl.exe";
my $ CronTabFile = "c: /cronw/crontab.txt";
my $ OTRSHome = "c: / otrs";

Run the script from the command line:
perl c: \ otrs \ bin \ otrs.Cron4Win32.pl
The script worked, the crontab.txt file appeared in the c: \ CRONw \ folder.
Install CRON as a Windows service. At the command line, run the script
perl cronHelper.pl –install

Service installed. Run it.
Configuring the Windows Task SchedulerSince we decided to install OTRS in a Windows environment, the local scheduler can be used.
In the folder c: / otrs / var / cron / there are several standard tasks. In fact, these tasks run perl-scripts. Run the Task Scheduler, the Actions menu - Create Task.
Open the first cache.dist file in the folder c: / otrs / var / cron /
# delete expired cache weekly (Sunday mornings)
20 0 * * 0 $ HOME / bin / otrs.DeleteCache.pl --expired >> / dev / null
30 0 * * 0 $ HOME / bin / otrs.LoaderCache.pl -o delete >> / dev / null
We give the task a name - OTRS Weekly. Clearing the cache. We configure the task execution regardless of user registration and with the highest rights.

Go to the Triggers tab, click on the Create button. Specify the schedule is the same as we offer OTRS.

Go to the Actions tab, click the Create button. Action - Run the program. As a program, specify the path to perl.exe, as an argument - the required script with parameters.

By analogy, create an Action for the second script.
Repeat the operation for all the tasks we need. Run each task manually to make sure that it is executed.
That's all, OTRS is ready for further customization.
If interested, in the future, guides on setting up authorization through Active Directory and SSO authentication will be published.