By Arslan Ud Din Shafiq, Alibaba Cloud Community Blog author.
InvoicePlane is a free-to-use web-based application for managing invoices, quotes, payments, and clients. It is a complete solution for managing end-to-end billing cycles. It also supports several payment gateways and allows an organization's clients to pay via Paypal, Stripe, Bitcoin and many more.
In this tutorial, we will install and set up InvoicePlane on Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.
Firstly, use the following command to update your Ubuntu system before proceeding with the installation of any type of package. For executing this command, remember to login from non-root user with Sudo privileges.
sudo apt update && sudo apt upgrade
InvoicePlane requires the installation of PHP 7.0.0 or a later version of PHP. For this tutorial, we will install PHP 7.2 by executing the following steps:
Install python software properties and software properties common as these are necessary for the installation of PHP 7.2. To do so, execute the command below.
sudo apt-get install software-properties-common python-software-properties
You need to add a repository for the later versions of PHP by executing the commands below.
sudo add-apt-repository ppa:ondrej/php
Update the system to refresh the available repositories and make PHP 7.2 repository available for installation. Execute the following command for updating the Ubuntu system.
sudo apt update
Once PHP 7.2 repository loads successfully, install PHP 7.2 by using the following command.
sudo apt install -y php7.2
InvoicePlane requires Apache or Nginx server. In this tutorial, we will use the Apache server. To install the Apache server, execute the following command.
sudo apt install -y apache2
InvoicePlane requires the multiple PHP extensions, including php7.2-cli, php7.2-fpm, php7.2-gd, php7.2-common, php7.2-mbstring, php7.2-json, php7.2-mysql, and php7.2-xmlrpc. Execute the following command to install all the required extensions.
sudo apt-get install -y php7.2-cli php7.2-fpm php7.2-gd php7.2-common php7.2-json php7.2-mbstring php7.2-mysql php7.2-xmlrpc fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libwebp6 libxmlrpc-epi0 libxpm4
After successful installation, the domain or IP address can be accessed via a browser.
To check whether you have correctly installed PHP, you can execute the following command and verify the installed PHP version.
php --version
To install php-pear, execute the following command.
sudo apt-get install php-pear -y
Install Libgd-Tools by using the command below.
sudo apt-get install libgd-tools -y
InvoicePlane supports MySQL and for this tutorial, we will use the MariaDB server for MySQL. By default, the Ubuntu repository has an older version of the MariaDB server. We need to add MariaDB repository to the Ubuntu system for using the new version of MariaDB by following the steps listed below:
Verify the keys by executing the command shown below.
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Add the repository using the following command.
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.2/ubuntu xenial main'
Now update the system by using the command below.
sudo apt update
Now install MariaDB using the following command.
sudo apt install -y mariadb-server
Start and enable the MariaDB server to ensure that after reboot, the server starts automatically.
sudo systemctl start mariadb
sudo systemctl enable mariadb
Now run the following command to enhance security of MariaDB server and set password for the root user.
sudo mysql_secure_installation
Also, connect to the MySQL shell as the root user by executing the command below and enter your password.
sudo mysql -u root -p
Execute the following MySQL queries in your MariaDB server.
CREATE DATABASE plane CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'aareez'@'localhost' IDENTIFIED BY '654321Ab';
GRANT ALL PRIVILEGES ON plane.* TO 'aareez'@'localhost';
FLUSH PRIVILEGES;
EXIT;
You also need to install Unzip which will later be used to unzip the compressed zip folder. Execute the following command to install unzip.
sudo apt-get install unzip -y
To install InvoicePlane, you will need to follow the steps.
Navigate to /var/www/html using the command.
cd /var/www/html
Next, you need to change the ownership of /var/www/html directory as shown below.
sudo chown -R aareez:aareez /var/www/html
Remove index.html file using the command below.
rm index.html
Also, download the latest stable release of InvoicePlane using the command below.
sudo curl -O -J -L https://invoiceplane.com/download/v1.5.9
Unzip the downloaded zipped folder as shown below.
unzip v1.5.9.zip
Execute the following command to remove v1.5.9.zip.
rm -r v1.5.9.zip
Now move the downloaded files to /var/www/html by executing command below.
mv /var/www/html/ip/* /var/www/html
Next, remove InvoicePlane-master by running the following command.
rm -r ip
Create a copy of ipconfig.php.example and name it as ipconfig.php
cp ipconfig.php.example ipconfig.php
Open ipconfig.php file using Nano editor and add IP_URL in the same.
nano ipconfig.php
Lastly, ,provide ownership of /var/www/html to www-data so that Apache server can access the required files.
sudo chown -R www-data:www-data /var/www/html
Let's create a virtual host configuration file for InvoicePlane. Execute the following command to open a file in the Nano text editor.
sudo nano /etc/apache2/sites-available/invoice.conf
Copy and paste the following code and save the file.
<VirtualHost *:80>
ServerAdmin admin@softpedia.xyz
DocumentRoot /var/www/html/
ServerName softpedia.xyz
ServerAlias www.softpedia.xyz
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/InvoicePlane_error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/InvoicePlane_access.log combined
</VirtualHost>
Next, execute the command below to disable the default site.
sudo a2dissite 000-default.conf
You also need to enable the newly created virtual host. To do so, execute the command below.
sudo a2ensite invoice
Another thing that is required here is to enable rewrite mod by either editing configuration file in Apache2 directory or by simply executing the command below.
sudo a2enmod rewrite
Next, you need to enable SSL engine. You can do so by either editing configuration file in Apache2 directory or executing the following command.
sudo a2enmod ssl
Restart the Apache server to apply the changes and load the settings by executing the command below
sudo service apache2 restart
If you have activated firewalls, you need to define a rule in Alibaba Cloud security group for your cloud server to add an exception for port 80/TCP and 443/TCP. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide: https://www.alibabacloud.com/help/doc-detail/25471.htm
You need to use Certbot for installing the SSL certificate using Let's Encrypt. To do so, execute the following steps.
Update the package using the following command.
sudo apt-get update
Install software-properties-common by executing the command below.
sudo apt-get install software-properties-common
Add the Certbot repository by using the following command.
sudo add-apt-repository ppa:certbot/certbot
Use the command below to update the package for loading the added Certbot repository.
sudo apt-get update
Ensure to stop Apache before issuance of the SSL certificate as shown below.
sudo systemctl stop apache2
Now, install python-certbot-apache using the command below.
sudo apt-get install python-certbot-apache
Execute the following command to get Let's Encrypt SSL issued.
sudo certbot --apache -d softpedia.xyz
Select Option 2 to redirect the link to https and update virtual host settings for SSL.
After a successful issuance of the SSL certificate, you will be navigated to the following screen.
Now, run the following command to restart the Apache server.
sudo systemctl start apache2
Finally, you can access InvoicePlane by hitting your URL.
Once you access InvoicePlane via browser using domain or IP address, you will be taken to the welcome page. Click the Setup button to start configurations for InvoicePlane.
Once, you select a language and click the Continue button. You will be redirected to the following screen.
The above page will show the required configurations for starting the installation of InvoicePlane. If everything is OK, click Continue. You will be redirected to database configuration page, where you need to add the database configurations details and click Try Again button.
You will be redirected to the following screen after successful connection.
Click Continue to navigate to the following screen.
Click Continue, you will be redirected to following.
Once you click Continue, you will be redirected to the following page.
Now, fill the form for administrator and click Continue to navigate to the page shown below.
Open ipconfig.php file using Nano editor and change DISABLE_SETUP value to true and save the file.
sudo nano ipconfig.php
Finally, click on the Login to navigate to the following login page.
Here, enter your account credentials to log in to your admin account. Once you log in, you will be redirected to the account dashboard as shown below.
There you go! You have successfully installed and configured InvoicePlane on your Alibaba Cloud ECS.
A Brief Guide to Install and Setup Mailtrain Newsletter on Alibaba Cloud
2,599 posts | 764 followers
FollowAlibaba Clouder - December 3, 2019
Alibaba Cloud MVP - January 3, 2020
Alibaba Cloud MVP - February 28, 2020
Alibaba Clouder - December 3, 2019
Arman Ali - June 30, 2021
Alibaba Clouder - March 23, 2018
2,599 posts | 764 followers
FollowElastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn MoreLearn More
Learn More
More Posts by Alibaba Clouder