How To Enable HTTP/2.0 Support on Apache

Enable HTTP/2.0 Support on Apache

HTTP/2 is the new updated HTTP protocol, and its supposed to be much more efficient than the now outdated http/1.1 version. Its goal is to reduce the latency as well as to make the web applications faster by allowing multiple concurrent requests between the web browser and the server across a single TCP connection. If you are looking to speed up the loading time of your website or blog then you should enable http/2.0 in your web server.

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 enable HTTP/2.0 support in Apache running Ubuntu 16.04 (Xenial Xerus) server.
Enable HTTP/2.0 Support on Apache running 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. Enable HTTP/2.0 Apache web server.

So make sure that your Apache version supporting HTTP/2 protocol. If you have not installed Apache or using older version upgrade it first. Use the following commands to add PPA for installing latest Apache2 version on your Ubuntu system:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get install apache2

Once installed, verify Apache version:

### apache2 -v
Server version: Apache/2.4.17 (Ubuntu)
Server built:   2017-03-05T00:00:00

Enable the HTTP/2.0 module by typing this commands:

sudo a2enmod http2

Restart Apache for the changes to take effect:

systemctl restart apache2

Now open your VirtualHost file ( e.g. most likely at this path /etc/apache2/sites-available/ ) and put this code in:

Protocols h2 http/1.1

Step 3. Verify HTTP/2.

Go to https://tools.keycdn.com/http2-test and test if http/2.0 is detected in your domain.

https://tools.keycdn.com/http2-test

Congratulation’s! You have successfully enable HTTP/2.0 apache web server. Thanks for using this tutorial for enable HTTP/2.0 support on Apache running Ubuntu 16.04 LTS (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official Apache web site.

How To Install Seafile on Ubuntu 16.04 LTS

Install Seafile on Ubuntu 16

Seafile is a open source cloud storage software. It offers file sharing and syncing for individual users and groups, it provides client side encryption and easy access from mobile devices. Also easily integrated with local services such as LDAP and WebDAV or can be deployed using advanced network services and databases like MySQL, SQLite, PostgreSQL, Memcached, Nginx or Apache Web Server.

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 Seafile open source secure cloud storage on a Ubuntu 16.04 (Xenial Xerus) server.
Install Seafile on Ubuntu 16.04 LTS Xenial Xerus

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 LEMP (Linux, Nginx, MariaDB, PHP) server.

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

apt-get install php7.0-curl php7.0-gd php7.0-mbstring php7.0-mysql libapache2-mod-php7.0 php7.0-mcrypt php7.0-zip

Installing Python modules:

apt-get install python2.7 libpython2.7 python-setuptools python-imaging python-ldap python-mysqldb python-memcache python-urllib3

Step 3. Configure the MariaDB database for Seafile.

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 Seafile. 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 Seafile installation:

MariaDB [(none)]> create database ccnet_db character set = 'utf8'; MariaDB [(none)]> create database seafile_db character set = 'utf8'; MariaDB [(none)]> create database seahub_db character set = 'utf8';
MariaDB [(none)]> create user seacloud@localhost identified by 'password';
MariaDB [(none)]> grant all privileges on ccnet_db.* to seacloud@localhost identified by 'password'; MariaDB [(none)]> grant all privileges on seafile_db.* to seacloud@localhost identified by 'password'; MariaDB [(none)]> grant all privileges on seahub_db.* to seacloud@localhost identified by 'password';
MariaDB [(none)]> flush privileges; MariaDB [(none)]> exit

Step 4. Installing Seafile on Server.

You need to download the last stable release of Seafile:

wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_6.0.6_x86-64.tar.gz

Extract the tarball into the current directory:

tar -xvzf seafile-server_6.0.6_x86-64.tar.gz
mv seafile-server_6.0.6 seafile-server

Install Seafile:

Run this script which will create the required databases and directories for the Seafile server and and answer all questions using the following configuration options, after the script verifies the existence of all Python required modules:

./setup-seafile-mysql.sh

After Seafile server successfully installs, it will generate some useful information such as what ports needs to be open on your Firewall to allow external connection and what scripts to handle in order to start the server.

Step 5. Starting the Seafile services.

Create startup script for the Seafile server like this:

nano /lib/systemd/system/seafile.service

Add the following lines:

[Unit]
Description=Seafile Server
After=network.target mariadb.service[Service]
Type=oneshot
ExecStart=/home/seafile/seafile-server/seafile.sh start
ExecStop=/home/seafile/seafile-server/seafile.sh stop
RemainAfterExit=yes
User=seafile
Group=seafile[Install]
WantedBy=multi-user.target

Save the file and create a new service file for seahub:

[Unit]
Description=Seafile Hub
After=network.target seafile.target[Service]
Type=oneshot
ExecStart=/home/seafile/seafile-server/seahub.sh start-fastcgi
ExecStop=/home/seafile/seafile-server/seahub.sh stop
RemainAfterExit=yes
User=seafile
Group=seafile[Install]
WantedBy=multi-user.target

Now try using the service and command to start a new Seafile server instance:

systemctl daemon-reload 
systemctl start seafile
systemctl start seahub

Step 6. Configuring Nginx web server for Seafile.

*Note: A static IP address 192.168.77.21 configure on your server.

First, create a new virtual host file with name seafile.conf:

nano /etc/nginx/sites-available/seafile.conf

Add the following lines:

server {
    listen 80;
    server_name 192.168.77.21;proxy_set_header X-Forwarded-For $remote_addr;# Reverse proxy for seafile
    location / {
        fastcgi_pass    127.0.0.1:8000;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param   PATH_INFO           $fastcgi_script_name;fastcgi_param    SERVER_PROTOCOL        $server_protocol;
        fastcgi_param   QUERY_STRING        $query_string;
        fastcgi_param   REQUEST_METHOD      $request_method;
        fastcgi_param   CONTENT_TYPE        $content_type;
        fastcgi_param   CONTENT_LENGTH      $content_length;
        fastcgi_param   SERVER_ADDR         $server_addr;
        fastcgi_param   SERVER_PORT         $server_port;
        fastcgi_param   SERVER_NAME         $server_name;
        fastcgi_param   REMOTE_ADDR         $remote_addr;access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
        fastcgi_read_timeout 36000;
    }# Reverse Proxy for seahub
    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
    }#CHANGE THIS PATH WITH YOUR OWN DIRECTORY
    location /media {
        root /home/seafile/seafile-server/seahub;
    }
}

Save the file and restart nginx:

systemctl restart nginx

Step 7. Accessing Seafile.

Seafile cloud storage will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com or http://192.168.77.21. Enter the admin email id and password to login which you have created at the time of installation. If you are using a firewall, please open port 8000 to enable access to the control panel.

seafile-web-interface-login

Congratulation’s! You have successfully installed Seafile. Thanks for using this tutorial for installing Seafile open source secure cloud storage on Ubuntu 16.04 LTS (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official Seafile web site.

How To Install LAMP Stack on Ubuntu 17.04

Install LAMP Stack on Ubuntu 17

LAMP represents a full featured stack containing the most popular web server known as Apache, the most popular database server MySQL and the most popular open-source web programming language known as PHP. All components are free and open-source software, and the combination is suitable for building dynamic web pages.

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. I will show you through the step by step installation LAMP (Linux Apache, MySQL and PHP) on Ubuntu 17.04 Zesty Zapus server.
Install LAMP Stack on Ubuntu 17.04

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

apt-get update
apt-get upgrade

Step 2. Installing Apache on Ubuntu 17.04.

We will be installing Apache with apt-get, which is the default package manager for ubuntu. Your also required to install libapache2-mod-php module to work PHP with Apache2:

apt-get install apache2 libapache2-mod-php

After installing apache services on your system, start all required services:

systemctl enable apache2
systemctl start apache2
systemctl status apache2

Check Apache version:

apache2 -v

You can verify that Apache is really running by opening your favorite web browser and entering the URL http://your-server’s-address, if it is installed, then you will see this:
apache2-ubuntu-default-page
Step 3. Installing MySQL on Ubuntu 17.04

Now that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information:

apt-get install mysql-server php7.1-mysql

Once complete, you can verify MySQL is installed by running the below command:

systemctl status mysql
systemctl enable mysql
systemctl start mysql

By default, MySQL is not hardened. You can secure MySQL 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 MySQL:

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

To log into MySQL, use the following command (note that it’s the same command you would use to log into a MySQL database):

mysql -u root -p

Step 4. Installing PHP 7 on Ubuntu 17.04

PHP 7.1 is now the default PHP package shipping in Ubuntu LTS 17.04 (Zesty Zapus), Now install PHP 7 with the following command:

sudo apt-get install -y php7.1 php7.1-cgi php7.1-cli php7.1-fpm php7.1-mysql php7.1-mcrypt php7.1-mbstring php7.1-common php7.1-curl php7.1-pgsq

If you like to search all the available PHP 7 modules you can use to command:

sudo apt-cache search php- | less

Your server should restart Apache automatically after the installation of both MySQL and PHP. If it doesn’t, execute this command:

sudo systemctl restart apache2
sudo systemctl restart mysql

To test PHP, create a test file named info.php with he content below. Save the file, then browse to it to see if PHP is working:

nano /var/www/html/info.php

In this file, paste the following code:

<?php phpinfo(); ?>

Try to access it at http://your_server_ip/info.php . If the PHP info page is rendered in your browser then everything looks good and you are ready to proceed further.
install-php7-ubuntu-17.04

Congratulation’s! You have successfully installed LAMP stack. Thanks for using this tutorial for installing LAMP (LinuxApache, MySQLand PHP) in Ubuntu 17.04 (Zesty Zapus) system. For additional help or useful information, we recommend you to check the official Apache, MySQL and PHP web site.

How To Install Gogs on Ubuntu 16.04 LTS

Install Gogs on Ubuntu 16

Gogs is a free and open source self-hosted Git service written in the Go programming language. It is very similar to GitLab and aims to be the easiest and most painless way to set up self-hosted Git service in your development environment.

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 Gogs on Ubuntu 16.04 Xenial Xerus server.
Install Gogs 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 and 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-curl php7.0-gd php7.0-mbstring php7.0-mysql libapache2-mod-php7.0 php7.0-mcrypt php7.0-zip

Step 3. Installing Gogs.

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

cd /opt && wget https://dl.gogs.io/0.11.4/linux_amd64.zip

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

unzip linux_amd64.zip
mv gogs/ /var/www/html/gogs

Next, change the directory to the gogs and run the following command to start gogs:

cd /var/www/html/gogs
./gogs web &

Step 4. Configuring MariaDB for Gogs.

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 Gogs. 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 Gogs installation:

MariaDB [(none)]> CREATE DATABASE gogs;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON gogs.* TO 'gogs'@'localhost' IDENTIFIED BY 'your_gogs_password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Step 5. Configuring Apache web server for Gogs.

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

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

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/gogs/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/gogs/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ProxyRequests Off
ProxyPass / http://192.168.77.20:3000/
ProxyPassReverse / http://192.168.77.20:3000/
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 Gogs.

Gogs will be available on HTTP port 80 and 3000 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.

Congratulations! You have successfully installed Gogs. Thanks for using this tutorial for installing Gogs in Ubuntu 16.04 Xenial Xerus systems. For additional help or useful information, we recommend you to check the official Gogs web site.

How To Install Zabbix on Ubuntu 16.04 LTS

Install Zabbix on Ubuntu 16

Zabbix is an open source monitoring tool that is ideal for monitoring your cloud servers. Zabbix is very flexible, information can be retrieved using HTTP/SNMP or by installing a Zabbix agent on the machines to monitor, and allows a lot of customization.

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 Zabbix in Ubuntu 16.04 LTS Xenial Xerus.
Install Zabbix on Ubuntu 16.04 LTS Xenial Xerus

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 and 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-readline php7.0-curl php7.0-gd php7.0-mbstring libapache2-mod-php7.0 php7.0-mcrypt php7.0-bz2 php7.0-zip

Step 3. Installing Zabbix on Ubuntu 16.04.

First thing to do is download and add the repository as shown below:

wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb

After adding zabbix apt repository in your system, Now update package lists and install Zabbix using commands:

apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php

Step 4. Zabbix Configuration.

sudo nano /etc/zabbix/zabbix_server.conf

Adjust the following values and make a note of the password you’ve chosen. You’ll need it later too.

DBName=zabbixdb
DBUser=zabbix
DBPassword=your_chosen_password_here

Step 5. Configure MariaDB Database for Zabbix.

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

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 Zabbix. 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 the Zabbix software:

create user 'zabbix'@'localhost' identified by 'your_chosen_password_here';
create database zabbixdb;
grant all privileges on zabbixdb.* to 'zabbix'@'localhost';
flush privileges;
exit;

After creating the zabbix database and user we need to import the zabbix initial database using the below commands:

cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -u root -p zabbixdb

Step 6. Configure Apache web server for Zabbix.

First, we’ll move the Zabbix apache file from the package directory:

sudo cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf-available/zabbix.conf
sudo a2enconf zabbix.conf
sudo a2enmod alias

We should adjust php timezone as per zabbix recommended settings:

###nano /etc/zabbix/apache.conf
    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value always_populate_raw_post_data -1
    php_value date.timezone Europe/Rome

Restart the Apache and zabbix service for the changes to take effect:

systemctl restart apache2
systemctl start zabbix-server

Step 7. Accessing Zabbix.

will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/zabbix or http://server-ip/zabbix 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.

zabbix-v3-install

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

How To Install Open Eshop on Ubuntu 16.04 LTS

Install Open Eshop on Ubuntu 16

Open eShop is an open source ecommerce software written in PHP which allows you to sell software, music, ebooks or anything else you may want.

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 Open eShop in Ubuntu 16.04 LTS Xenial Xerus.

Install Open Eshop 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. Installing LAMP (Linux, Apache, MariaDB and 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-readline php7.0-curl php7.0-gd php7.0-mbstring libapache2-mod-php7.0 php7.0-mcrypt php7.0-bz2 php7.0-zip

Step 3. Installing Open eShop Lite.

First, download the latest stable version of the Open Eshop installation file from their official website with the following command:

mkdir /var/www/html/openeshop
cd /var/www/html/openeshop
wget https://raw.githubusercontent.com/open-classifieds/open-eshop/master/install-eshop.php

Change the owner of the script with the following command:

chown -R www-data:www-data install-eshop.php

Step 4. Configure MariaDB Database for Open eShop.

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

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 Open eShop. 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 the Open eShop software:

CREATE DATABASE openeshop_db;
CREATE USER 'openeshop'@'localhost' IDENTIFIED BY 'usr_strong_pwd';
GRANT ALL PRIVILEGES ON openeshop_db.* TO 'openeshop'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5. Configuring Apache web server for Open eShop.

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

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

Add the following lines:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/openeshop/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/openeshop/>
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

Update the values for post_max_size, upload_max_filesize, and short_open_tag as follows:

post_max_size = 64M
upload_max_filesize = 64M
short_open_tag = On

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

systemctl restart apache2.service

Step 6. Accessing Open eShop.

Open eShop 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 Open eShop. Thanks for using this tutorial for installing Open eShop open source software for eCommerce platforms on your Ubuntu 16.04 LTS system. For additional help or useful information, we recommend you to check the official Open eShop web site.

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.