Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-content/themes/manual/framework/includes/hook.php on line 725

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/feed-rss2.php on line 8
Dedicated Servers – AKLWEB HOST LLC Support Center https://support.aklwebhost.com Thu, 21 Mar 2024 06:49:37 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.4 How to Install Vanilla Forum on FreeBSD 12 https://support.aklwebhost.com/knowledgebase/how-to-install-vanilla-forum-on-freebsd-12/ https://support.aklwebhost.com/knowledgebase/how-to-install-vanilla-forum-on-freebsd-12/#respond Thu, 21 Mar 2024 06:49:36 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3850 Vanilla is a simple discussion forum written in PHP. Vanilla source code is publicly hosted on Github. This guide will walk you through the Vanilla installation process on a fresh FreeBSD 12 AKLWEB HOST server instance using PHP, MariaDB as a database, and Nginx as a web server.

Requirements

Vanilla Forum recommended software stack:

  • PHP version 7.2 or greater with the following extensions:
  • mbstring
  • curl
  • gd
  • PDO
  • mysqli
  • openssl
  • MySQL version 5.7 or greater, or MariaDB equivalent. This guide will use MariaDB
  • Web server software such as Nginx or Apache. This guide will use Nginx
  • SSL encryption is optional but recommended

Before you begin

Check the FreeBSD version.

uname -ro
# FreeBSD 12.0-RELEASE

Ensure that your FreeBSD system is up to date.

freebsd-update fetch install
pkg update && pkg upgrade -y

Install some basic system administration packages if they are not present on your system.

pkg install -y sudo vim unzip wget curl bash socat git unzip

Create a new user account with your preferred username (we will use johndoe).

adduser

# Username: johndoe
# Full name: John Doe
# Uid (Leave empty for default): <Enter>
# Login group [johndoe]: <Enter>
# Login group is johndoe. Invite johndoe into other groups? []: wheel
# Login class [default]: <Enter>
# Shell (sh csh tcsh nologin) [sh]: bash
# Home directory [/home/johndoe]: <Enter>
# Home directory permissions (Leave empty for default): <Enter>
# Use password-based authentication? [yes]: <Enter>
# Use an empty password? (yes/no) [no]: <Enter>
# Use a random password? (yes/no) [no]: <Enter>
# Enter password: your_secure_password
# Enter password again: your_secure_password
# Lock out the account after creation? [no]: <Enter>
# OK? (yes/no): yes
# Add another user? (yes/no): no
# Goodbye!

Run the visudo command and uncomment the %wheel ALL=(ALL) ALL line to allow members of the wheel group to execute any command.

visudo

# Uncomment by removing hash (#) sign
# %wheel ALL=(ALL) ALL

Now, switch to your newly created user with su command.

su - johndoe

NOTE: Replace johndoe with your username.

Set up the timezone.

sudo tzsetup

Install PHP

Install PHP and PHP extensions.

sudo pkg install -y php72 php72-mbstring php72-curl php72-gd php72-pdo php72-mysqli php72-pdo_mysql php72-json php72-openssl php72-ctype php72-dom php72-hash php72-iconv php72-tokenizer php72-calendar php72-fileinfo php72-session php72-simplexml php72-xml php72-filter

Check the version.

php --version
# PHP 7.2.14 (cli) (built: Jan 15 2019 01:14:39) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Soft-link php.ini-production to php.ini.

sudo ln -s /usr/local/etc/php.ini-production /usr/local/etc/php.ini

Check installed PHP extensions.

php -m
# mbstring
# curl
# gd
# PDO
# mysqli
# openssl
# . . .

Enable and start PHP-FPM.

sudo sysrc php_fpm_enable=yes
sudo service php-fpm start

Install MariaDB

Install MariaDB.

sudo pkg install -y mariadb102-client mariadb102-server

Check the version.

mysql --version
# mysql  Ver 15.1 Distrib 10.2.19-MariaDB, for FreeBSD12.0 (amd64) using readline 5.1

Start and enable MariaDB.

sudo sysrc mysql_enable="yes" 
sudo service mysql-server start

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

sudo mysql_secure_installation

Log into MariaDB as the root user.

mysql -u root -p
# Enter password:

Create a new database and user. Remember the credentials for this new user.

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

Install Nginx

Install Nginx.

sudo pkg install -y nginx

Check the version.

nginx -v
# nginx version: nginx/1.14.2

Enable and start Nginx.

sudo sysrc nginx_enable=yes
sudo service nginx start

Configure Nginx for use with Vanilla forum.

sudo vim /usr/local/etc/nginx/vanilla.conf

Populate the file with the following.

server {

  listen 80;
  server_name example.com;
  root /usr/local/www/vanilla;
  index index.php;

  location ~* /\.git { deny all; return 403; }
  location /build/ { deny all; return 403; }
  location /cache/ { deny all; return 403; }
  location /cgi-bin/ { deny all; return 403; }
  location /uploads/import/ { deny all; return 403; }
  location /conf/ { deny all; return 403; }
  location /tests/ { deny all; return 403; }
  location /vendor/ { deny all; return 403; }

  location ~* ^/index\.php(/|$) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    try_files $fastcgi_script_name =404;
    set $path_info $fastcgi_path_info;
    fastcgi_param PATH_INFO $path_info;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_NAME /index.php;
    fastcgi_param SCRIPT_FILENAME $realpath_root/index.php;
    fastcgi_param X_REWRITE 1;
    fastcgi_pass 127.0.0.1:9000;
  }

  location ~* \.php(/|$) {
    rewrite ^ /index.php$uri last;
  }
  
  location / {
    try_files $uri $uri/ @vanilla;
  }

  location @vanilla {
    rewrite ^ /index.php$uri last;
  }

}

Save the file and exit with COLON+W+Q.

Now we need to include the vanilla.conf file in the main nginx.conf file.

Run sudo vim /usr/local/etc/nginx/nginx.conf and add the following line to the http {} block.

include vanilla.conf;

Test the configuration.

sudo nginx -t

Reload Nginx.

sudo service nginx reload

Install Vanilla forum

Create a document root directory.

sudo mkdir -p /usr/local/www/vanilla

Change ownership of the /usr/local/www/vanilla directory to johndoe.

sudo chown -R johndoe:johndoe /usr/local/www/vanilla

Navigate to the document root directory.

cd /usr/local/www/vanilla

Download the latest Vanilla forum.

wget https://open.vanillaforums.com/get/vanilla-core-2.6.4.zip

Unzip it and remove the zip archive.

unzip vanilla-core-2.6.4.zip
rm vanilla-core-2.6.4.zip

Change ownership of the /usr/local/www/vanilla directory to www.

sudo chown -R www:www /usr/local/www/vanilla

Restart PHP-FPM.

sudo service php-fpm restart

Navigate to the folder where you uploaded Vanilla in your web browser and follow the instructions on the screen to complete the setup.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-install-vanilla-forum-on-freebsd-12/feed/ 0
How to Install Cachet on CentOS 7 https://support.aklwebhost.com/knowledgebase/how-to-install-cachet-on-centos-7/ https://support.aklwebhost.com/knowledgebase/how-to-install-cachet-on-centos-7/#respond Thu, 21 Mar 2024 06:43:57 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3848 Cachet is an open source status page system written in PHP. Cachet source code is hosted on this Github repo. In this article we will go over the Cachet installation process on CentOS 7 using a PHP, MariaDB and Nginx software stack.

Requirements

  • Git
  • PHP version 5.5.9 or greater
  • HTTP server with PHP support. This guide will use Nginx.
  • A supported database: MySQL/MariaDB, PostgreSQL or SQLite. This guide will use MariaDB.
  • Composer

Before you begin

Check the CentOS version.

cat /etc/centos-release
# CentOS Linux release 7.5.1804 (Core)

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

useradd -c "John Doe" johndoe && passwd johndoe
usermod -aG wheel johndoe
su - johndoe

NOTEReplace johndoe with your username.

Set up the timezone.

timedatectl list-timezones
sudo timedatectl set-timezone 'Region/City'

Ensure that your system is up to date.

sudo yum update -y

Install necessary packages.

sudo yum install -y wget curl vim git

For simplicity, disable SELinux and Firewall.

sudo setenforce 0
sudo systemctl stop firewalld
sudo systemctl disable firewalld

Install PHP and required PHP extensions

Setup the Webtatic YUM repo.

sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install PHP and required PHP extensions.

sudo yum install -y php70w php70w-cli php70w-fpm php70w-common php70w-xml php70w-gd php70w-zip php70w-mbstring php70w-mysql php70w-pgsql php70w-sqlite3 php70w-mcrypt php70w-apc

Check the version.

php --version
# PHP 7.0.30 (cli) (built: Apr 28 2018 08:14:08) ( NTS )

Start and enable PHP-FPM.

sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service

Install MariaDB and create a database

Setup the MariDB repo. Run sudo vi /etc/yum.repos.d/MariaDB.repo and populate it with the following.

[mariadb]
name = MariaDB
baseurl = https://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Install MariaDB database server.

sudo yum install -y MariaDB-server MariaDB-client

Check the version.

mysql --version
# mysql  Ver 15.1 Distrib 10.2.16-MariaDB, for Linux (x86_64) using readline 5.1

Start and enable MariaDB.

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Run mysql_secure_installation to improve security and set the password for the MariaDB root user.

sudo mysql_secure_installation

Connect to the MariaDB shell as the root user.

mysql -u root -p
# Enter password:

Create an empty MariaDB database and user for Cachet, and remember the credentials.

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

Install and configure Nginx

Install Nginx.

sudo yum install -y nginx

Check the version.

nginx -v
# nginx version: nginx/1.12.2

Start and enable Nginx.

sudo systemctl start nginx.service
sudo systemctl enable nginx.service

Configure Nginx. Run sudo vim /etc/nginx/conf.d/cachet.conf and populate the file with the following configuration.

server {
  listen 80;
  listen [::]:80;

  server_name status.example.com; # Check this
  root /var/www/cachet/public; # Check this

  index index.php;

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

  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_pass 127.0.0.1:9000; # Check this
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_index index.php;
    fastcgi_keep_conn on;
  }
}

Test the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install Composer

Install Composer globally.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer

Check the version.

composer --version
# Composer version 1.6.5 2018-05-04 11:44:59

Install Cachet

Create a document root directory.

sudo mkdir -p /var/www/cachet

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

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

Download the Cachet source code with Git and checkout the latest tagged release.

cd /var/www/cachet
git clone https://github.com/cachethq/Cachet.git .
git tag -l
git checkout v2.3.15

Copy .env.example to .env file and configure the database and APP_URL settings in .env.

cp .env.example .env
vim .env

Install dependencies with composer.

composer install --no-dev -o

Set the application key.

php artisan key:generate

Install Cachet.

php artisan app:install

Change ownership of the /var/www/cachet directory to nginx.

sudo chown -R nginx:nginx /var/www/cachet

Run sudo vim /etc/php-fpm.d/www.conf and set the user and group to nginx. Initially, it will be set to apache.

sudo vim /etc/php-fpm.d/www.conf
# user = nginx
# group = nginx

Restart PHP-FPM.

sudo systemctl restart php-fpm.service

Open your site in a web browser and follow the instructions on the screen to finish Cachet installation. To access the Cachet dashboard append /dashboard to your website URL.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-install-cachet-on-centos-7/feed/ 0
How to Install PyroCMS on CentOS 7 https://support.aklwebhost.com/knowledgebase/how-to-install-pyrocms-on-centos-7/ https://support.aklwebhost.com/knowledgebase/how-to-install-pyrocms-on-centos-7/#respond Thu, 21 Mar 2024 03:21:55 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3844 PyroCMS is an open source CMS written in PHP. PyroCMS source code is hosted on GitHub. In this guide we’ll walk through the entire PyroCMS installation process on a CentOS 7 AKLWEB HOST instance.

Requirements

Before you can install PyroCMS on a server, there are a few requirements that need to be met.

  • 1GB of RAM
  • LEMP/LAMP stack
  • PHP >= 7.0
  • PDO PHP Extension
  • cURL PHP Extension
  • SQLite PHP Extension
  • OpenSSL PHP Extension
  • Mbstring PHP Extension
  • Fileinfo PHP Extension
  • Tokenizer PHP Extension
  • GD Library (>=2.0) OR Imagick PHP extension (>=6.5.7)

Check the CentOS version.

cat /etc/centos-release
# CentOS Linux release 7.4.1708 (Core)

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

useradd -c "John Doe" johndoe && passwd johndoe
usermod -aG wheel johndoe
su - johndoe

NOTEReplace johndoe with your username.

Set up the timezone.

timedatectl list-timezones
sudo timedatectl set-timezone 'Region/City'

Ensure that your system is up to date.

sudo yum update -y

Install required and useful packages.

sudo yum install -y wget vim unzip bash-completion

Disable SELinux.

sudo setenforce 0

Install PHP and required extensions

CentOS does not provide the latest PHP version in its default software repositories. We’ll need to add a Webtatic YUM repo.

Download and install PHP 7.2 and required PHP extensions.

sudo yum install -y php72w php72w-cli php72w-fpm php72w-mysql php72w-curl php72w-sqlite3 php72w-mbstring php72w-gd php72w-dom

Check PHP version.

php --version
PHP 7.2.2 (cli) (built: Feb  4 2018 10:14:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Install MySQL/MariaDB and create a database

Download and install MariaDB.

sudo vim /etc/yum.repos.d/MariaDB.repo

# Copy/paste this to the /etc/yum.repos.d/MariaDB.repo file

[mariadb]

name = MariaDB baseurl = https://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 sudo yum install -y MariaDB-server MariaDB-client

Check the MariaDB version.

mysql --version
# mysql  Ver 15.1 Distrib 10.2.13-MariaDB, for Linux (x86_64) using readline 5.1

Start and enable MariaDB.

sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

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

sudo mysql_secure_installation

Log into MariaDB as the root user.

mysql -u root -p
# Enter password:

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

create database dbname;
grant all on dbname.* to 'username' identified by 'password';

Exit MySQL.

exit

Install and configure NGINX

Install NGINX.

sudo vim /etc/yum.repos.d/nginx_mainline.repo

# Copy/paste this to the /etc/yum.repos.d/nginx_mainline.repo file

[nginx]

name=nginx repo baseurl=https://nginx.org/packages/mainline/centos/7/$basearch/ gpgcheck=1 enabled=1 wget https://nginx.org/keys/nginx_signing.key sudo rpm –import nginx_signing.key rm nginx_signing.key sudo yum install -y nginx

Check the NGINX version.

nginx -v

Start and enable NGINX.

sudo systemctl enable nginx.service
sudo systemctl start nginx.service

Configure NGINX as a FastCGI proxy. Run sudo vim /etc/nginx/conf.d/pyro.conf and populate it with the following text.

server {
  listen 80;

  server_name example.com; # Check this
  root /var/www/pyro/public; # Check this
  
  index index.php index.html;
  charset utf-8;
  
  location / {
    try_files $uri $uri/ /index.php?$args;
  }

  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000; # Check this
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

NOTEMake sure to point the web root to Pyro’s public directory.

Test the NGINX configuration.

sudo nginx -t

Reload NGINX.

sudo systemctl reload nginx.service

Download and install Composer

Download the Composer dependencies.

sudo yum install -y curl git unzip

Download and install Composer, the dependency manager for PHP.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer

Check the Composer version.

composer --version
# Composer version 1.6.3 2018-01-31 16:28:17

Download and install PyroCMS via Composer

Create a document root directory.

sudo mkdir -p /var/www/pyro

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

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

Download the latest stable release of PyroCMS from the command line.

cd /var/www/pyro
composer create-project pyrocms/pyrocms .

NOTEYou may run out of memory when installing Pyro via Composer. It may be wise to stop Nginx, PHP-FPM and MySQL servers with sudo systemctl stop nginx.service php-fpm.service mysql.service to save on memory usage and start them again after this step.

Change the ownership of the /var/www/pyro directory to nginx.

sudo chown -R nginx:nginx /var/www/pyro

Run sudo vim /etc/php-fpm.d/www.conf and set the user and group to nginx.

sudo vim /etc/php-fpm.d/www.conf
# user = nginx
# group = nginx

Restart the php-fpm.service.

sudo systemctl restart php-fpm.service

Using your preferred web browser, open your site and follow the PyroCMS installer. After following the installer you will have PyroCMS up and running. To access the PyroCMS admin area, append /admin to your site URL.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-install-pyrocms-on-centos-7/feed/ 0
Deploy a PHP Application Using Docker-compose https://support.aklwebhost.com/knowledgebase/deploy-a-php-application-using-docker-compose/ https://support.aklwebhost.com/knowledgebase/deploy-a-php-application-using-docker-compose/#respond Tue, 19 Mar 2024 21:10:57 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3842 PHP applications are usually composed by a webserver, a relational database system and the language interpreter itself. In this tutorial we will be leveraging a full PHP application stack using docker. This is an in-depth tutorial in which we are going to build and orchestrate containers for Nginx (the webserver), MySQL (the database system) and PHP.

For the sake of this tutorial, we will write a simple application that reads a list of cities from a database and displays it on a web page, this way we will demonstrate a basic, but working, PHP application.

This guide assumes that you have Docker-CE already installed and at least a minimal working knowledge of docker. For that matter you may review the following tutorials:

Configuring our working environment

A real life docker-based application will typically be composed of several containers. Managing these manually can easily become quite messy and cumbersome. That’s where docker-compose comes into play. It helps you to manage a number of containers through a simple yaml configuration file.

Install docker-compose.

curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Create a folder to hold all the necessary files of this example and then cd into it. From now on, this is our working directory and every command will be executed inside this folder and every path will be referenced relative to it. This folder may be referenced later as WORKING_DIR.

mkdir ~/docker
cd ~/docker

Now create three more folders.

mkdir php nginx app

The php folder is where we will build our custom PHP image, the nginx folder will hold the necessary files for our custom nginx image and the app folder is where we will be putting the source code and configuration of our sample application.

Configuring the PHP container

In this example, we are going to use php-fpm to connect to the Nginx webserver. We will be using the official PHP base image. However, we also need to install and enable some extensions so that we may access the database. Inside the php folder create a file named Dockerfile and put the following contents into it.

FROM php:7.1-fpm-alpine3.4
RUN apk update --no-cache \
    && apk add --no-cache $PHPIZE_DEPS \
    && apk add --no-cache mysql-dev \
    && docker-php-ext-install pdo pdo_mysql

Note that we are using the Alpine version of the official PHP image. Alpine is a very tiny distribution targeted towards containers by providing much smaller footprints. Also, note the use of the command docker-php-ext-install, the official PHP image provides this command to ease the process of installing and configuring PHP extensions.

Now, let’s build this Docker image by issuing the following (inside our WORKING_DIR):

docker build -t aklwebhost-php php/

The docker-compose.yml file

As already mentioned, docker-compose allows you to manage a number of containers through a simple configuration file. This configuration file is typically named docker-compose.yml. Create this file inside the app folder.

touch app/docker-compose.yml

Now put the following contents into this file.

version: '2'
services:
  php:
    image: aklwebhost-php
    volumes:
      - ./:/app
    working_dir: /app

We will explain this syntax. First, note the first line.

version: '2'

This specifies the version of the docker-compose.yml configuration file used. The next line specifies the services, or in other words, the containers to be provisioned.

services:
  php:
    image: aklwebhost-php
    volumes:
      - ./:/app
    working_dir: /app

Note that every service has a specific key inside the services block. The name specified here will be used to reference this specific container later. Also note that inside the php configuration, we define the image used to run the container (this is the image we built previously). We also define a volume mapping.

volumes:
  - ./:/app

This tells docker-compose to map the current directory (./) to the /app directory inside the container. The last line sets the /app folder inside the container as the working directory, which means that this is the folder where all future commands inside a container are by default executed from.

We can now orchestrate our containers.

cd ~/docker/app
docker-compose up -d

You can run the following command to make sure that the PHP container was executed:

docker ps

How to execute commands inside the containers

Still inside the app folder, we can run any command inside a defined service container with the help of the docker-compose command.

docker-compose exec [service] [command]

The [service] placeholder refers to the service key. In our case, this was php. Let’s run a command inside the container to check our PHP version.

docker-compose exec php php -v

You will see the following output.

PHP 7.1.14 (cli) (built: Feb  7 2018 00:40:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

Configuring the Nginx container

Just like the PHP container, we need to create a custom image for the webserver. But in this case, we just need to provide a configuration for our virtual host. Make sure you are inside our WORKING_DIR and create a Dockerfile inside the nginx folder:

cd ~/docker
touch nginx/Dockerfile

Now put the following contents into this Dockerfile:

FROM nginx:1.13.8-alpine
COPY ./default.conf /etc/nginx/conf.d/default.conf

We are using the default Nginx image based on Alpine. On this Docker file we simply copy a configuration file into our application setup. Before building this image, create a configuration file.

touch nginx/default.conf

Now populate it with this content.

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /app;
    index index.php;

    #server_name server_domain_or_IP;

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

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

Note that at the fastcgi_pass php:9000 line we are referencing the PHP container by it’s name inside the service block of the docker-compose.yml configuration file. Internally docker-compose creates a network and assigns the service name as the host name to each of the services defined. We can now build the Nginx image.

docker build -t aklwebhost-nginx nginx/

Updating docker-compose.yml

Now update the app/docker-compose.yml file.

version: '2'
services:
  php:
    image: aklwebhost-php
    volumes:
      - ./:/app
    working_dir: /app
  web:
    image: aklwebhost-nginx
    volumes:
      - ./:/app
    depends_on:
      - php
    ports:
      - 80:80

We have only added a new service. The configuration is nearly the same, except for the following.

depends_on:
  - php
ports:
  - 80:80

Once the Nginx container needs the PHP service to be fully initialized, we force this requirement in the depends_on option. The ports configuration key maps a host port to a container port, here we map the port 80 in the host to the port 80 in the container.

Now create a file called index.php inside the app folder and put the following in it.

<?php phpinfo();

Make sure the port 80 is accessible through your firewall and execute the following.

cd ~/docker/app
docker-compose up -d

Once again, double check that the service is up.

docker ps

Open a browser and access [aklwebhost-instance-ip]. You may find out your AKLWEB HOST instance IP address by running the following.

hostname -I

You will see the PHP info page.

Configuring the MySQL container

The official MySQL image allows you to configure the container through simple environment variables. This can be done with an environment option inside the service block definition. Update the ~/docker/app/docker-compose.yml file to the following.

version: '2'
services:
  php:
    image: aklwebhost-php
    volumes:
      - ./:/app
    working_dir: /app
  web:
    image: aklwebhost-nginx
    volumes:
      - ./:/app
    depends_on:
      - php
    ports:
      - 80:80
  mysql:
    image: mysql:5.7.21
    volumes:
      - ./:/app
      - dbdata:/var/lib/mysql
    environment:
      - MYSQL_DATABASE=world
      - MYSQL_ROOT_PASSWORD=root
    working_dir: /app
volumes:
  dbdata:

Now we’ve defined a new service for the database. Notice the line dbdata:/var/lib/mysql. This mounts the path on the container /var/lib/mysql to a persistent volume managed by Docker, this way the database data persists after the container is removed. This volume needs to be defined in a top-level block as you can see in the end of the file.

Before orchestrating our new configuration, let’s download a sample MySQL database. The official MySQL documentation provides some sample databases. We will be using the well-known world database. This database provides a listing of countries and cities. To download this sample, execute the following inside our app folder.

curl -L http://downloads.mysql.com/docs/world.sql.gz -o world.sql.gz
gunzip world.sql.gz

Now lets orchestrate our containers.

docker-compose up -d

As you may have already noticed, the docker-compose up command starts only the containers that are not already started. It checks for the differences between your docker-compose.yml file and the current configuration of running containers.

One more time, check that the MySQL container was started.

docker ps

Now populate the world database.

docker-compose exec -T mysql mysql -uroot -proot world < world.sql

You can verify that the database was populated by selecting data directly from the database. First access the MySQL prompt inside the container.

docker-compose exec mysql mysql -uroot -proot world

In the MySQL prompt, run the following.

select * from city limit 10;

You will see a list of cities. Now quit the MySQL prompt.

mysql> exit

Building our application

Now that all of the necessary containers are up and running, we can focus on our sample application. Update the app/index.php file to the following.

<?php

$pdo = new PDO('mysql:host=mysql;dbname=world;charset=utf8', 'root', 'root');

$stmt = $pdo->prepare("
    select city.Name, city.District, country.Name as Country, city.Population
    from city
    left join country on city.CountryCode = country.Code
    order by Population desc
    limit 10
");
$stmt->execute();
$cities = $stmt->fetchAll(PDO::FETCH_ASSOC);

?>

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>AKLWEB HOST Rocks!</title>
</head>
<body>
    <h2>Most Populous Cities In The World</h2>
    <table>
    <thead>
        <tr>
            <th>Name</th>
            <th>Country</th>
            <th>District</th>
            <th>Population</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach($cities as $city): ?>
            <tr>
                <td><?=$city['Name']?></td>
                <td><?=$city['Country']?></td>
                <td><?=$city['District']?></td>
                <td><?=number_format($city['Population'], 0)?></td>
            </tr>
        <?php endforeach ?>
    </tbody>
    </table>
</body>
</html>

If you access [aklwebhost-instance-ip] in a web browser, you will see a list of the most populous cities in the world. Congratulations, you have deployed a fully working PHP application using docker.

Conclusion

In this tutorial, I have demonstrated step by step how to configuring a fully working PHP application. We built custom images for PHP and Nginx, and configured docker-compose to orchestrate our containers. Despite being very basic and simple, this setup reflects a real life scenario.

In this guide, we have built and tagged our images locally. For a more flexible setup, you can push these images to a docker registry. You may push to the official docker registry or even setup your own docker registry. In any case, this will allow you to build your images on one host and use them on another.

For a more detailed usage of docker-compose, you should refer to the official documentation.

Depending on your application requirements and the PHP framework you use, you may want to add more extensions. This can easily be done by modifying the Dockerfile used to build our custom PHP image. However, some extensions need extra dependencies to be installed in the container. You should refer to the list of extensions in the PHP official documentation to review the basic requirements of each extension.

]]>
https://support.aklwebhost.com/knowledgebase/deploy-a-php-application-using-docker-compose/feed/ 0
How to Install Vanilla Forum on CentOS 7 https://support.aklwebhost.com/knowledgebase/how-to-install-vanilla-forum-on-centos-7/ https://support.aklwebhost.com/knowledgebase/how-to-install-vanilla-forum-on-centos-7/#respond Tue, 19 Mar 2024 05:05:12 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3840 Vanilla forum is an open source forum application written in PHP. It is a fully customizable, easy to use, and supports external themes and plugins. It is packed with all the required features needed to run a forum. You can install a responsive theme to make the forum responsive to different screen sizes, or you can create a theme matching the style of your website. It supports SSO using WordPress, Jquery, SAML or OAuth. You can also set up social logins using Google, Facebook or Twitter. It easily integrates with many applications such as WordPress, MailChimp, Zendesk, Github, Salesforce and much more.

This guide was written for Vanilla Forums 2.3, but may also work on newer releases.

Prerequisites

  • A AKLWEB HOST CentOS 7 server instance.
  • A sudo user.

For this tutorial, we will use forum.example.com as the domain name pointed towards the AKLWEB HOST instance. Please make sure to replace all occurrences of the example domain name with the actual one.

Install Apache

Install Apache.

sudo yum -y install httpd

Start Apache and enable it to automatically run at boot time.

sudo systemctl start httpd
sudo systemctl enable httpd

Install PHP 7.1

We will use PHP 7.1 to obtain maximum security and stability. First, add and enable the Remi repository.

sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php71

Install the latest version of PHP along with the modules required by Vanilla Forum.

sudo yum -y install php php-gd php-mysqli php-mbstring php-curl php-cli php-pear php-devel php-openssl

Install MariaDB

MariaDB is a fork of MySQL. Add the MariaDB repository into your system. The default YUM repository contains an older version of MariaDB, which is unsupported by Vanilla.

echo "[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1" | sudo tee /etc/yum.repos.d/mariadb.repo

Install MariaDB.

sudo yum -y install mariadb mariadb-server

Start MariaDB and enable it to automatically start at boot time.

sudo systemctl start mariadb
sudo systemctl enable mariadb

Before configuring the database, you will need to secure MariaDB first.

sudo mysql_secure_installation

You will be asked for the current MariaDB root password. By default, there is no root password in a fresh MariaDB installation. Press the “Enter” key to proceed. Set a strong password for the root user of your MariaDB server and answer “Y” to all of the other questions that are asked. The questions asked are self-explanatory.

Log into the MySQL shell as root.

mysql -u root -p

Provide the password for the MariaDB root user to log in.

Run the following queries to create a database and a database user for the Vanilla installation.

CREATE DATABASE vanilla_data CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'vanilla_user'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON vanilla_data.* TO 'vanilla_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

You can replace the database name vanilla_data and username vanilla_user according to your choice. Please make sure to change StrongPassword to a very strong password.

Install Vanilla forum

Download the Vanilla forum zip archive.

wget https://open.vanillaforums.com/get/vanilla-core.zip

Install unzip.

sudo yum -y install unzip

Extract the archive.

sudo unzip vanilla-core.zip -d /var/www/vanilla

Provide the appropriate ownership.

sudo chown -R apache:apache /var/www/vanilla

Allow HTTP traffic on port 80 through the firewall.

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload

Create virtual host

Create a virtual host for your Vanilla forum site.

sudo nano /etc/httpd/conf.d/forum.example.com.conf

Populate the file.

<VirtualHost *:80>
    ServerName forum.example.com
    DocumentRoot /var/www/vanilla
    <Directory /var/www/vanilla>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Restart Apache.

sudo systemctl restart httpd

Wrapping Up

Now that you have successfully installed and configured Vanilla forum, you can access the application on http://forum.example.com. Provide the database and administrator details. Once you have provided the required database and admin details, the setup will write into the database and you will be taken to the administration interface. You can now configure the forum according to your needs.

Congratulations, you have successfully installed Vanilla forum in CentOS 7 server.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-install-vanilla-forum-on-centos-7/feed/ 0
How to Install OroCRM on CentOS 7 https://support.aklwebhost.com/knowledgebase/how-to-install-orocrm-on-centos-7/ https://support.aklwebhost.com/knowledgebase/how-to-install-orocrm-on-centos-7/#respond Tue, 19 Mar 2024 05:00:07 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3838 OroCRM is a free and open source Customer Relationship Manager (CRM) application built on OroPlatform. OroPlatform is fully customizable open source business application platform software. OroPlatform provides you with all the features that are required to create a customized application. OroCRM is built using PHP Symfony framework and stores its data into the MySQL/MariaDB database server. It is an enterprise-ready CRM application providing tons of features. It also integrates with many 3rd party applications such as Magento Store, MailChimp, Zendesk etc. It is multilingual and has a fully responsive user interface, which provides you with the capability to manage it using mobile devices also.

Prerequisites

  • A AKLWEB HOST CentOS 7 server instance.
  • A sudo user.

In this tutorial, we will use crm.example.com as the domain name pointed to the server. Replace all occurrences of crm.example.com with your actual domain name.

Install Nginx and PHP 7

OroCRM can be installed on any production web server supporting PHP. OroCRM supports all versions of PHP greater than 7.0. In this tutorial, we will use Nginx with PHP-FPM and PHP 7.1.

Install Nginx.

sudo yum -y install nginx

Start Nginx and enable it to automatically start at boot.

sudo systemctl start nginx
sudo systemctl enable nginx

PHP 7 is not available in the default YUM repository, but we can use the Remi repository to obtain and install the latest builds of PHP 7. First, add and enable the Remi repository.

sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php71

Install the latest version of PHP 7 along with the PHP modules required by OroCRM.

sudo yum -y install php php-fpm php-ctype php-curl php-fileinfo php-gd php-intl php-json php-mbstring php-mcrypt php-mysql php-pcre php-simplexml php-tokenizer php-xml php-zip php-tidy php-soap php-opcache php-posix

Edit the default PHP configuration file.

sudo nano /etc/php.ini

Find the following lines. Uncomment and make changes as shown.

date.timezone = Asia/Kolkata
;Replace "Asia/Kolkata" with your appropriate timezone
    
memory_limit = 512M
cgi.fix_pathinfo=0

Edit the PHP-FPM configuration file.

sudo nano /etc/php-fpm.d/www.conf

By default, PHP-FPM is configured to run with Apache and to listen to the port 9000. We will need to change the user and group, as well as the Unix socket file on which it will run. Find the following lines and make necessary changes as shown.

user = nginx
group = nginx

;listen = 127.0.0.1:9000
;Comment out or remove the above line and add the following line.
listen = /var/run/php-fpm/php-fpm.sock

listen.owner = nobody
listen.group = nobody

Start PHP-FPM and enable it to start at boot.

sudo systemctl start php-fpm
sudo systemctl enable php-fpm

Provide ownership of PHP-FPM socket file to Nginx user.

sudo chown nginx:nginx /var/run/php-fpm/php-fpm.sock

Install MariaDB

MariaDB is an open source fork of MySQL. Install MariaDB.

sudo yum -y install mariadb mariadb-server

Start MariaDB and enable it to automatically start at boot.

sudo systemctl start mariadb
sudo systemctl enable mariadb

The default installation of MariaDB comes with a few test databases and anonymous users. Before configuring the database, you will need to secure the MariaDB server first. You can secure it by running the mysql_secure_installation script.

sudo mysql_secure_installation

You will be asked for the current MariaDB root password. By default, there is no root password in a fresh MariaDB installation. Press the Enter key to proceed. Set a strong password for the root user of your MariaDB server and answer Y to all the other questions asked. The questions asked are self-explanatory.

Create the Database for OroCRM

Log in to the MySQL shell as the root user by running.

mysql -u root -p

Provide the password for the MariaDB root user to log in.

Run the following queries to create a database and a database user for OroCRM installation.

CREATE DATABASE oro_data;
CREATE USER 'oro_user'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON oro_data.* TO 'oro_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

You can replace the database name oro_data and username oro_user according to your choice. Be sure to change StrongPassword to a very strong password.

Install Node.js and Composer

OroCRM also requires Node.js JavaScript runtime. Node.js will be used by OroCRM to compile the JavaScript, which is used to build the user interface of the application. The default repository of CentOS contains an outdated version of Node.js, thus you will need to add the Nodesource repository to your system to obtain the latest version.

sudo curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

Install Node.js and Git.

sudo yum -y install nodejs git

Git will be used to clone the OroCRM repository from the internet. You will also need to install Composer. Composer is a dependency manager tool for PHP applications. Because OroCRM is written in Symfony framework, you will need Composer to install the dependencies and application.

Install Composer.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Move Composer to the /usr/bin directory so that it can be executed from anywhere in the system.

sudo mv composer.phar /usr/bin/composer

Provide execution permission to the Composer.

sudo chmod +x /usr/bin/composer

Install OroCRM

There are many ways to download OroCRM on your server. The most appropriate way to get the most updated version is to clone the repository through Git.

Clone the OroCRM repository.

cd /usr/share/nginx/
sudo git clone -b 2.3 https://github.com/oroinc/crm-application.git orocrm

Copy the example parameters file to the default parameters file used by OroCRM.

cd orocrm
sudo cp app/config/parameters.yml.dist  app/config/parameters.yml

Before you can proceed further, you will need to update the parameters.yml file to provide database and email information.

sudo nano app/config/parameters.yml

Find the following lines.

database_driver:   pdo_mysql
database_host:     127.0.0.1
database_port:     ~
database_name:     oro_crm
database_user:     root
database_password: ~

Update the above configuration according to the database you have created to store OroCRM data. In our case, it should look like this.

database_driver:   pdo_mysql
database_host:     127.0.0.1
database_port:     3306
database_name:     oro_data
database_user:     oro_user
database_password: StrongPassword

If you have an SMTP server ready and you wish to use email sending features immediately, you can update the mailer settings as shown.

mailer_transport:  smtp
mailer_host:       mail.example.com
mailer_port:       456
mailer_encryption: ssl
mailer_user:       mails@example.com
mailer_password:   EMailPassword

If you do not have a mail server ready, you can skip it for now by leaving the existing values. You can always change email configuration through the dashboard.

Set a random string in secret by replacing ThisTokenIsNotSoSecretChangeIt. A random string is required to encode the session data. An example string will look like this.

secret: uxvpXHhDxCFc9yU1hV1fMwjSoyVUzGh4WBMBBBa3XEgrRUF5OuB2h8iNl9JRDqcd

You can generate a random string using the pwgen utility. Install pwgen utility by running sudo yum -y install pwgen. To generate a random string, run pwgen -s 64 1.

Save the file and exit from the editor. Install the required PHP dependencies through composer.

sudo composer install --prefer-dist --no-dev

Using --no-dev will ensure that the Composer only installs the dependencies required to run the web server in production mode. The script will take a few minutes to download and install the required PHP dependencies.

Install the application.

sudo php app/console oro:install --env=prod

This will build the web cache and write the database. The --env=prod parameter is provided to install the application in production mode. The installation will only proceed if all the required dependencies are installed and configured.

During the installation, you will be asked few questions for setting up the administrator account. The questions are as follows.

Administration setup.
Application URL (http://localhost): http://crm.example.com
Organization name (OroCRM): My Organization
Username (admin):
Email: mail@example.com
First name: John
Last name: Doe
Password:
Load sample data (y/n): y

Provide the information. Load the sample data to evaluate the product before using it for production.

Warm up the API documentation cache:

sudo php app/console oro:api:doc:cache:clear

Configuring Nginx, Firewall and Permissions

Create an Nginx server block file to serve the application to the users.

sudo nano /etc/nginx/conf.d/orocrm.conf

Populate the file.

server {
    server_name crm.example.com;
    root  /usr/share/nginx/orocrm/web;

    location / {
        # try to serve file directly, fallback to app.php
        try_files $uri /app.php$is_args$args;
    }

    location ~ ^/(app|app_dev|config|install)\.php(/|$) {
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }

    # Enable Gzip compression
    gzip on;
    gzip_buffers 16 8k;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_min_length 1000;
    gzip_http_version 1.0;
    gzip_proxied any;
    gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css image/svg+xml;
    gzip_vary on;    

    # Enable browser caching
    # One week for javascript and css
     location ~* \.(?:css|js) {
       expires 1w;
       access_log off;
       add_header Cache-Control public;
     }

     # Three weeks for media: images, fonts, icons, video, audio etc.
     location ~* \.(?:jpg|jpeg|gif|png|ico|tiff|woff|eot|ttf|svg|svgz|mp4|ogg|ogv|webm|swf|flv)$ {
       expires 3w;
       access_log off;
       add_header Cache-Control public;
     }

    error_log /var/log/nginx/orocrm_error.log;
    access_log /var/log/nginx/orocrm_access.log;
}

Make sure that you change the crm.example.com with your actual domain name. The above configuration also includes the configuration required for GZip compression and browser caching. Gzip compression compresses the data before sending it to the browser. Enabling browser caching stores the static resources to the web cache of the client computer. The next time the user accesses the site, most of the static content is loaded from the user’s own web cache. These two methods increase the speed of the application dramatically.

Check the Nginx configuration file for any errors.

sudo nginx -t

The output should look like the following.

[user@aklwebhost ~]$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Provide the ownership of the OrOCRM files to the Nginx user.

sudo chown -R nginx:nginx /usr/share/nginx/orocrm

Restart Nginx to apply the new configuration.

sudo systemctl restart nginx

If you are running a firewall on your server, you will need to configure the firewall to set an exception for HTTP service. Allow Nginx to connect from outside the network.

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload

You can now access the application at http://crm.example.com. Log in using the administrator username and password you have set during installation.

Setup Scheduled Tasks and Background Jobs

To automatically run the scheduled tasks you can add a Cron job entry. Open crontab.

sudo crontab -e

Add the following line to the file.

*/1 * * * * /usr/bin/php /usr/share/nginx/orocrm/app/console oro:cron --env=prod > /dev/null

This will run the cron job every minute so that the scheduled tasks such as email queues are processed earliest.

You will also need to setup Supervisor to run the Message Queue service. It is required that at least one process is running at all times for a consumer to process the messages. A consumer can normally interrupt the message process through many ways. To ensure that the service is running continuously, we will use the Supervisor service. We will configure Supervisor to run four processes in parallel. If any of the four processes is stopped for any reason, the Supervisor will try to start it again.

Install Supervisor.

sudo yum -y install supervisor

Edit the Supervisor configuration file.

sudo nano /etc/supervisord.conf

Add the following lines at the end of the file.

[program:oro_message_consumer]
command=/usr/bin/php /usr/share/nginx/orocrm/app/console --env=prod --no-debug oro:message-queue:consume
process_name=%(program_name)s_%(process_num)02d
numprocs=4
autostart=true
autorestart=true
startsecs=0
user=nginx
redirect_stderr=true

Start and enable Supervisor to automatically start at boot time.

sudo systemctl start supervisord
sudo systemctl enable supervisord

You can view the status of the processes by running the following.

sudo supervisorctl status

You should see that the processes are running.

[user@aklwebhost ~]$ sudo supervisorctl status
oro_message_consumer:oro_message_consumer_00   RUNNING   pid 13596, uptime 0:02:13
oro_message_consumer:oro_message_consumer_01   RUNNING   pid 13595, uptime 0:02:13
oro_message_consumer:oro_message_consumer_02   RUNNING   pid 13594, uptime 0:02:13
oro_message_consumer:oro_message_consumer_03   RUNNING   pid 13593, uptime 0:02:13

OroCRM is now installed on your server. You can now use the application to manage the routine tasks of your organization. To learn more about OroCRM, you can visit its official website.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-install-orocrm-on-centos-7/feed/ 0
How to Setup ionCube Loader on CentOS 7 https://support.aklwebhost.com/knowledgebase/how-to-setup-ioncube-loader-on-centos-7/ https://support.aklwebhost.com/knowledgebase/how-to-setup-ioncube-loader-on-centos-7/#respond Tue, 19 Mar 2024 04:42:25 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3836 Most commercial PHP applications require ionCube Loader, a PHP plugin that enables a web server to run PHP files that have been encoded using ionCube Encoder.

We will install ionCube Loader for PHP 7.1 on CentOS 7 in this article. Other platform instructions may differ.

Prerequisites

  • A CentOS 7 x64 instance.
  • An Apache web server properly installed. Say the web root directory is /var/www/html.
  • PHP version 7.1.
  • A sudo user.
  • Firewall rules finely tuned. At least the HTTP 80 port should be open.

Step 1: Download and prepare ionCube Loader packages for CentOS 7

Since CentOS 7 is a 64-bit Linux distribution, you should download the ionCube 64-bit Linux package as follows:

cd
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar -zxvf ioncube_loaders_lin_x86-64.tar.gz -C /usr/lib64/php/modules
sudo chown -R root:root /usr/lib64/php/modules/ioncube
sudo cp /usr/local/ioncube/loader-wizard.php /var/www/html
sudo systemctl restart httpd.service

Now, an ionCube Loader setup script loader-wizard.php has been copied to the web root directory /var/www/html. We will use that script to Configure and test ionCube Loader on the server.

Note: This tutorial assumes your Document Root is /var/www/html. If you have your web server configured differently, you need to place loader-wizard.php in a directory where you can access it via your web browser.

Step 2: Configure ionCube Loader

  1. Point your web browser to http://203.0.113.1/loader-wizard.php to enter the ionCube Loader Wizard interface.
  2. In the ionCube Loader Wizard interface, choose the Dedicated or VPS (server with full root ssh access) option.
  3. Input hosting provider name and URL as follows:
  1. click the Next button.
  2. Create an PHP ini file to specify the location of ionCube Loader for PHP 7.1:echo ‘zend_extension = /usr/lib64/php/modules/ioncube/ioncube_loader_lin_7.1.so’ | sudo tee /etc/php.d/00-ioncube.ini

Note: If your version of PHP is different from PHP 7.1, you should specify the proper ionCube Loader file in above command accordingly. Use the command php -v to confirm the PHP version.

  1. Restart Apache to load the update:sudo systemctl restart httpd.service
  2. Go back to the ionCube Loader Wizard interface, and then use the link click here to test the Loader to test your installation.
  3. If nothing goes wrong, you should see the Loader Installed Successfully message.
  4. For security purposes, you should delete the IonCube loader wizard script in the web root directory once you pass the test:sudo rm /var/www/html/loader-wizard.php

That’s all. Having the ionCube Loader module properly installed, you are eligible to install any app licensed with ionCube on your server now. Enjoy it.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-setup-ioncube-loader-on-centos-7/feed/ 0
How To Install Zikula on CentOS 7 https://support.aklwebhost.com/knowledgebase/how-to-install-zikula-on-centos-7/ https://support.aklwebhost.com/knowledgebase/how-to-install-zikula-on-centos-7/#respond Sun, 17 Mar 2024 10:34:11 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3834 Introduction

PHP-based Zikula is an open-source framework for online applications. With Zikula, you can create editable and interactive webpages. It is a cross-platform program that works with every widely used operating system. For database-related tasks, Zikula uses Microsoft SQL Server, Oracle, PostgreSQL, and MySQL on the back end.

We’ll talk about installing Zikula on a CentOS 7 server in this article.

Prerequisites

  • AKLWEB HOST CentOS 7 server instance that has just been deployed.
  • A user on your server who is not root but has sudo capabilities set up.
  • 192.168.15.110 set as a static IP address on your machine. This would be your server’s primary IP address.

Step 1: Update the system

First, update your system to the latest stable version by running the following command:

sudo yum update -y
sudo reboot

Step 2: Install LAMP Server Packages

You will need to install Apache, MariaDB, PHP and other required PHP modules on your system. You can install all of these packages with the following command:

sudo yum install httpd mariadb mariadb-server php php-common php-mysql php-mcrypt php-gd php-xml php-mbstring php-xmlrpc unzip wget -y

Once the installation is complete, start both Apache and MariaDB services and enable them to start at boot with the following commands:

sudo systemctl start httpd
sudo systemctl start mariadb
sudo systemctl enable httpd
sudo systemctl enable mariadb

Configure MariaDB Database By default

MariaDB installation is not hardened, so you will need to secure it first. You can secure it with the following script:

sudo mysql_secure_installation

Answer all of the questions as follows.

Set root password? [Y/n] n
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

Next, login to the MariaDB console.

mysql -u root -p

This will prompt you for a password, enter your MariaDB root password. After logging in, create a database for Zikula:

MariaDB [(none)]>CREATE DATABASE zikuladb;
MariaDB [(none)]>GRANT ALL PRIVILEGES on zikuladb.* to 'user'@'localhost' identified by 'password';
MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]>exit

Install Zikula First

you will need to download the latest version of the Zikula CMS from GitHub. You can also download it using the wget command.

wget https://github.com/zikula/core/releases/download/1.4.6/Zikula_Core-1.4.6.build119.zip

Extract the downloaded zip archive.

unzip Zikula_Core-1.4.6.build119.zip

Move the extracted directory into the Apache root directory.

sudo mv Zikula_Core-1.4.6 /var/www/html/zikula

Give necessary permission to zikula directory.

sudo chown -R apache:apache /var/www/html/zikula

Access Zikula Web Interface

Before accessing Zikula, you will need to allow port 80 through firewalld. You can do this with the following command:

sudo firewall-cmd --permanent --zone=public --add-port=80/tcp
sudo firewall-cmd --reload

Open your web browser and type the URL http://192.168.15.110/install.php or http://your-domain.com/install.php, then complete the required the steps to finish the installation.

Thats it. You have successfully installed Zikula on your CentOS 7 server.

]]>
https://support.aklwebhost.com/knowledgebase/how-to-install-zikula-on-centos-7/feed/ 0
Setup a Symfony 3 Application on Linux https://support.aklwebhost.com/knowledgebase/setup-a-symfony-3-application-on-linux/ https://support.aklwebhost.com/knowledgebase/setup-a-symfony-3-application-on-linux/#respond Sun, 17 Mar 2024 10:21:18 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3832 One of the most widely used PHP frameworks, Symfony, makes it simple and quick to create your own applications. With a large developer community and a variety of decoupled and reusable components, Symfony has drawn a lot of interest from the open-source community.

I’ll walk you through the process of installing and configuring Symfony 3.0.0 for AKLWEB HOST LEMP VPS application development in this post.

  • Install a Linux server instance that has PHP upgraded to at least PHP 5.4. The application for Vultr LEMP is eligible.
  • Use sudo rights to log in as a non-root user.

Step 1: Download the Symfony installer

The officially recommended method to install Symfony is to use the Symfony installer.

Log in from an SSH terminal, input:

sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony

Now you can use the symfony command from your shell.

Step 2: Create the Symfony application

Create a new application with Symfony:

symfony new my_project

This command will create a directory called my_project in your home directory to host all of your application files.

If you want to specify the version of Symfony, append the version number to the command mentioned above, like:

symfony new my_project 2.6
symfony new my_project 2.6.5
symfony new my_project 2.7.0-RC1
symfony new my_project lts

Step 3: Run and verify the Symfony application

Execute the following commands to start the Symfony application:

cd my_project/
php bin/console server:run

If the operation was successful, you will see the prompt [OK] Server running on http://127.0.0.1:8000 appear on your screen. You can verify the result by accessing the URL http://127.0.0.1:8000/ from a web browser.

Keep the command running in the current SSH terminal. Open another SSH terminal and download a text browser called Lynx:

sudo yum install -y lynx

Visit http://127.0.0.1:8000/ from Lynx:

lynx http://127.0.0.1:8000/

You will see the welcome page of Symfony: “Welcome to Symfony 3.0.0”. Then press Shift + Q to quit Lynx.

If by any chance you see a blank page or an error page instead of the welcome page, you can try to fix the problem by reconfiguring the permissions on the ~/my_project/var/cache and ~/my_project/var/logs directories. Visit the Symfony website for more details.

Step 4: Check Symfony application configuration

You can also use a server configuration tester to check if your environment is ready for using Symfony. Access the following URL while your Symfony application is running:

lynx http://localhost:8000/config.php

In the Vultr LNMP environment, the server configuration tester will recommend us to install and enable the intl extension (used for validators) for a better Symfony experience. Here is the solution:

  1. Press the down arrow once, then press Shift + Q to quit the Lynx browser.
  2. Check the version of PHP on the server: php -v
  3. Query and install the intl extension of the same version (my server was running PHP 5.5): yum list php*intl sudo yum install php55u-intl.x86_64
  4. Reboot the system: sudo reboot
  5. Log in and check the Symfony application configuration again, you will find that the problem has been solved (“All checks passed successfully.”).

Congratulations! You have setup a Symfony application.

]]>
https://support.aklwebhost.com/knowledgebase/setup-a-symfony-3-application-on-linux/feed/ 0
Resize a Cloud Server File System with a Graphical Partition Editor https://support.aklwebhost.com/knowledgebase/resize-a-cloud-server-file-system-with-a-graphical-partition-editor/ https://support.aklwebhost.com/knowledgebase/resize-a-cloud-server-file-system-with-a-graphical-partition-editor/#respond Tue, 30 May 2023 14:19:52 +0000 https://support.aklwebhost.com/?post_type=manual_kb&p=3772 Introduction

This guide explains how to add, grow, and shrink partitions of a AKLWEB HOST cloud server with GParted, a graphical partition editor. If you have upgraded your cloud server with a larger disk or need to expand a partition while preserving data, follow these steps. A cloud server instance is sometimes called a Virtual Private Server or VPS.

This guide temporarily boots your cloud server with the SystemRescue x64 ISO to run GParted, which works with a majority of operating systems.

1. Make a Backup

âš  NOTE: These operations make destructive changes to the cloud server’s file system. You can lose data if you make a mistake following these directions. Make a snapshot of the server before performing any of these steps. If your data is critical, please test the snapshot before proceeding. Deploy a new test instance with the snapshot, then verify the test instance boots and has the correct data.

2. Boot SystemRescue

  1. Navigate to your cloud server information page.
  2. Click the Settings tab.
  3. Click Custom ISO on the left menu.
  4. Select SystemRescue from the ISO Library drop-down.
  5. Click Attach ISO and Reboot.

3. Launch GParted

  1. Open the web console from the server information page.
  2. Type ENTER to select the default, Boot SystemRescue using default options.
  3. Enter startx at the root prompt.
  4. When the graphical desktop appears, navigate to System > GParted.System GParted

Check a Partition

Before making changes, check the partition for errors. Right-click on the partition and select Check, which adds the operation to the pending queue.

Check Filesystem

To run the check, click the Apply All Operations icon in the toolbar. Click Apply on the pop-up confirmation dialog.

Apply Operation

Grow, Shrink, or Move a Partition

Right-click on the partition you want to modify. Choose Resize/Move.

Expand Partition

Adjust the partition by dragging the size handles, or adjust the size fields, then click Resize/Move, which adds the operation to the pending queue. Next, click the Apply All Operations icon to resize the partition.

Resize

Add a Partition

Right-click an unallocated area and choose New.

New Partition

Enter the partition information, then click Add to add the operation to the pending queue. Next, click the Apply All Operations icon to resize the partition.

Create New

Detach and Reboot

When all operations are complete, detach the ISO and reboot the server. Navigate to the server information page and click Remove ISO.

Next Steps

If you added or removed partitions, you may need to adjust the mount points in /etc/fstab. Refer to the fstab documentation or the documentation specific to your distribution.

More Resources

]]>
https://support.aklwebhost.com/knowledgebase/resize-a-cloud-server-file-system-with-a-graphical-partition-editor/feed/ 0