How To Install WordPress on Ubuntu 17.04

Install WordPress on Ubuntu 17

WordPress is an online, open source website creation tool written in PHP. But in non-geek speak, it’s probably the easiest and most powerful blogging and website content management system (or CMS) in existence today.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation WordPress content management systems on an Ubuntu 17.04 Zesty Zapus server.
Install WordPress on Ubuntu 17.04 Zesty Zapus

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 17.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc php7.0-gd

Step 3. Installing WordPress on Ubuntu 17.04.

First thing to do is to go to WordPress’s download page and download the latest stable version of WordPress, At the moment of writing this article it is version 4.8:

wget http://wordpress.org/latest.zip

Unpack the WordPress archive to the document root directory on your server:

unzip -q latest.zip -d /var/www/html/
cd wordpress
cp -a * ..

We will need to change some folders permissions:

chown www-data:www-data -R /var/www/html/

We need to create the upload directory manually:

mkdir -p /var/www/html/wp-content/uploads

Allow the Apache web server to write to the uploads directory. Do this by assigning group ownership of this directory to your web server which will allow Apache to create files and directories. Issue the following command:

chown www-data:www-data -R /var/www/html/wp-content/uploads

Step 4. Configuring MariaDB for WordPress.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- 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

Next we will need to log in to the MariaDB console and create a database for the WordPress. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for WordPress installation:

CREATE DATABASE wordpress character set utf8 collate utf8_bin;
GRANT ALL PRIVILEGES on wordpress.* to 'wpuser'@'localhost' identified by 'your_password';
FLUSH PRIVILEGES;
exit

Step 5. Configuring WordPress

In this step we will configure the main configuration file of WordPress, where we need to configure it’s basic parameters so that it can be connected with the database and user:

mv wp-config-sample.php wp-config.php

Now open it using any of your favourite editor, to make any changes in the WordPress configuration file:

nano wp-config.php

Here are the values that we need to update according to our previous database and user’s setup:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wpuser');

/** MySQL database password */
define('DB_PASSWORD', 'your_password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Step 6. Configuring Apache web server for WordPress.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘wordpress.conf’ on your virtual server:

sudo a2enmod rewrite
touch /etc/apache2/sites-available/wordpress.conf
ln -s /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-enabled/wordpress.conf
nano /etc/apache2/sites-available/wordpress.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Next step we will need to adjust the some some values in the PHP configuration files as follow:

nano /etc/php/7.0/apache2/php.ini

Add/modify the following settings:

max_execution_time = 300
max_input_time = 600
memory_limit = 256M
post_max_size = 64M
upload_max_filesize = 64M

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 7. Accessing WordPress.

WordPress will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://server-ip/ and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed WordPress. Thanks for using this tutorial for installing WordPress CMS (Content Management Systems) on your Ubuntu 17.04. For additional help or useful information, we recommend you to check the official WordPress web site.

How To Install IonCube Loader on Ubuntu 16.04 LTS

Install IonCube Loader on Ubuntu 16

IonCube Loaders is basically an encryption/decryption utility for PHP applications which also assists in speeding up the pages that are served. It is often required for a lot of PHP-based applications.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Vesta Control Panel on a Ubuntu 16.04 (Xenial Xerus) server.

Install IonCube Loader on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing IonCube Loaders.

Download and extract the latest stable version ioncube, We will use the wget command to get the ionCube file from their website with the following command:

### 64-Bit version ###
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xfz ioncube_loaders_lin_x86-64.tar.gz

### 32-Bit version ###
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
tar xfz ioncube_loaders_lin_x86.tar.gz

Next we need to locate where PHP is loading extensions, this can be done by running the below command and looking:

php -i | grep php.ini

You will see an output that looks something like the following:

extension_dir => /usr/lib/php/20151012 => /usr/lib/php/20151012

Open the extracted ioncube folder and copy the ioncube loader file match to your php version:

cd ioncube
cp ioncube_loader_lin_7.0.so /usr/lib/php/20151012

Once the file has been copied to the extensions directory, we need to make sure that the PHP configuration file is updated to use the correct extension:

nano /etc/php.ini

At the very top of the file let’s add the following line:

zend_extension = "/usr/lib/php/20151012/ioncube_loader_lin_7.0.so"

Now, we can restart Apache web server and PHP so that the changes take place:

systemctl restart apache2.service
systemctl restart php7.0-fpm.service

Step 4. Testing ionCube on Ubuntu 16.04.

If you can see the version of PHP with ionCube loader version, meaning you have successfully installed and configured ioncube PHP loader in your Ubuntu 16.04 system.

php -v

Results:

PHP 7.0.15-0ubuntu0.16.04.6 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
<strong>with the ionCube PHP Loader (enabled)</strong> + Intrusion Protection from ioncube24.com (unconfigured) v6.0.8, Copyright (c) 2002-2015, by ionCube Ltd.

Congratulation’s! You have successfully installed IonCube Loader. Thanks for using this tutorial for installing IonCube Loader in Ubuntu 16.04 Xenial Xerus system. For additional help or useful information, we recommend you to check the official IonCube web site.

How To Install phpBB on Ubuntu 16.04 LTS

Install phpBB on Ubuntu 16

phpBB is an open source bulletin board forum software that provides a virtual space for discussion among the members of your website. It has a huge variety of features like flat topic structure, sub-forums, forum-specific styles, user groups, group-based permissions, database query and template caching, support for PHP 7, multiple database engines and much more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation phpBB open source bulletin board forum on an Ubuntu 16.04 Xenial Xerus server.

Install phpBB on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc php7.0-gd

Step 3. Installing phpBB.

First thing to do is to go to phpBB’s download page and download the latest stable version of phpBB, At the moment of writing this article it is version 3.2.1:

wget https://www.phpbb.com/files/release/phpBB-3.2.1.zip

Unpack the phpBB archive to the document root directory on your server:

unzip -q phpBB-3.2.1.zip -d /var/www/html/
cd phpBB3
cp -a * ..

We will need to change some folders permissions:

cd /var/www/html/
chown www-data:www-data -R /var/www/html/
chmod 660 images/avatars/upload/ config.php
chmod 770 store/ cache/ files/

Step 4. Configuring MariaDB for phpBB.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- 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

Next we will need to log in to the MariaDB console and create a database for the phpBB. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for phpBB installation:

create database phpBB;
create user 'phpBB_dbuser'@'localhost' identified by 'randomgeneratedpassword';
grant all privileges on phpBB.* to 'phpBB_dbuser'@'localhost';
flush privileges;
exit

Step 5. Configuring Apache web server for phpBB.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘phpbb.conf’ on your virtual server:

sudo a2enmod rewrite
touch /etc/apache2/sites-available/phpbb.conf
ln -s /etc/apache2/sites-available/phpbb.conf /etc/apache2/sites-enabled/phpbb.conf
nano /etc/apache2/sites-available/phpbb.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 6. Accessing phpBB.

phpBB will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/install or http://server-ip/install and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed phpBB. Thanks for using this tutorial for installing phpBB on your Ubuntu 16.04. For additional help or useful information, we recommend you to check the official phpBB web site.

How To Install Monica on Ubuntu 16.04 LTS

Install Monica on Ubuntu

Monica is a Personal Relationship Management (PRM) system Composed in Laravel framework. It’s designed and built to Assist You have more Meaningful relationships with your family and friends, and keep tabs on All important details about your friends and family.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Monica on an Ubuntu 16.04 Xenial Xerus server.

Install Monica on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-xmlrpc php7.0-gd

Step 3. Configuring MariaDB for Monica.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- 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

Next we will need to log in to the MariaDB console and create a database for the Monica. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Monica installation:

CREATE DATABASE monica;
GRANT ALL PRIVILEGES ON monica.* TO 'monicauser'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
FLUSH PRIVILEGES;
\q

Step 4. Installing Monica.

First, Clone the Monica git repository:

mkdir /var/www/html/monica
git clone https://github.com/monicahq/monica.git /var/www/html/monica/

We will need to change some folders permissions:

chown -R www-data:www-data /var/www/html/monica

Installing nodejs:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install -y nodejs

Installing composer:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Once all dependencies installed, run composer in the directory the repository has been cloned, to install Monica’s:

cd /var/www/html/monica
composer install

Create .env file using the example provided and update it with your information:

cp .env.example .env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=monica
DB_USERNAME=monicauser
DB_PASSWORD=YOURPASSWORD
DB_TEST_DATABASE=monica_test
DB_TEST_USERNAME=monicauser
DB_TEST_PASSWORD=YOURPASSWORD

Run the following command to generate an application key:

php artisan key:generate
Application key [base64:j8RgNwHGsqir1ovhDWXYlEa6BMWe46wRGMaQTm4ZBTs=] set successfully.

Run all migrations executing the following command:

php artisan migrate

Enable avatar uploads for the contacts created in Monica:

php artisan storage:link
The [public/storage] directory has been linked.

Populate the activity types and countries table:

php artisan db:seed --class ActivityTypesTableSeeder
php artisan db:seed --class CountriesSeederTable

Final step, we have to set a cronjob that runs every minute with the following command:

php artisan schedule:run

Step 5. Accessing Monica Personal Relationship Management.

Monica will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/monica or http://server-ip/monica and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed Monica. Thanks for using this tutorial for installing Monica Personal Relationship Management on your Ubuntu 16.04. For additional help or useful information, we recommend you to check the official Monica web site.