Install Simple Invoices on CentOS 7

simpleSimple Invoices is a web based open source invoicing system. It is very simple but functional application, supporting various billing formats. It is great for small organizations and home users. In this blog post we will guide you through the installation for Simple Invoices on a CentOS 7 VPS with Apache, PHP and MariaDB.

To start the Simple Invoices installation, login to your server as user root

ssh root@IP

and as usual, run the following command to make sure that all packages on your CentOS 7 virtual server are up to date:

yum -y update

Now, we will install Apache web server:

yum install httpd

Once it is installed, start Apache and set it to start on system start up:

systemctl start httpd
systemctl enable httpd

Install PHP among with few PHP modules required by the application:

yum -y install php php-pdo php-common php-mysql

Run the following commands to install MariaDB

yum install mariadb mariadb-server

Start the MariaDB server and enable it to start on system start up:

systemctl start mariadb
systemctl enable mariadb

Run the mysql_secure_installation script to secure the database server and set your MariaDB root password.

Simple Invoices requires a blank database. Log in to the MariaDB server as user ‘root’ and create new database and user for the application.

mysql -u root -p

CREATE DATABASE simpleinvoices;
CREATE USER 'siuser'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON `simpleinvoices`.* TO 'siuser'@'localhost';
FLUSH PRIVILEGES;
exit

Don’t forget to replace ‘PASSWORD’ with an actual strong password.

Download the latest stable release of Simple Invoices from their official website:

wget https://bitbucket.org/simpleinvoices/simpleinvoices/downloads/simpleinvoices.2011.1.zip

Install the ‘unzip’ package necessary for unpacking the Simple Invoices zip archive and unpack the downloaded archive to the document root directory of your server:

yum -y install unzip
unzip simpleinvoices.2011.1.zip -d /var/www/html/

Edit the Simple Invoices configuration file and enter the details of the database we created:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
vim /var/www/html/simpleinvoices/config/config.ini

database.params.host                            = localhost
database.params.username                        = siuser
database.params.password                        = PASSWORD
database.params.dbname                          = simpleinvoices

Change the ownership of the ‘/var/www/html/simpleinvoices/’ directory:

chown -R apache:apache /var/www/html/simpleinvoices/

Create Apache virtual host for your website. Create ‘/etc/httpd/conf.d/vhosts.conf’ file with the following content:

vim /etc/httpd/conf.d/vhosts.conf

IncludeOptional vhosts.d/*.conf

and create the virtual host:

mkdir /etc/httpd/vhosts.d/
vim /etc/httpd/vhosts.d/yourdomain.com.conf

<VirtualHost YOUR_SERVER_IP:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/simpleinvoices/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined

<Directory "/var/www/html/simpleinvoices/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

Restart the Apache web server for the changes to take effect:

systemctl restart httpd

Now, open your favorite web browser and point it to http://yourdomain.com to run the web installer. You will have to choose your database type and enter the necessary information to complete the installation.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Simple Invoices for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment