Installing Microweber on Ubuntu 16.04

Published on: Fri, Jul 6, 2018 at 11:26 am EST

Microweber is an open source drag and drop CMS and online shop. Microweber source code is hosted on GitHub. This guide will show you how to install Microweber on a fresh Ubuntu 16.04 LTS Vultr instance.

Requirements

Server requirements:

  • PHP version 5.6 or higher
  • PHP Extensions: gd, mcrypt, lib-xml must be enabled (with DOM support)
  • Nginx
  • Database server: MySQL
  • Composer

Check the Ubuntu version.

lsb_release -ds
# Ubuntu 16.04.4 LTS

Create a new non-root user account with sudo access and switch to it.

adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoe

NOTE: Replace johndoe with your username.

Set up the timezone.

sudo dpkg-reconfigure tzdata

Ensure that your system is up to date.

sudo apt update && sudo apt upgrade -y

Install PHP

Install PHP and the required PHP extensions.

sudo apt install -y php7.0 php7.0-cli php7.0-fpm php7.0-common php7.0-gd php7.0-mcrypt php7.0-mbstring php7.0-xml php7.0-mysql php7.0-pgsql php7.0-sqlite3 php7.0-zip php7.0-soap  php7.0-xmlrpc

Check the version.

php --version

Install MySQL

Install MySQL.

sudo apt install -y mysql-server

Check the version.

mysql --version
# mysql  Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using  EditLine wrapper

Run the mysql_secure_installation script to improve the security of your MySQL installation.

sudo mysql_secure_installation

Log into MySQL as the root user.

mysql -u root -p
# Enter password:

Create a new MySQL database and user, and remember the credentials.

CREATE DATABASE dbname;
GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Exit MySQL.

exit

Install Nginx

Install Nginx.

sudo apt install -y nginx

Check the version.

sudo nginx -v

Configure Nginx. Run sudo vim /etc/nginx/sites-available/microweber.conf and populate the file with the following.

server {

  listen 80;
  server_name example.com;

  root /var/www/microweber;
  index index.php;

  client_max_body_size 100M;

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

  location ~ \.php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

}

Activate the new microweber.conf configuration by linking the file to the sites-enabled directory.

sudo ln -s /etc/nginx/sites-available/microweber.conf /etc/nginx/sites-enabled/

Test the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install Microweber

Create a document root directory.

sudo mkdir -p /var/www/microweber

Change ownership of the /var/www/microweber directory to johndoe.

sudo chown -R johndoe:johndoe /var/www/microweber

Install unzip.

sudo apt install -y unzip

Download the latest release of Microweber CMS and unzip it.

cd /var/www/microweber
wget https://download.microweberapi.com/ready/core/microweber-latest.zip
unzip microweber-latest.zip
rm microweber-latest.zip

Change ownership of the /var/www/microweber directory to www-data.

sudo chown -R www-data:www-data /var/www/microweber

Open your domain name (http://example.com/) in your web browser and follow the instructions. After installation, your admin panel URL will be at http://example.com/admin.