Install Piwigo on the One-Click LEMP Application

Introduction

Piwigo is a popular open-source photo gallery software. In this article, I will show you how to install Piwigo on an AKLWEB HOST Server based on the One-Click LEMP application.

Prerequisites

Step One: Create A Database

Display the MySQL root password on your terminal.

cat /root/.my.cnf

Use the root password to log into the MySQL console.

mysql -u root -p

Create and configure a database in MySQL with the following commands. Remember to replace the database name piwigo, the user name myusername, and the password mypassword with your ones.

create database piwigo;
create user 'myusername'@'localhost' identified by 'mypassword';
grant all privileges on piwigo.* to 'myusername'@'localhost' identified by 'mypassword' with grant option;
flush privileges;
exit;

Step Two: Download The Piwigo NetInstall Script

Piwigo can be installed with a single NetInstall script or a full archive package. As a matter of convenience, we will use the former.

First, you need to delete the default files that were created by AKLWEB HOST.

cd /usr/share/nginx/html/
rm -f background.jpg index.php logo.png

Visit the Piwigo official website from your browser, click the button Download NetInstall to download the script named piwigo-netinstall.php to your local machine. Then, upload it to the directory /usr/share/nginx/html/ on your AKLWEB HOST VPS with your SCP client of choice.

Step Three: Configure And Install Piwigo From Your Browser

Before the installation, you need to add write permissions to the directory /usr/share/nginx/html/, or you will encounter a permission error.

chmod -R a+w /usr/share/nginx/html/

Visit http://[SERVER_IP]/piwigo-netinstall.php in your browser. Substitute the [SERVER_IP] with the IP address of your VPS. Follow the on-screen instructions to configure Piwigo.

On the page Welcome to NetInstall, you can choose the language and the installation destination.

For this article, we will choose to install Piwigo in the root directory. Delete Piwigo from the textbox. Alternatively, you could specify another destination.

Click the button Retrieve and unzip Piwigo.

On the page of Congratulations!, click Install Piwigo now.

On the page of Configurations, you need to input parameters as specified below.

Basic Configuration

Pick a language as you wish.

Database Configuration

Host: localhost
User: myusername
Password: mypassword
Database name: piwigo
Database table prefix: piwigo_

Remember to replace the database user myusername, the database password mypassword, the database name piwigo, and the database table prefix piwigo_ with your own. Do not modify the Host field.

Administration Configuration

Specify the administrator’s username, password, and email address.

Click Start installation.

On the page of Congratulations!, click Visit the gallery.

You may see a warning message.

Warning: strftime(): It is not safe to rely on the system's timezone settings.

To fix the warning, you need to modify the php.ini file.

vi /etc/php.ini

Locate the following line.

;date.timezone =

Assuming that your VPS has been deployed in Los Angeles, California, you need to update the line as follows.

date.timezone = America/Los_Angeles

If your VPS will be deployed at another location, you can find the appropriate value from https://php.net/manual/en/timezones.php.

Save and quit vi.

:wq

To put these changes into effect, you need to restart the web server:

service nginx restart && service php-fpm restart

That’s it. You have installed Piwigo on your AKLWEB HOST VPS. Visit http://[SERVER_IP]/ to start using it.