{"id":8171,"date":"2018-12-12T17:00:32","date_gmt":"2018-12-12T14:00:32","guid":{"rendered":"https:\/\/www.howtoforge.com\/how-to-install-invoiceplane-on-centos-7\/"},"modified":"2018-12-12T17:00:32","modified_gmt":"2018-12-12T14:00:32","slug":"%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%86%d8%b5%d8%a8-invoiceplane-%d8%a8%d8%a7-nginx","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/%d8%a2%d9%85%d9%88%d8%b2%d8%b4-%d9%86%d8%b5%d8%a8-invoiceplane-%d8%a8%d8%a7-nginx\/","title":{"rendered":"\u0622\u0645\u0648\u0632\u0634 \u0646\u0635\u0628 InvoicePlane \u0628\u0627 Nginx"},"content":{"rendered":"<p dir=\"ltr\" style=\"text-align: left;\">InvoicePlane\u00a0is a free and open source invoicing application. Its source code can be found on this\u00a0Github. This\u00a0tutorial will show you how to install InvoicePlane on a fresh CentOS 7 system.<\/p>\n<h2 id=\"requirements\" dir=\"ltr\" style=\"text-align: left;\">Requirements<\/h2>\n<ul dir=\"ltr\" style=\"text-align: left;\">\n<li>WebServer (Apache, NGINX).\u00a0This tutorial will use Nginx.<\/li>\n<li>MySQL\u00a0version 5.5 or greater or the equivalent version of MariaDB.<\/li>\n<li>PHP version 7.0 or greater with the following PHP extensions installed and activated:<\/li>\n<li><code>php-gd<\/code><\/li>\n<li><code>php-hash<\/code><\/li>\n<li><code>php-json<\/code><\/li>\n<li><code>php-mbstring<\/code><\/li>\n<li><code>php-mcrypt<\/code><\/li>\n<li><code>php-mysqli<\/code><\/li>\n<li><code>php-openssl<\/code><\/li>\n<li><code>php-recode<\/code><\/li>\n<li><code>php-xmlrpc<\/code><\/li>\n<li><code>php-zlib<\/code><\/li>\n<\/ul>\n<ul dir=\"ltr\" style=\"text-align: left;\">\n<li>A server running\u00a0CentOS 7.<\/li>\n<li>A non-root user with sudo privileges.<\/li>\n<\/ul>\n<h2 id=\"initial-steps\" dir=\"ltr\" style=\"text-align: left;\">Initial steps<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">Check\u00a0your CentOS system version:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">cat \/etc\/centos-release\n# CentOS Linux release 7.6.1810 (Core)<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Set up the timezone:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">timedatectl list-timezones\nsudo timedatectl set-timezone 'Region\/City'<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Update your operating system\u2019s packages:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo yum update\u00a0-y<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Install\u00a0required packages:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo yum install -y vim wget curl git bash-completion unzip<\/code><\/pre>\n<h2 id=\"step-install-nodejs-and-npm\" dir=\"ltr\" style=\"text-align: left;\">Step 1 &#8211;\u00a0Install PHP and required PHP extensions<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">InovicePlane\u00a0web application requires PHP version\u00a07.0.0\u00a0or greater. Default CentOS repositories contain older version of PHP, and thus we will need to set up a third-party repository to install a newer PHP version. We will use Webtatic repository.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Setup the Webtatic YUM repo:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo rpm -Uvh https:\/\/mirror.webtatic.com\/yum\/el7\/webtatic-release.rpm<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Install PHP, as well as the necessary PHP extensions:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo yum install -y php72w php72w-cli php72w-fpm php72w-common php72w-gd php72w-json php72w-mbstring php72w-mcrypt php72w-mysql php72w-xmlrpc php72w-recode<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Check the PHP version:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">php --version<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">#\u00a0PHP 7.2.12 (cli) (built: Nov\u00a011 2018 14:54:16) ( NTS )<br \/>\n# Copyright (c) 1997-2018 The PHP Group<br \/>\n#\u00a0Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\"><\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Start and enable PHP-FPM service:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo systemctl start php-fpm.service\nsudo systemctl enable php-fpm.service<\/code><\/pre>\n<h2 id=\"step-install-mariadb\" dir=\"ltr\" style=\"text-align: left;\">Step 2 &#8211; Install MariaDB<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">Install MariaDB database server:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo yum install -y mariadb-server<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Check the MariaDB version:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">mysql --version\n# mysql Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Start and enable MariaDB service:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo systemctl start mariadb.service\nsudo systemctl enable mariadb.service<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Run\u00a0<code>mysql_secure installation<\/code>\u00a0script to improve MariaDB security and set the password for MariaDB\u00a0<code>root<\/code>\u00a0user:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo mysql_secure_installation<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Answer all the questions as shown below:<\/p>\n<pre dir=\"ltr\"><code spellcheck=\"false\"><code spellcheck=\"false\">Enter current password for root (enter for none):\nSet root password? [Y\/n]: Y\nRemove anonymous users? [Y\/n]: Y\nDisallow root login remotely? [Y\/n]: Y\nRemove test database and access to it? [Y\/n]: Y\nReload privilege tables now? [Y\/n]: Y<\/code><\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Log into MariaDB shell as the user root:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">mysql -u root -p\n# Enter password<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Create a MariaDB database and user that you will use for your installation of InvoicePlane, and remember the credentials:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">CREATE DATABASE dbname;\nGRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';\nFLUSH PRIVILEGES;<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Exit from MariaDB shell:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">quit<\/code><\/pre>\n<h2 id=\"step-install-nginx\" dir=\"ltr\" style=\"text-align: left;\">Step 3 &#8211; Install NGINX<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">Install Nginx web server:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo yum install -y nginx<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Check the NGINX version:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">nginx -v\n# nginx version: nginx\/1.12.2<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Start and enable Nginx service:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo systemctl start nginx.service\nsudo systemctl enable nginx.service<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Configure\u00a0NGINX for InvoicePlane. Run\u00a0<code>sudo vim \/etc\/nginx\/conf.d\/invoiceplane.conf<\/code>\u00a0and populate the file with the following configuration:<\/p>\n<pre dir=\"ltr\"><code>server {\n listen 80;\n listen [::]:80;\n\n server_name example.com;\n\n root \/var\/www\/invoiceplane;\n\n index index.php index.html;\n\n location \/ {\n try_files $uri $uri\/ \/index.php?$query_string;\n }\n\n location ~ \\.php$ {\n fastcgi_index index.php;\n try_files $uri =404;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_pass 127.0.0.1:9000;\n }\n}\n<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Test the NGINX configuration:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo nginx -t<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Reload NGINX:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo systemctl reload nginx.service<\/code><\/pre>\n<h2 id=\"step-install-invoiceplane\" dir=\"ltr\" style=\"text-align: left;\">Step 4 &#8211; Install InvoicePlane<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">Download the latest stable version of InvoicePlane and extract the archive:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo mkdir -p \/var\/www\ncd \/var\/www\nsudo curl -O -J -L https:\/\/invoiceplane.com\/download\/v1.5.9\nsudo unzip v1.5.9.zip\nsudo rm v1.5.9.zip\nsudo mv ip invoiceplane<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Navigate to\u00a0<code>\/var\/www\/invoiceplane<\/code>\u00a0folder:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">cd \/var\/www\/invoiceplane<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Make a copy of the\u00a0<code>ipconfig.php.example<\/code>\u00a0file and rename the copy to\u00a0<code>ipconfig.php:<\/code><\/p>\n<pre class=\"command\" dir=\"ltr\">sudo cp ipconfig.php.example ipconfig.php<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Open the\u00a0<code>ipconfig.php<\/code>\u00a0file and add your URL in it:<\/p>\n<pre class=\"command\" dir=\"ltr\">sudo vim ipconfig.php\n# Something like this\nIP_URL=http:\/\/example.com<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Change ownership of the\u00a0<code>\/var\/www\/invoiceplane<\/code>\u00a0directory to\u00a0<code>nginx:<\/code><\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo chown -R nginx:nginx \/var\/www\/invoiceplane<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Run\u00a0<code>sudo vim \/etc\/php-fpm.d\/www.conf<\/code>\u00a0and set the user and group to\u00a0<code>nginx<\/code>. Initially, they will be set to\u00a0<code>apache:<\/code><\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo vim \/etc\/php-fpm.d\/www.conf\n# user = nginx\n# group = nginx<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Run\u00a0<code>sudo vim \/etc\/php.ini<\/code>\u00a0and set\u00a0<code>date.timezone:<\/code><\/p>\n<pre class=\"command\" dir=\"ltr\">date.timezone = Region\/City<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Restart the PHP-FPM service:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">sudo systemctl restart php-fpm.service<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Run the InvoicePlane installer from your web browser and follow the instructions:<\/p>\n<pre class=\"command\" dir=\"ltr\"><code spellcheck=\"false\">http:\/\/example.com\/index.php\/setup<\/code><\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Once the installation has finished, you may log into InvoicePlane using the email address and password you have chosen during the installation.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">If you want to secure your installation, you may disable the setup. To do so, replace the line\u00a0<code>DISABLE_SETUP=false<\/code>\u00a0with\u00a0<code>DISABLE_SETUP=true<\/code>\u00a0in your\u00a0<code>ipconfig.php<\/code>\u00a0file.<\/p>\n<h2 id=\"step-complete-the-cachet-setup\" dir=\"ltr\" style=\"text-align: left;\">Step 5 &#8211; Complete the\u00a0InvoicePlane setup<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">InvoicePlane is now installed and configured, it&#8217;s time to access their web installation wizard.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Open your web browser and type the URL <strong>http:\/\/example.com<\/strong>. You will be redirected to the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.39_.03_\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.39_.03_.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7.png\" alt=\"InvoicePlane web installer\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Now, click on the\u00a0<strong>Setup<\/strong>\u00a0button. You should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.39_.18_\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.39_.18_.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-8.png\" alt=\"Choose language\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Next, choose the language and click on the\u00a0<strong>Continue<\/strong>\u00a0button. You should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.39_.27_\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.39_.27_.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-9.png\" alt=\"Prerequisite check successful\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Next, click on the\u00a0<strong>Continue<\/strong>\u00a0button. You should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.39_.37_\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.39_.37_.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-10.png\" alt=\"Database setup\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Here, provide your database details and click on the\u00a0<strong>Try Again<\/strong>\u00a0button. You should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.39_.53_\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.39_.53_.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-11.png\" alt=\"Database has been set up.\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Now, click on the\u00a0<strong>Continue<\/strong>\u00a0button. You should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.53_.52_\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.53_.52_.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-12.png\" alt=\"Create user\" width=\"550\" height=\"333\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Now, click on the\u00a0<strong>Continue<\/strong>\u00a0button. You should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.40_.25_1\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.40_.25_1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-13.png\" alt=\"Installation complete\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Now, provide all the required details, then click on the\u00a0<strong>Continue<\/strong>\u00a0button. Once the installation is completed, you should see the following page:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-Screenshot_2018-12-09_at_21.40_.36_2\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_install_invoiceplane_on_centos_7\/big\/Screenshot_2018-12-09_at_21.40_.36_2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/how-to-install-invoiceplane-with-nginx-on-centos-7-14.png\" alt=\"Log into InvoicePlane\" width=\"550\" height=\"316\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Now, click on the\u00a0<strong>Login<\/strong>\u00a0button to access InvoicePlane administration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>InvoicePlane\u00a0is a free and open source invoicing application. Its source code can be found on this\u00a0Github. This\u00a0tutorial will show you how to install InvoicePlane on a fresh CentOS 7 system. Requirements WebServer (Apache, NGINX).\u00a0This tutorial will use Nginx. MySQL\u00a0version 5.5 or greater or the equivalent version of MariaDB. PHP version 7.0 or greater with the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-8171","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/8171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=8171"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/8171\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=8171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=8171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=8171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}