This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Saturday, March 5, 2022

How to Install InvoicePlane

 

How to Install InvoicePlane with Apache and Free Let's Encrypt SSL Certificate on Debian 11

On this page

  1. Prerequisites
  2. Install Apache, PHP, and MariaDB
  3. Create a Database for InvoicePlane
  4. Install InvoicePlane
  5. Configure Apache for InvoicePlane
  6. Access InvoicePlane Web UI
  7. Secure InvoicePlane with Let's Encrypt SSL
  8. Conclusion

InvoicePlane is a free, open-source, and self-hosted application for managing your quotes, invoices, clients, and payments. It is used by many organizations and freelancers to manage their payments and invoices. It offers custom templates, themes, and other tools that help you to increase the functionality of InvoicePlane. It also supports multiple languages and multiple payment providers such as Paypal, Stripe or even Bitcoin via Coinbase.

In this tutorial, we will show you how to install InvoicePlane with Apache on Debian 11.

Prerequisites

  • A server running Debian 11.
  • A valid domain name pointed with your server IP.
  • A root password is configured on the server.

Install Apache, PHP, and MariaDB

First, you will need to install the Apache web server, MariaDB database server, PHP and other required PHP extensions to your server. You can install all of them by running the following command:

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql wget unzip php-cli php-zip php-curl -y

Once all the packages are installed, edit the PHP configuration file and change the default settings:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

memory_limit = 256M
upload_max_filesize = 128M
max_execution_time = 360
date.timezone = UTC

Save and close the file then restart the Apache service to apply the changes:

systemctl restart apache2

Create a Database for InvoicePlane

Next, you will need to secure the MariaDB installation and create a database and user for InvoicePlane.

First, secure the MariaDB installation using the following command:

mysql_secure_installation

Answer all the questions as shown below:

Set root password? [Y/n] Y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Next, connect to the MariaDB shell with the following command:

mysql -u root -p

Once you are connected, create a database and user for InvoicePlane with the following command:

MariaDB [(none)]> CREATE DATABASE invplanedb;
MariaDB [(none)]> CREATE USER 'invplane'@'localhost' IDENTIFIED BY 'password';

Next, grant all the privileges to the InvoicePlane with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON invplanedb.* TO 'invplane'@'localhost';

Next, run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MariaDB:

MariaDB [(none)]> FLUSH PRIVILEGES;

Finally, exit from the MariaDB shell:

MariaDB [(none)]> EXIT

Install InvoicePlane

First, download the latest version of the InvoicePlane with the following command:

wget -c -O v1.5.11.zip https://invoiceplane.com/download/v1.5.11

Once the download is completed, create a directory for InvoicePlane and extract the downloaded file inside the InvoicePlane directory:

mkdir /var/www/html/invoiceplane
unzip v1.5.11.zip -d /var/www/html/invoiceplane

Next, navigate to the InvoicePlane directory and rename the configuration file and .htaccess file:

cd /var/www/html/invoiceplane
cp ipconfig.php.example ipconfig.php
cp htaccess .htaccess

Next, edit the ipconfig.php file with the following command:

nano ipconfig.php

Define your website URL and database settings as shown below:

IP_URL=http://invoice.example.com
DB_HOSTNAME=localhost
DB_USERNAME=invplane
DB_PASSWORD=password
DB_DATABASE=invplanedb
DB_PORT=3306

Next, set proper permission and ownership to the InvoicePlane directory:

chown -R www-data:www-data /var/www/html/invoiceplane/
chmod -R 755 /var/www/html/invoiceplane/

Configure Apache for InvoicePlane

Next, you will need to create an Apache virtual host configuration file for InvoicePlane. You can create it with the following command:

nano /etc/apache2/sites-available/invoiceplane.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/invoiceplane
     ServerName invoice.example.com


     <Directory /var/www/html/invoiceplane/>
          Options +FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Save and close the file then activate the Apache virtual host and rewrite module with the following command:

a2ensite invoiceplane.conf
a2enmod rewrite

Next, restart the Apache service to apply the configuration changes:

systemctl restart apache2

To verify the Apache status, run the following command:

systemctl status apache2

You will get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-01-21 08:42:34 UTC; 5s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 15965 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 15970 (apache2)
      Tasks: 6 (limit: 2341)
     Memory: 15.1M
        CPU: 82ms
     CGroup: /system.slice/apache2.service
             ??15970 /usr/sbin/apache2 -k start
             ??15971 /usr/sbin/apache2 -k start
             ??15972 /usr/sbin/apache2 -k start
             ??15973 /usr/sbin/apache2 -k start
             ??15974 /usr/sbin/apache2 -k start
             ??15975 /usr/sbin/apache2 -k start

Jan 21 08:42:34 debian11 systemd[1]: Starting The Apache HTTP Server...

Access InvoicePlane Web UI

Now, open your web browser and access the InvoicePlane web interface using the URL http://invoice.example.com. You should see the following page:


Click on the Setup button. You should see the Language selection page:



Select your language and click on the Continue button. You should see the prerequisites page:


Click on the Continue button. You should see the following page:



Click on the Continue button. You should see the following page:




Provide your admin user account information, address and click on the Continue button. Once the InvoicePlane has been installed, you should see the following page:


Click on the Login button. You should see the following page:


Provide your admin username, password then click on the Login button. You should see the InvoicePlane dashboard on the following page:


Secure InvoicePlane with Let's Encrypt SSL

It is always a good idea to secure your website with Let's Encrypt SSL. You will need to install the Certbot client to install and manage the SSL. You can install it with the following command:

apt-get install python3-certbot-apache -y

Once the Certbot is installed, run the following command to secure your website with Let's Encrypt SSL:

certbot --apache -d invoice.example.com

You will be asked to provide your email and accept the term of service as shown below:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): hitjethva1981@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for invoice.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/invoice-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/invoice-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/invoice-le-ssl.conf

Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Type 2 and hit Enter to install the Let's Encrypt SSL for your website:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/invoice.conf to ssl vhost in /etc/apache2/sites-available/invoice-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://invoice.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=invoice.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/invoice.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/invoice.example.com/privkey.pem
   Your cert will expire on 2022-04-23. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Conclusion

Congratulations! you have successfully installed InvoicePlane with Apache and Let's Encrypt SSL on Debian 11. You can now implement InvoicePlane in your company and start managing your payments and invoices from the web browser.

Share:

How to Install Grafana 8 Monitoring Tool on Debian 11

 

How to Install Grafana 8 Monitoring Tool on Debian 11

On this page

  1. Prerequisites
  2. Getting Started
  3. Install Grafana 8
  4. Install Nginx as a Reverse Proxy for Grafana
  5. Access Grafana Dashboard
  6. Secure Grafana with Let's Encrypt
  7. Conclusion

Grafana is a free and open-source data visualizing tool that is used to monitor metrics from other hosts. It is written in Typescript and Go and allows you to create and edit both log and data graphs and create metrics. It can generate graphs and dashboards from a time-series database including Graphite, InfluxDB, or OpenTSDB and allows you to share them with other users.

Features

  • Dashboard templating
  • Provisioning Annotations
  • Kiosk mode and playlists
  • Custom plugins
  • Alerting and alert hooks

In this post, we will show you how to install Grafana 8 on Debian 11.

Prerequisites

  • A server running Debian 11.
  • A valid domain name pointed with your server IP.
  • A root password is configured on the server.

Getting Started

Before starting, it is recommended to update your system to the updated version. You can update all the packages using the following command:

apt-get update -y

After updating all the packages, install other required dependencies using the following command:

apt-get install gnupg2 curl wget git software-properties-common -y

Once all the packages are installed, you can proceed to the next step.

Install Grafana 8

By default, Grafana is not included in the Debian 11 default repository. So you will need to add the Grafana repository to the APT. You can add it using the following command:

curl https://packages.grafana.com/gpg.key | apt-key add -
add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

Once the repository is added, update the repository cache and install the Grafana using the following command:

apt-get update -y
apt-get install grafana -y

Once the Grafana is installed, start and enable the Grafana service using the following command:

systemctl start grafana-server
systemctl enable grafana-server

You can also check the status of the Grafana service with the following command:

systemctl status grafana-server

You will get the following output:

? grafana-server.service - Grafana instance
     Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-02-04 04:08:25 UTC; 5s ago
       Docs: http://docs.grafana.org
   Main PID: 8602 (grafana-server)
      Tasks: 9 (limit: 2341)
     Memory: 29.6M
        CPU: 1.299s
     CGroup: /system.slice/grafana-server.service
             ??8602 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/grafana-server.pid --packaging=deb cfg:>

Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="migrations completed" logger=migrator performed=381 s>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Created default admin" logger=sqlstore user=admin
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Created default organization" logger=sqlstore
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Initialising plugins" logger=plugin.manager
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Plugin registered" logger=plugin.manager pluginId=inp>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Live Push Gateway initialization" logger=live.push_ht>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="Writing PID file" logger=server path=/run/grafana/gra>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3>
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="warming cache for startup" logger=ngalert
Feb 04 04:08:27 debian11 grafana-server[8602]: t=2022-02-04T04:08:27+0000 lvl=info msg="starting MultiOrg Alertmanager" logger=ngalert.multio>

By default, Grafana listens on port 3000. You can check it with the following command:

ss -antpl | grep 3000

You will get the following output:

LISTEN 0      4096               *:3000            *:*    users:(("grafana-server",pid=8602,fd=8))               

Install Nginx as a Reverse Proxy for Grafana

Next, you will need to install and configure the Nginx as a reverse proxy for Grafana. First, install the Nginx using the following command:

apt-get install nginx -y

Once the Nginx is installed, create an Nginx virtual host configuration file with the following command:

nano /etc/nginx/conf.d/grafana.conf

Add the following lines:

server {
        server_name grafana.example.com;
        listen 80;
        access_log /var/log/nginx/grafana.log;

        
        location / {
                proxy_pass http://localhost:3000;
                proxy_set_header X-Forwarded-Host $host:$server_port;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }}

Save and close the file when you are finished. Then, verify the Nginx for any syntax error with the following command:

nginx -t

If everything is fine, you will get the following output:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Next, restart the Nginx to apply the configuration changes.

systemctl restart nginx

You can also check the Nginx status with the following command:

systemctl status nginx

You will get the following output:

? nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-02-04 04:09:20 UTC; 4s ago
       Docs: man:nginx(8)
    Process: 8631 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 8632 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 8633 (nginx)
      Tasks: 2 (limit: 2341)
     Memory: 2.5M
        CPU: 35ms
     CGroup: /system.slice/nginx.service
             ??8633 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             ??8634 nginx: worker process

Feb 04 04:09:20 debian11 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 04 04:09:20 debian11 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 04 04:09:20 debian11 systemd[1]: Started A high performance web server and a reverse proxy server.

At this point, Nginx is installed and configured as a reverse proxy for Grafana. You can now proceed to the next step.

Access Grafana Dashboard

Now, open your web browser and access the Grafana web interface using the URL http://grafana.example.com. You will be redirected to the Grafana login page:



Provide your admin username, password, and click on the Log in button. You should see the Grafana password reset screen:



Set your new password and click on the Submit button. You should see the Grafana dashboard on the following screen:



Secure Grafana with Let's Encrypt

Next, you will need to install the Certbot client package to install and manage the Let's Encrypt SSL.

First, install the Certbot with the following command:

apt-get install certbot python3-certbot-nginx -y

Once the installation is finished, run the following command to install the Let's Encrypt SSL on your website:

certbot --nginx -d grafana.example.com

You will be asked to provide a valid email address and accept the term of service as shown below:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): hitjethva@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for grafana.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/grafana.conf

Next, choose whether or not to redirect HTTP traffic to HTTPS as shown below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Type 2 and hit Enter to finish the installation. You should see the following output:

Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/grafana.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://grafana.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=grafana.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/grafana.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/grafana.example.com/privkey.pem
   Your cert will expire on 2022-05-07. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

Conclusion

Congratulations! you have successfully installed Grafana 8 with Nginx and Let's Encrypt SSL on Debian 11. You can now add your remote hosts and start monitoring them from the Grafana dashboard. Feel free to ask me if you have any questions.

Share:

Search This Blog

Blog Archive

Nerdy Tech Tips. Powered by Blogger.

How to Install InvoicePlane

  How to Install InvoicePlane with Apache and Free Let's Encrypt SSL Certificate on Debian 11 On this page Prerequisites Install Apache,...

Blogger templates