After dealing with OTRS Help Desk on Ubuntu Server for a couple of years (which actually worked quite well for our small IT firm!), I've finally decided to migrate this great Help Desk platform over to FreeBSD, simply because I love it! I'm no FreeBSD master, but I've figured out just enough to get this working. So here we go...
~Alex
Step 1: Pre Installation Tasks
(Assuming you have a new FreeBSD 10.1 installation with ZFS. Which I've installed on MS Hyper-V Server 2012 R2.)
Edit /etc/rc.conf and verify the hostname of your FreeBSD/OTRS server as well as the static IP address. Which may look something like this:
Don't forget to visit /etc/resolv.conf and enter your DNS
Fetch the ports tree:
Install the port pkg:
Install applications needed to run OTRS:
Step 2. Let's prepare the MySQL56-Server
Start MySQL Server:
Set the root password for MySQL:
That was easy!
Step 3. Prepare the OTRS Directory and Download/Extract the Source
Remember, we are using ZFS which is great for snapshots/backups. Create a ZFS partition for OTRS:
(I use the default OTRS directory because I do not want to go through the headache of modifying the OTRS script files.)
Fetch the OTRS source using wget and rename the OTRS directory:
Add the OTRS user to the system:
Now let's copy some configuration files:
Set OTRS permissions/access rights:
If the obove doesn't work, your can temporarily set permissions ...
Step 4. Perl
See which Perl Modules are needed to run OTRS on FreeBSD:
Use the following commands to install the missing required modules:
Double check the installed Perl Modules to verify installation:
If you didn't miss anything, all required modules should show "OK".
Verify Perl has been properly set up:
Step 5. Configure Apache24
Start the Apache24 service to verify if the base install is working
Open a browser window to the IP address of your FreeBSD server. In my case http://192.168.1.20/ If you see "It works!" in the browser, your Apache24 pkg install went well.
Copy the OTRS configuration file to the Apache24 directory:
Create an alias within the Apache24 configuration file. Add the following line to the bottom of the Apache24 configuration file httpd.conf:
Also, verify that the CGI module is loaded. Locate
within httpd.conf and uncomment the line (remove the #). Save and exit.
Restart the Apache24 service:
Step 6. Copy/Rename OTRS cron .dist files
Make sure OTRS cron jobs are running as the OTRS user:
Step 7. You're ready to launch! Configure the MySQL database for OTRS 4.x
Open your web browser and navigate to the URL http://ServerIPAddress/otrs/installer.pl.
Step 8. Once the OTRS MySQL database has been configured, lets create a script to automate the ZFS snapshot for /opt
Create a script called "SnapshotOTRS.sh" and placed it into the /root directory
My script also includes the ability to backup a MySQL dump as well as export the entire OTRS folder & snapshots to an smb share (or external drive if needed).
Make script executable
Create a cronjob to run this script daily at 6pm
This should get OTRS up and running in FreeBSD. Hope this was helpful.
~Alex
Step 1: Pre Installation Tasks
(Assuming you have a new FreeBSD 10.1 installation with ZFS. Which I've installed on MS Hyper-V Server 2012 R2.)
Edit /etc/rc.conf and verify the hostname of your FreeBSD/OTRS server as well as the static IP address. Which may look something like this:
Code:
# Networking
hostname="OTRS"
ifconfig_de0="inet 192.168.1.20 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
sshd_enable="YES"
zfs_enable="YES"
apache24_enable="YES"
mysql_enable="YES"
Don't forget to visit /etc/resolv.conf and enter your DNS
Fetch the ports tree:
Code:
> portsnap fetch && portsnap extract
Install the port pkg:
Code:
> cd /usr/ports/ports-mgmt/pkg/ && make install clean
> pkg2ng
Install applications needed to run OTRS:
Code:
> pkg install apache24
> pkg install mysql56-server
Step 2. Let's prepare the MySQL56-Server
Start MySQL Server:
Code:
> service mysql-server start
Set the root password for MySQL:
Code:
> mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('rootpass');
mysql> quit
Step 3. Prepare the OTRS Directory and Download/Extract the Source
Remember, we are using ZFS which is great for snapshots/backups. Create a ZFS partition for OTRS:
Code:
> zfs create zroot/opt
> zfs set mountpoint=/opt zroot/opt
Fetch the OTRS source using wget and rename the OTRS directory:
Code:
> cd /opt
> fetch ftp://ftp.otrs.org/pub/otrs/otrs-4.0.2.tar.gz
> tar -xf otrs-4.0.2.tar.gz
> mv otrs-4.0.2 otrs
Add the OTRS user to the system:
Code:
> adduser
UserName = otrs
FullName = otrs
Home Directory = /opt/otrs
Password = otrs
Now let's copy some configuration files:
Code:
> cd /opt/otrs/Kernel
> cp Config.pm.dist Config.pm
> cp Config/GenericAgent.pm.dist Config/GenericAgent.pm
Set OTRS permissions/access rights:
Code:
> perl /opt/otrs/bin/otrs.SetPermissions.pl --otrs-user=otrs --web-group=www --admin-group=otrs
If the obove doesn't work, your can temporarily set permissions ...
Code:
> chown -R otrs /opt/otrs/
> chgrp -R otrs /opt/otrs/
> chmod -R 777 /opt/otrs/
Step 4. Perl
See which Perl Modules are needed to run OTRS on FreeBSD:
# perl /opt/otrs/bin/otrs.CheckModules.pl
.Use the following commands to install the missing required modules:
Code:
> cpan Archive::Zip
> cpan Date::Format
> cpan DBI
> cpan DBD::mysql
> cpan Net::DNS
> cpan Template (Enable Stash and XS during install.)
> cpan Template::Stash::XS
> cpan YAML::XS
Double check the installed Perl Modules to verify installation:
Code:
>perl /opt/otrs/bin/otrs.CheckModules.pl
Verify Perl has been properly set up:
Code:
> perl -cw /opt/otrs/bin/cgi-bin/index.pl
/opt/otrs/bin/cgi-bin/installer.pl syntax OK
> perl -cw /opt/otrs/bin/cgi-bin/customer.pl
/opt/otrs/bin/cgi-bin/customer.pl syntax OK
> perl -cw /opt/otrs/bin/otrs.PostMaster.pl
/opt/otrs/bin/otrs.PostMaster.pl syntax OK
Step 5. Configure Apache24
Start the Apache24 service to verify if the base install is working
Code:
> service apache24 start
Open a browser window to the IP address of your FreeBSD server. In my case http://192.168.1.20/ If you see "It works!" in the browser, your Apache24 pkg install went well.
Copy the OTRS configuration file to the Apache24 directory:
Code:
> cp /opt/otrs/scripts/apache2-httpd.include.conf /usr/local/etc/apache24/otrs.conf
Create an alias within the Apache24 configuration file. Add the following line to the bottom of the Apache24 configuration file httpd.conf:
Code:
> vi /usr/local/etc/apache24/httpd.conf
Include etc/apache24/otrs.conf
Also, verify that the CGI module is loaded. Locate
Code:
#LoadModule cgi_module libexec/apache22/mod_cgi.so
Restart the Apache24 service:
Code:
> service apache24 restart
Step 6. Copy/Rename OTRS cron .dist files
Code:
> cd /opt/otrs/var/cron
> mv aaa_base.dist aaa_base
> mv cache.dist cache
> mv fetchmail.dist fetchmail
> mv generate_dashboard_stats.dist generate_dashboard_stats
> mv generic_agent-database.dist generic_agent-database
> mv generic_agent.dist generic_agent
> mv pending_jobs.dist pending_jobs
> mv postmaster.dist postmaster
> mv postmaster_mailbox.dist postmaster_mailbox
> mv rebuild_ticket_index.dist rebuild_ticket_index
> mv scheduler_watchdog.dist scheduler_watchdog
> mv session.dist session
> mv unlock.dist unlock
Make sure OTRS cron jobs are running as the OTRS user:
Code:
> su otrs
> /opt/otrs/bin/Cron.sh start
Step 7. You're ready to launch! Configure the MySQL database for OTRS 4.x
Open your web browser and navigate to the URL http://ServerIPAddress/otrs/installer.pl.
Step 8. Once the OTRS MySQL database has been configured, lets create a script to automate the ZFS snapshot for /opt
Create a script called "SnapshotOTRS.sh" and placed it into the /root directory
Code:
#!/bin/sh
zfs snapshot -r zroot/opt@otrs_`date +%Y%m%d_%H%M%S`
My script also includes the ability to backup a MySQL dump as well as export the entire OTRS folder & snapshots to an smb share (or external drive if needed).
Make script executable
Code:
> chmod +x /root/SnapShotOTRS.sh
Create a cronjob to run this script daily at 6pm
Code:
> crontab -e
* 18 * * * /root/SnapshotOTRS.sh
This should get OTRS up and running in FreeBSD. Hope this was helpful.
Last edited by a moderator: