# HOWTO: OTRS on FreeBSD 8.x



## da1 (May 12, 2011)

*General Information*
This guide walks you through the steps needed to have a working OTRS on a FreeBSD 8.x box.



*Requirements*
apache
mysql-server
perl
local or remote root access to the box
a updated ports tree
vi or ee knowledge

*Optional packages*:
mysql-client
portmaster



*Installation*


*1) Install apache* (*skip if apache is already installed and/or configured*)

```
cd /usr/ports/www/apache22; make install clean
```
 (make sure "mod_cgi" is selected when the ncurses config dialog pops up)
or

```
portmaster --delete-build-only -P www/apache22
```
or

```
pkg_add -r apache22
```
(make sure to have mod_cgi compiled in)

The portmaster "--delete-build-only" switch tells portmaster to delete build-dependancies while the "-P" switch tells portmaster to use a package if one is available.


*2) Install Perl* (*skip if perl is already installed and/or configured*)

```
cd /usr/ports/lang/perl5.x; make install clean
```
or

```
portmaster --delete-build-only -P lang/perl5.x
```
or

```
pkg_add -r perl
```
PS: replace perl5.x with the newest version available (ex: perl5.12)


*3) Installing OTRS* (default dir: /usr/local/otrs)

```
cd /usr/ports/devel/otrs; make install clean
```
or

```
portmaster --delete-build-only devel/otrs
```
or

```
pkg_add -r otrs
```


*4) Installation of (optional) Perl modules*
To check which (optional) Perl modules are available for OTRS do:

```
cd /usr/local/otrs/bin ; ./otrs.CheckModules.pl
```
- install the missing ones by checking the location of the port package

```
cd /usr/ports; make quicksearch name=<module_name>; cd <location>/<port>; make install clean
```
or

```
portmaster --delete-build-only -P <category>/<port_name>
```
or

```
pkg_add -r <name>
```


*5) Check if Perl is properly setup*

```
cd /usr/local/otrs; perl -cw cgi-bin/index.pl
```


```
perl -cw otrs.PostMaster.pl
```
- is the reply is "syntax OK" you are good to go 
- if NOT, there is a problem with the OTRS files (try reinstalling the port)


*6) Configuring the Apache web server*
check if we have the cgi module loaded:

```
vi /usr/local/etc/apache22/httpd.conf
```
 (hit "/" and type "cgi" then hit "enter"; if you see "LoadModule cgi_module libexec/apache22/mod_cgi.so", you are good to go; type ": q" and hit enter; if you do not see it, you need to recompile apache with "mod_cgi" selected)

*6.1) Setup an Alias and a ScriptAlias*

```
cp /usr/local/otrs/scripts/apache2-httpd.include.conf /usr/local/etc/apache22/extra/otrs.conf
```
- modify the apache httpd.conf file to load the new otrs.conf

```
vi /usr/local/etc/apache22/httpd.conf
```
 (I prefer to put it at the end of the file) and insert "Include etc/apache22/extra/otrs.conf" to the file. Then, reload apache by:

```
/usr/local/etc/rc.d/apache reload
```


*7) Configuring the database (via the web-i)*
go to: http://localhost/otrs/installer.pl
and setup the db (note: use your mysql root credentials when prompted)

*8) login to OTRS*
* if the password isn't working, do 
	
	



```
cd /usr/local/otrs/bin && ./otrs.SetPassword.pl root@localhost <password>
```


Enjoy!


----------

