Breaking News
Home / How To / How to install InvoicePlane with Nginx on FreeBSD 12

How to install InvoicePlane with Nginx on FreeBSD 12



InvoicePlane is a free and open source invoice. This tutorial shows you how to install InvoicePlane on a FreeBSD 12. system.

Requirements

  • WebServer (Apache, NGINX). This tutorial will use Nginx.
  • MySQL version 5.5 or later or equivalent version of MariaDB.
  • PHP version 7.0, 7.1 or 7.2 with the following PHP extensions installed and enabled:
  • php-gd
  • php-hash
  • php-json
  • php-mbstring
  • php-mcrypt [19659005] php-mysqli
  • php-openssl
  • php-recode
  • php-xmlrpc [19659005] php-zlib
  • A server running FreeBSD 12.
  • A non-root drive users with sudo privileges.

Initial steps

Check your FreeBSD version:

  uname -ro 
# FreeBSD 1
2.1-RELEASE

Set time zone:

  tzsetup 

Update your operating system packages (software) ). This is an important first step as it ensures that you have the latest updates and security fixes for your operating system's standard software packages:

  freebsd-update fetch install 
pkg update && pkg upgrade -y

Install some important packages necessary for basic administration of FreeBSD 12.0 operating system:

  pkg install -y sudo vim unzip wget bash 

Step 1 – Install PHP and necessary PHP extensions

InvoicePlane web application requires PHP version 7.0 or greater.

Install PHP, as well as necessary PHP extensions:

  sudo pkg install -y php72 php72-ctype php72-curl php72-dom php72-hash php72-iconv php72-gd php72-json php72 -mbstring -openssl php72 session php72-simplexml php72-xml php72-zip php72-zlib php72-pdo php72-pdo_mysql php72-mysqli php72-filter-php72-pecl 19659021]  Check PHP version:  [19659020]   php  # PHP 7.2.7 (cli) (built: Jul 25, 2019 1:28:53 PM) (NTS) 
# Copyright (c) 1997-2018 PHP Group
# Zend Engine v3.3.7 , Copyright (c) 1998-2018 Zend Technologies
# with Zend OPcache v7.3.7, Copyright (c) 1999-2018, by Zend Technologies

Enable and start PHP-FPM service:

   sudo sysrc php_fpm_enable = yes 
sudo service php-fpm start

Step 2 – Install MySQL

Install MySQL database server: [19659020] sudo pkg install -y mysql server

K unroll MySQL version:

  mysql --version 
# mysql Ver 14.14 Distrib 5.7.26, for FreeBSD12.0 (amd64) with EditLine wrapper

Activate and start MySQL service:

   sudo sysrc mysql_enable = "yes" 
sudo service mysql server startup

Run mysql_secure installation ] script to improve MySQL security a nd set the password for MySQL root user:

  sudo mysql_secure_installation 

Answer all questions:

  Do you want to set VALIDATE PASSWORD plugin?  N 
New password: your_secure_password
Enter new password: your_secure_password
Remove anonymous users? [Y/n] Y
Remove root login remotely? [Y/n] Y
Remove the test database and access it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Connect to MySQL shell as root user:

   sudo mysql -u root -p 
# Enter password

Create an empty MySQL database and users for Matomo and remember references:

  CREATE DATABASE dbname; 
CREATE USER & # 39; username & # 39; @ & # 39; localhost & # 39; IDENTIFIED BY & # 39; password & # 39 ;;
SUPPORT EVERYONE on dbname. * TO & # 39; username & # 39; IDENTIFIED OF & # 39; password & # 39 ;;
FLUSH PRIVILEGES;

Exit from MySQL:

  exit 

Replace dbname username and password with your own names.

Step 3 – Install acme.shbclient and get Let & # 39; s Encrypt Certificate (optional)

Securing your website with HTTPS is not necessary, but it is a good practice to secure your site traffic. To get TLS certificates from Let & # 39; s Encrypt, we will use the Acme.sh client. Acme.sh is a pure UNIX shell software to obtain TLS certificates from Let & # 39; s Encrypt with zero dependencies. & Nbsp

Download and install Acme.sh:vud19659020??sudo pkg install -y acme.sh

Check Acme.sh version:

  acme.sh - version 
# v2.8.2

Get RSA and ECC / ECDSA certificate for your domain / host name:

  # RSA 
sudo acme.sh - question - standalone - home / etc / letsencrypt -d example.com - key length 2048
# ECDSA
sudo acme.sh - question - standalone - home / etc / letsencrypt -d example.com - key length ec-256

After running the above commands, certificate and keys will be in:

  • For RSA : /etc/letsencrypt/example.com directory.
  • For ECC / ECDSA : /etc/letsencrypt/example.com_ecc dire ctory.

Step 3 – Install NGINX

Install NGINX web server:

  sudo pkg install -y nginx 

Check NGINX version:

  nginx -v 
# nginx version: nginx / 1.14.2 Chapter19659021achteStart and enable NGINX service:

  sudo sysrc nginx_enable = yes 
sudo service nginx start

Configure Nginx for InvoicePlane by running:

  sudo vim / usr / local / etc / nginx / invoice 

And fill in the file with the following configuration:

  server {
listen 80;
listen [::]: 80;

server name example.com;

root / usr / local / www / invoice plans;

index index.php index.html;

location / {
try_files $ uri $ uri //index.php?$query_string;
}

location ~ *  .php $ {
fastcgi_pass 127.0.0.1:9000; ebrit19459015 Dollars include fastcgi_params;
fastcgi_index index.php5;
fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; }

Test NGINX Configuration:

  sudo nginx -t 

Reload NGINX:

  sudo systemctl reload nginx.service 

Step 4 - Install InvoicePlane

Download the latest stable version of InvoicePlane and extract the archive:

  sudo mkdir -p / usr / local / www 
cd / usr / local / www
sudo curl -O-JL https://invoiceplane.com/download/v1. 5.9
sudo unzip v1.5.9.zip
sudo rm v1.5.9.zip
sudo etc. ip invoice plan

Navigate to / var / www / invoiceplane catalog :

  cd / usr / local / www / invoiceplane 

Create a copy of the ipconfig.php.example file and rename the copy to ipconfig.php: [19659019] sudo cp ipconfig.php.example ipconfig.php

Open the ipconfig.php file and add your URL to it:

  sudo vim ipconfig.php 
# Something like this
IP_URL = http: //example.com

Change ownership of / usr / local / www / invoiceplane directory to www:

  sudo chown-R www: www / usr / local / www / invoiceplane 

Run sudo vim /etc/php.inivud19459016] and set date.timezone:

  date.timezone = Region / City 

Restart PHP FPM service:

  sudo service php-fpm reboot 

Run the InvoicePlane installer from your browser and follow the instructions:

  http://example.com/index.php/setup 

When installation is complete you can log in to InvoicePlane with the e-mail address and password you chose during the installation.

If you want to secure your installation, you can deactivate the installation. To do so, replace the DISABLE_SETUP = false line with DISABLE_SETUP = true in your ipconfig.php file.

Step 5 - Complete the completion InvoicePlane setting

InvoicePlane is now installed and configured, it is time to access its web installation wizard.

Open your browser and enter the URL http://example.com . You will be redirected to the following page:

  InvoicePlane Web Installer

Now click on the Setup button. You should see the following page:

  Select language

Then select the language and click the Continue button. You should see the following page:

  Check the system requirements

Then click the Continue button. You should see the following page:

  Database Information

Enter your database information and click the Try Again button. You should see the following page:

  The database connection succeeded

Now click on the Continue button. You should see the following page:

  Create user account

Now click on the Continue button. You should see the following page:

  Installation of invoice schedule complete

Now, enter all the necessary details and then click the Continue button. When the installation is complete, see the following page:

  Login to InvoicePlane

Now click on Log in to access the InvoicePlane administration.


Source link