# Helpdesk Setup

Installation

Please read this page carefully and follow any instructions given.

System Requirements

- Server with PHP5 or higher. PHP7 is supported.
- Mcrypt library enabled for data encryption (not required for white label licence).
- 1 MySQL database to hold the script tables. An existing database is fine. MySQL5+ is recommended.
- MySQL Improved Extension (mysqli) functions enabled on server for database connection.
- CURL support enabled for software version check.
- Imap functions enabled on server for tickets to be opened by standard email.
- Simple XML functions enabled on server for XML API.
- JSON functions enabled on server for JSON API & Ajax responses. MUST be installed.
The installer will check what functions are available.
Finally, a good VPS or Dedicated server is recommended. Processing power is slow and unreliable on shared servers. This could impact your business and support!

Step 1: Create MySQL Database

If you haven`t already done so, create a MySQL database to hold the script tables. An existing database is fine. If you are unsure how to do this please contact your web hosting company. As many control panels differ, no one tutorial can cover all scenarios.

Step 2: Edit Connection File

Using a good quality text editor (NOT a word processor), open the following file:
control/connect.php
Perform the following operations:
1 - Edit database connection parameters to point to the database you created in step 1. Contact your host if you aren`t sure. Prefix is required if you only have a single database. This might be something with an underscore. Its fine to leave the prefix as is, so don`t change if you aren`t sure. See notes in connection file.
Example:
define('DB_HOST', 'localhost');
define('DB_USER', 'joeblogs_admin');
define('DB_PASS', '12345XX');
define('DB_NAME', 'helpdesk');
define('DB_PREFIX', 'ms_');
2 - Specify character set for database. Can be left blank if preferred. Used for 'Set Character Set' and 'Set Names'. If you aren`t sure, utf8 should be fine. See notes in connection file:
define('DB_CHAR_SET', 'utf8');
3 - Specify locale for your database. Only really required to be changed if your language isn`t English. This will ensure text data in dates converted by MySQL is in your local language. For English, 'en_GB' should be fine for all. See notes in connection file:
define('DB_LOCALE', 'en_GB');
4 - Specify secret key (or salt). This is for security and is encrypted during script execution. Random numbers, letters and characters are recommended. You can use md5 or sha1 functions for increased security if you wish. See notes in connection file.
Examples:
define('SECRET_KEY', 'fd764%^]h9[-)[87fde');
define('SECRET_KEY', md5('fd764%^]h9[-)[87fde'));
define('SECRET_KEY', sha1('fd764%^]h9[-)[87fde'));
5 - Specify cookie name for admin 'Remember Me' login. This is encrypted during script execution. Random numbers, letters and characters are recommended. Also set expiry time in days and whether cookies should only be set when a SSL certificate is detected. Leave name blank to totally disable the cookie option on admin login. See notes in connection file:
define('COOKIE_NAME', 'ms-cookie123');
define('COOKIE_EXPIRY_DAYS', 30);
define('COOKIE_SSL', 0);
6 - The option to display MySQL errors should only be enabled if you are having problems. This will display the possible problem. As its a security risk to display MySQL errors because of server paths, this is disabled by default. Instead a simple message appears whenever a MySQL error occurs. Edit as required.
SAVE FILE!
NOTE! At this point you should make sure that the file didn`t save with whitespace before the opening <?php tag or after the closing ?> tag. You should also make sure that your text editor does NOT save with the Bom Byte Order Mark. This can potentially fail PHP files and cause nothing to appear but a white screen. It is generally NOT recommended to edit files directly on the server via a control panel.

Step 3: Transfer Files to Server

Using a good FTP program such as FileZilla, WinSCP or CyberDuck, transfer the 'helpdesk' folder to your web server.
Most good FTP programs auto detect 'ascii' mode for PHP files. However, if you are presented with an option, you should specify 'ascii' and not 'binary'.
- 'helpdesk' may be renamed if you wish.
- Files can also be uploaded to root of web server if you prefer. Open 'helpdesk' folder and transfer files.
http://www.example.com/helpdesk/
http://www.example.com/

Step 4: Permissions

The following folders are required to have read/write permissions. On Linux 0777 or 0755 should be used:
admin/export/
backups/
content/attachments/
content/attachments-faq/
For help on how to change permissions on a linux server using Filezilla, click here. You can change permissions in most good FTP programs or directly on the server via the control panel. Attachment locations can be changed later if preferred.

Step 5: Accessing the Installer or Manual Install

Once the files have transferred successfully, access the 'install' folder in your browser. An example if your website was at 'example.com/helpdesk/':
http://www.example.com/helpdesk/install/
Follow the on screen instructions. At this point if you see an error message related to ionCube, you should refer to the ionCube section!
Alternatively, if you are an advanced user and you are familiar with executing SQL files, run the following file in your MySQL database management program.
docs/schematic/ms-schematic.sql (MySQL 5 or higher ONLY)
The following FREE applications can be used to administer MySQL databases:
HeidiSQL (Lightning fast Windows based software)
PHPMyAdmin (Installed on many servers as the default database software. PHP based.)
SQL Buddy (Lightweight PHP based software. Great alternative to PHPMyAdmin.)
MySQL Workbench (Alternative Windows based software from the MySQL creators. Also available for Mac.)
Sequel Pro (Mac)
Database Beaver (Windows/Mac/Linux)
NOTE: If you manually run the 'docs/schematic/ms-schematic.sql' file you do NOT need to access the install folder!

Step 6: Update Settings / Check Paths

Log into your administration area (via the 'admin' folder) using the administrative user details you entered during install. If you ran the manual install option, log in with the following email and password:
Email: admin@example.com
Pass: admin
An example if your website was at 'example.com/helpdesk/':
http://www.example.com/helpdesk/admin/
From the left menu select the following:
Settings & Tools > Settings > Helpdesk Settings
Check the following paths to make sure they are correct. The installer will have attempted to calculate these. If they haven`t or you ran the SQL file manually, these paths MUST be correct. Use the icon if you think a path is wrong and want the system to attempt to create it. Note that for attachment paths "FOLDER_NAME_HERE" should be changed to your actual folder name if renaming folders.
General > HTTP Installation Path
Attachments > Server Path to Attachments Folder
Attachments > HTTP Path to Attachments Folder
F.A.Q > Server Path to F.A.Q Attachments Folder
F.A.Q > HTTP Path to F.A.Q Attachments Folder
NOTE: A server path is NOT a http path. Examples of server paths would start:
/home/server/public_html/...
/server/www/...
c:\windows\helpdesk\..
You should also update any other settings to suit your requirements. Most options can remain as is for testing as the defaults should be fine.

Step 7: SMTP Settings

SMTP is required for ALL mail operations. Maian Support utilises the PHP Mailer system for SMTP. To enable SMTP in the system, access the SMTP settings via:
Settings & Tools > Other Options > SMTP
If you don`t have SMTP available on your server, there are a number of SMTP services around. Mandrill is a free SMTP service that allows 12,000 free emails a month.

Step 8: Crontabs/Cronjobs

The following files (in the root of your installation) should be set up to run as automated tasks:
close-tickets.php - Auto closes tickets. More info here.
db-backup.php - Database backup. More info here.
email-digest.php - Email digest with ticket info. More info here.
More info on crons here.

Step 9: Update Administrative User for Manual Install

If you ran the manual install option, make sure you update the username, email & password for this user. To do this access 'Support Team > Manage Staff' in your admin area and click edit on the relevant link. Only a single user would exist at this point.

Step 10: Add Additional Support Team Members/Users

If required, add more support team members. For support staff help, click here.

Step 11: Rename administration folder

For additional security it is highly recommended you rename your 'admin' folder. To do this perform the following operations:
1 - Manually rename the 'admin' folder to something unique. Letters, numbers, underscores or hyphens should be used, no special characters.
2 - Access the following page in your administration area via the left menu: Settings & Tools > General > Helpdesk Settings
3 - Enter your new folder name in the option 'Admin Folder Name'.

Step 12: Getting Started

Now that the system is installed, you can start testing the system.
Departments are all thats required to get the system ready for testing, once you have added 1 or more departments give the system a run through. Visitor accounts can be added manually if you wish, or will be created automatically depending on settings.
Maian Support offers a powerful, yet simple set of features for a fast, reliable help desk system. You`ll find links to relevant help pages via the 'Help' link in admin, which is found at the very top of the page.

Step 13: Templates/Colours/Images

Once you are getting familiar with the system, see the 'HTML Templates' section for help on adapting the layout into an existing website or changing colours.

Step 14: Language & Text

See the Language & Text section for further assistance.

Step 15: API

Accounts and tickets can be opened from many applications that support http posts. See the API for more info.

Comments/Feedback

If you have comments, problems or general feedback about this system, I would very much like to hear your comments. Use the contact option on the Maian Support website. If you would like to see new features, please let me know.

Video Tutorials

Some video tutorials may be available to help you get started and understand the system.
Video Tutorials
Note that the tutorials are being updated all the time and sometimes may not be available.