How to install LAMP and run osTicket on a CentOS 6 VPS

how-to-install-lamp-and-run-osticket-on-a-centos-6-vpsIn the following tutorial we are going to show you how you can install and configure LAMP (Linux Apache MySQL and PHP) on your CentOS 6 VPS and run your own, support ticketing system powered by osTicket.

What is osTicket?

It is an open source support ticketing system. It seamlessly routes inquiries created via email, web-forms and phone calls into a simple, easy-to-use, multi-user, web-based customer support platform.

What you need to run osTicket on your Linux Virtual Server?

  • A Webserver like Apache
  • PHP server version 5.3 or higher
  • mysqli PHP extension
  • gd PHP extension
  • gettext PHP extension
  • imap PHP extension
  • json PHP extension
  • mbstring PHP extension
  • xml PHP extension
  • MySQL Database server version 5.0 or higher

For this tutorial we are using one of our SSD VPS Hosting Plans, installed with a minimal CentOS 6 base installation.


Before proceeding any further, SSH to your server and initiate a screen session using the following command:

## screen -U -S osticket



Next thing to do, is to always make sure your CentOS VPS is fully up-to-date using:

## yum update



Since osTicket requires a webserver, a database server and a php server, you will have to set-up these on your ssd virtual server. Let’s start with the webserver, then the php server and the extensions required by osTicket and finally the database server.



Install the Apache webserver, add it to your server’s start-up and start it up using the commands below:

## yum install httpd -y
## chkconfig --levels 235 httpd on
## service httpd start

OK, you can now try to navigate to http://yourdomain.tld (which should be resolving to your VPS IP) and you should see Apache’s default page in your browser.



Proceed with the PHP installation using the command below:

## yum install php php-{cli,common,gd,mysql,imap,mbstring,xml} -y

Test your PHP installation is OK by creating info.php file in your webserver’s document root in /var/www/html using:

## echo -e "<?php\n\tphpinfo();\n?>" > /var/www/html/info.php

once the info.php file is created, reload Apache using:

## service httpd restart

Now open the info.php file in your browser (http://yourdomain.tld/info.php) and you should see various information about your PHP installation.



Install the MySQL database server, add it to your system start-up and start it up using the commands below:

## yum install mysql mysql-server -y
## chkconfig --levels 235 mysqld on
## service mysqld start

Next, you may want to run MySQL mysql_secure_installation post installation script by running the following in your terminal:

## mysql_secure_installation

Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y



At the time of writing this article, osTicket is at version 1.9.2. That being said, always make sure you get the latest version available and also be sure to change the relevant sections in the commands below:

## mkdir -p /opt/osticket
## wget -P /tmp
## unzip -d /opt/osticket /tmp/

ok, next create a symbolic link in /var/www/html/support to osTicket upload directory in /opt/osticket/upload using the following command:

## ln -s /opt/osticket/upload /var/www/html/support

At this point you are somewhat ready to start the installation of osTicket, but let’s configure Apache Vhost Directive and use to access the osTicket installation on your ssd virtual server.



First, make sure name-based virtual hosting is enabled in your Apache webserver. This is usually done by uncommenting NameVirtualHost *:80 in your main Apache configuration file in /etc/httpd/conf/httpd.conf. You can use your favorite editor to edit the configuration file or use the command below to enable this option if it’s not already enabled:

## sed -i "/^#NameVirtualHost \*:80$/ s/#NameVirtualHost \*:80/NameVirtualHost \*:80/" /etc/httpd/conf/httpd.conf

Next, append the section below to /etc/httpd/conf/httpd.conf:

<VirtualHost *:80>
    DocumentRoot /var/www/html/support

    <Directory "/var/www/html/support">
        AllowOverride All

    ErrorLog logs/
    CustomLog logs/ common

of course, make sure you replace with your actual (sub)domain name. Also, do not forget to restart apache using service httpd restart for the changes to take effect.



You also need to create a database for osTicket, so do it using the following commands:

## mysql
mysql> create database support;
mysql> grant all on support.* to support@localhost identified by 'support';
mysql> \q

this will create a new database named as support and will grant all permissions to a user named support with password support. Feel free to change these according to your needs.



Run the following commands to finalize the installation of osTicket:

## cd /var/www/html/support 
## cp include/ost-sampleconfig.php include/ost-config.php
## chown apache: -R /var/www/html/support /opt/osticket

and run the osTicket web installer at


after you have completed the installation, for security reasons it is best to remove the setup/install.php script using:

## rm -f /var/www/html/support/setup/install.php

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install osTicket for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.


How to install LDAP 389 Directory Server on a CentOS 6 VPS
Install PostgreSQL with phpPgAdmin on Ubuntu 16.04
Install osCommerce on Debian 8
  • susheelkumar

    Hi ,

    i have tried the above steps its has worked very well and appreciate for documentation
    all i have done same as per steps but when i load pages from browser they are loading in text mode
    could you please help me on this . any changes req ?


    Copyright (c) 2006-2013 osTicket Released under the GNU General Public License WITHOUT ANY WARRANTY. See LICENSE.TXT for details. vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ require(‘’); $section = ‘home’; require(CLIENTINC_DIR.’’); ?>
    getLandingPage())) echo $page->getBodyWithImages(); else echo ‘
    Welcome to the Support Center

    ‘; ?>
    Open A New Ticket

    Please provide as much detail as possible so we can best assist you. To update a previously submitted ticket, please login.
    Open a New Ticket

    Check Ticket Status

    We provide archives and history of all your current and past support requests complete with responses.
    Check Ticket Status

    isKnowledgebaseEnabled()){ //FIXME: provide ability to feature or select random FAQs ?? ?>
    Be sure to browse our Frequently Asked Questions (FAQs), before opening a ticket.

    • admin


      Author Reply

      Check that PHP by itself is working. Try to create your own PHP file, for example ‘file.php’ and add the following lines:

      < ?php echo "Hello, World!"; ?>

      Then, try to open ‘file.php’ via web browser.

      What happens then?

      Are you able to open ‘file.php’, or the web browser wants to open it as a text file too?

  • HelpdeskDude

    Sometimes SELinux blocks write to ost-config.php. You can both temporarily disable it or just make a SELinux module.

    • John


      Author Reply

      SELinux Error:
      SELinux is preventing httpd from write access on the file /opt/osticket/upload/include/ost-config.php.

      SELinux Fix (Run as root or sudo):
      chcon -R -t httpd_sys_rw_content_t ‘/opt/osticket/upload/include’