In this article, we will explain how to install Bludit on an Ubuntu 16.04 VPS with PHP-FPM and Nginx. Bludit is an open source, fast, simple, and extensible file-based content management system (CMS) application written in PHP. Bludit stores the data in a flat file (JSON format) so you don’t need to install or configure a database. With Bludit you will be able to easily and quickly build a fully functional site or blog in no time. This guide should work on other Linux VPS systems as well but was tested and written for an Ubuntu 16.04 VPS.
Table of Contents
1. Login to your VPS via SSH with your sudo user
ssh user@vps_IP
2. Update the system and install necessary packages
[user]$ sudo apt-get update && sudo apt-get -y upgrade [user]$ sudo apt-get install nano wget unzip
3. Install PHP and required PHP modules
To install the latest stable version of PHP version 7.0 and all necessary modules, run:
[user]$ sudo apt-get -y install php-fpm php-cli php-json php-curl php-gd php-mysql php-mbstring php-xml
The following commands will set the PHP memory limit to 512MB, set fix_pathinfo to 0, change the values of upload_max_filesize and post_max_size to 100M and set the timezone to UTC.
sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.0/cli/php.ini sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini
Create a new PHP-FPM pool for your user if you already don’t have one:
[user]$ sudo nano /etc/php/7.0/fpm/pool.d/your_user.conf [your_user] user = your_user group = your_user listen = /var/run/php/php7.0-your_user-fpm.sock listen.owner = your_user listen.group = your_user listen.mode = 0666 pm = ondemand pm.max_children = 5 pm.process_idle_timeout = 10s pm.max_requests = 200 chdir = /
Do not forget to change your_user with your username.
Restart PHP-FPM:
[user]$ sudo service php7.0-fpm restart
4. Download Bludit
Download the latest version of Bludit from the Bludit website.
[user]$ wget https://s3.amazonaws.com/bludit-s3/bludit-builds/bludit_latest.zip [user]$ unzip bludit_latest.zip [user]$ mv bludit ~/myBludit.com [user]$ rm -f bludit_latest.zip
5. Install and configure Nginx
To install the latest stable version of Nginx available on the Ubuntu repositories, run:
[user]$ sudo apt-get install nginx
Next, create a new Nginx server block:
[user]$ sudo nano /etc/nginx/sites-available/myBludit.com
server { listen 80; server_name myBludit.com; root /home/your_user/myBludit.com; index index.php; location / { try_files $uri $uri/ /index.php$is_args$args; } access_log /var/log/nginx/myBludit.com.access.log; error_log /var/log/nginx/myBludit.com.error.log; # Deny direct access to .txt files location ~* /bl-content/.*\.txt$ { return 404; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.0-your_user-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; } location ~ /\.ht { deny all; } }
Do not forget to change your_user with your username.
Activate the server block by creating a symbolic link :
[user]$ sudo ln -s /etc/nginx/sites-available/myBludit.com /etc/nginx/sites-enabled/myBludit.com
Test the Nginx configuration and restart nginx:
[user]$ sudo nginx -t [user]$ sudo service nginx restart
6. Install Bludit on Ubuntu 16.04
Open http://myBludit.com/ in your favorite web browser and you should see the Bludit install screen. On this page you’ll need to enter the admin details and click on the Install button.
That’s it. You have successfully installed Bludit on your Ubuntu 16.04 VPS. For more information about how to manage your Bludit installation, please refer to the official Bludit documentation.
Of course you don’t have to Install Bludit on Ubuntu 16.04, if you use one of our SSD Ubuntu Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post, on how to Install Bludit on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.