Install Fork CMS on a Debian VPS

forkIn this tutorial we’ll see how to install Fork CMS on a Debian 7 (Wheezy) VPS with MySQL, PHP-FPM and Nginx
Fork CMS is an open-source Content Management System written in PHP and comes with modules, themes, multi-language support, search engine optimisation and many more. Fork CMS is dedicated to creating a user friendly environment to build, monitor and update your website.

.

Install MySQL and create a database.

apt-get update
apt-get upgrade
apt-get install mysql-server mysql-client
mysql -uroot -p
CREATE DATABASE login.
GRANT ALL PRIVILEGES ON fork.* TO 'forkuser'@'localhost' IDENTIFIED BY '_FORKUSER_PASSWORD_';
FLUSH PRIVILEGES;
/q

Install Nginx and PHP-FPM

apt-get install nginx php5-fpm php-cli php5-mysql php5-gd php5-mcrypt

Install Composer and Git

apt-get install git
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

Create a root directory for your web site and clone the git repository from github

mkdir -p /var/www/yourwebsite.com/{public_html,logs}
git clone https://github.com/forkcms/forkcms.git /var/www/yourwebsite.com/public_html

Install the dependencies and set the correct permissions

cd var/www/yourwebsite.com/public_html
composer install -o
chown -R www-data: /var/www/yourwebsite.com/public_html/

Nginx configuration.
Create a new Nginx server block with the following content

# /etc/nginx/sites-available/yourwebsite.com
server {
  server_name yourwebsite.com;
  listen 80;
  root /var/www/yourwebsite.com/public_html;
  access_log /var/www/yourwebsite.com/logs/access.log;
  error_log /var/www/yourwebsite.com/logs/error.log;
  index index.php;

  location ~ ^/(backend|install|api(\/\d.\d)?(\/client)?).*\.php$ {
    try_files $uri $uri/ /index.php?$args;
  }

  location / {
    try_files $uri /index.php?$args;
  }

  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires max;
  }
  location ~ /\.ht {
    deny  all;
  }
  location ~ \.php {
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

Symlink it and restart the server

ln -s /etc/nginx/sites-available/yourwebsite.com /etc/nginx/sites-enabled/yourwebsite.com
/etc/init.d/nginx restart

Fork CMS installation

Open a browser pointing to your Fork CMS installation, and follow the on-screen instructions to complete the process.

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 this 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>