Category Archives: Debian

Odoo 17 on Debian

How to Install Odoo 17 on Debian 12

Odoo is an open-source suite of business management software applications that encompasses a wide range of business needs, including customer relationship management (CRM), sales, project management, inventory management, manufacturing, financial management, and more.

It is widely used by businesses of various sizes and across different industries to streamline their operations, improve productivity, and manage their business processes more efficiently. Its flexibility, scalability, and cost-effectiveness make it a popular choice for organizations seeking comprehensive business management solutions.

In this tutorial, we will show you how to install Odoo 17 on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Then install all the required packages for the Odoo 17 setup on the Debian 12 OS.

# apt install python3 python3-dev python3-pip python3-venv python3-setuptools build-essential libzip-dev libxslt1-dev libldap2-dev python3-wheel libsasl2-dev node-less libjpeg-dev xfonts-75dpi xfonts-base libpq-dev libffi-dev fontconfig git wget nodejs npm

Step 2: Install PostgreSQL

Odoo uses PostgreSQL as a database backend, so you will need to install PostgreSQL on your server.

You can run the following command to install the PostgreSQL server:

# apt-get install postgresql-15

After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:

# systemctl start postgresql
# systemctl enable postgresql

Verify that is active and running on your server:

# systemctl status postgresql
Output
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 18666 (code=exited, status=0/SUCCESS)
        CPU: 2ms

Now create an Odoo user in PostgreSQL:

# su - postgres -c "createuser -s odoo" 

This will add a new role odoo in the PostgreSQL server.

Step 3: Install Node.js

To install Node.js and npm on your Debian OS use the following command:

# apt install nodejs npm

Also, install the following module to enable RTL support:

# npm install -g rtlcss

Step 4: Installation of wkhtmltox

To generate PDF reports successfully, wkhtmltopdf is necessary. PDF reports are a crucial component of any organization.

First install the xfonts dependency before installing wkhtmltopdf:

# apt-get install xfonts-75dpi xfonts-base

Now download and install wkhtmltopdf using the following commands:

# wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
# dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb

Verify if the wkhtmltopdf installation is successful by checking the version:

# wkhtmltopdf --version
wkhtmltopdf 0.12.6.1 (with patched qt)

Step 5: Create an Odoo User

Create a new system user for managing the Odoo processes on the Odoo server.

# adduser --system --group --home=/opt/odoo --shell=/bin/bash odoo

Step 6: Install Odoo

Switch to the user that you have created before to avoid encountering issues related to access rights.

# su - odoo

Now, download the Odoo 17 source code from the git repository and install it:

# git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo

Next run the following command to generate a new Python virtual environment.

# python3 -m venv odoo-env

Activate the virtual environment with the following command:

# source odoo-env/bin/activate

Then install the required Python packages:

(odoo-env) $ pip3 install wheel
(odoo-env) $ pip3 install -r odoo/requirements.txt

After completing the process of installing all requirements to deactivate the virtual environment run the following command:

(odoo-env) $ deactivate

Execute the following command to create a directory for custom addons:

# mkdir /opt/odoo/custom-addons

Next exit from the Odoo user:

# exit

Create an Odoo log directory and provide it the required write permissions.

# mkdir /var/log/odoo
# chown odoo:odoo /var/log/odoo

Step 7: Create Odoo Configuration File

Create the Odoo configuration file.

# nano /etc/odoo.conf

Then paste the following configuration into it.

[options]
admin_passwd = Strong_admin_Password
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo/odoo-server.log
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
xmlrpc_port = 8069

Remember to update the value of the “Strong_admin_Password” key above with a more secure password.

Step 8: Create a Systemd Service File

Create a systemd service file to manage the Odoo service:

# nano /etc/systemd/system/odoo.service

Paste the following content into the odoo.service file:

[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Reload system daemon and start the service:

# systemctl daemon-reload
# systemctl start odoo
# systemctl enable odoo

To confirm everything is working normally, check the status of service:

# systemctl status odoo

Output:

● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
     Active: active (running)
   Main PID: 2270 (python3)
      Tasks: 4 (limit: 2273)
     Memory: 110.0M
        CPU: 1.622s
     CGroup: /system.slice/odoo.service
             └─2270 /opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Step 9: Access Odoo server

Open your web browser and type http://your-IP-address:8069 and you will see the following screen:

Fill the required information and then click the “Create Database” button to complete the installation.

After successfully creating the Odoo database, you will be redirected to the login page.

Enter your login credentials and you will be redirected to apps page:

Comments and Conclusion

That’s it. You have successfully installed Odoo 17 on Debian 12. For additional information, you can check the official Odoo 17 documentation.

If you have any questions please leave a comment below.

How to Install Backdrop CMS on Debian 12

Backdrop CMS is an open-source content management system (CMS) that is designed to be a user-friendly and accessible alternative to other popular CMS platforms, especially Drupal.

It is built on the same PHP technology stack as Drupal, but it is intended to be more straightforward and more suitable for smaller organizations, non-profits, and individuals who want a powerful CMS without the complexity often associated with Drupal.

Overall, Backdrop CMS aims to strike a balance between being easy to use and having the capabilities necessary to build and manage websites effectively, making it a suitable choice for those looking for a middle ground between simplicity and customization.

To get started with installing Backdrop on Debian 12, follow the steps below:

Step 1: Update Operating System

Update and upgrade your system packages to the latest version with the following command:

# apt update && apt upgrade

Step 2: Install Nginx

You can install Nginx web server via apt package manager by executing the following command:

# apt install nginx

Verify the status of the Nginx service using systemctl status command:

# systemctl status nginx

Output:

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:nginx(8)
   Main PID: 717 (nginx)
      Tasks: 2 (limit: 2273)
     Memory: 5.0M
        CPU: 71ms
     CGroup: /system.slice/nginx.service
             ├─717 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             └─718 "nginx: worker process"

Step 3: Install PHP

To install PHP and the necessary extensions, run the following command:

# apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml

Once the installation is complete verify if PHP is installed:

php -v
Output:
PHP 8.2.12 (cli) (built: Oct 27 2023 13:00:10) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies

Step 4: Install MariaDB and create a database

To install MariaDB run the following command:

# apt install mariadb-server mariadb-client

Verify the status of the MariaDB service using systemctl status command:

# systemctl status mariadb

Output:

● mariadb.service - MariaDB 10.11.4 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 772 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 9 (limit: 2273)
     Memory: 249.5M
        CPU: 2.711s
     CGroup: /system.slice/mariadb.service
             └─772 /usr/sbin/mariadbd

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script.

# mysql_secure_installation

Configure it like this:

- 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

Now run the command below to log in to the MariaDB shell.

# mysql -u root -p

Once you are logged in to your database server you need to create a database for the Backdrop installation:

MariaDB [(none)]> CREATE DATABASE backdrop;
MariaDB [(none)]> CREATE USER 'backdrop'@'localhost' IDENTIFIED BY 'Str0ngPass';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON backdrop. * TO 'backdrop'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 5: Download Backdrop

The latest version of Backdrop is available to download from GitHub. You can download it with the following command:

# wget https://github.com/backdrop/backdrop/releases/download/1.26.1/backdrop.zip

Then extract file into the folder /var/www/ with the following command:

# unzip backdrop.zip -d /var/www/

Then enable permission for the Nginx webserver user to access the files:

# chown -R www-data:www-data /var/www/backdrop/

Step 6: Configure Nginx for Backdrop

Create a new Nginx configuration file with the following command:

# nano /etc/nginx/conf.d/backdrop.conf

Paste the content as shown below:

server {
listen 80;

server_name your-domain.com;
root /var/www/backdrop;
index index.php index.html index.htm;

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

location = /favicon.ico {
    log_not_found off;
    access_log off;
   }

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires max;
    log_not_found off;
   }

location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
   }

location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
   }
}

Remember to replace your-domain.com with the domain name of your server.

Save and exit the configuration file.

To implement the changes, restart Nginx webserver:

# systemctl restart nginx

Step 7: Access Backdrop Web Interface

To complete the setup go to your browser and visit http://your-domain.com/. Choose language and click on the SAVE AND CONTINUE button.

Provide your database details and click on the SAVE AND CONTINUE button.

Provide your admin username, password, email then click on the SAVE AND CONTINUE button.

You will get the Backdrop dashboard.

Comments and Conclusion

That’s it. You have successfully installed Backdrop CMS on Debian 12.

For additional help or useful information, we recommend you to check the official Backdrop documentation.

If you have any questions please leave a comment below.

How to Install SuiteCRM on Debian 12

SuiteCRM is a free and open-source Customer Relationship Management (CRM) platform that is designed to help businesses to manage their customer relationships, sales, marketing, and customer support activities.

It is a popular choice for organizations looking for a cost-effective CRM solution with extensive customization options.

In this tutorial, we will show you how to install SuiteCRM on Debian 12.

Step 1: Update Operating System

The first step is to ensure that your system is up-to-date. You can do this by running the following command:

# apt update && apt upgrade

Step 2: Install Apache Web Server

To install Apache, run the following command:

# apt install apache2

You can start the Apache service and configure it to run on startup by entering the following commands:

# systemctl start apache2
# systemctl enable apache2

Verify the status of the Apache service using systemctl status command:

# systemctl status apache2

Output:


● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running)
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 2024 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 2028 (apache2)
      Tasks: 7 (limit: 2273)
     Memory: 19.2M
        CPU: 180ms
     CGroup: /system.slice/apache2.service
             ├─2028 /usr/sbin/apache2 -k start
             ├─2029 /usr/sbin/apache2 -k start
             ├─2030 /usr/sbin/apache2 -k start

Step 3: Install PHP and PHP extensions for SuiteCRM

By default, Debian12 comes with PHP version 8.2. To install PHP and the necessary extensions, run the following command:

# apt install php php-cli libapache2-mod-php php-json php-common php-mysql php-zip php-gd php-imap php-mbstring php-curl php-xml php-ldap php-pear

Once the installation is complete verify if PHP is installed:

php -v
Output:
PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

Then edit the php.ini file:

# nano /etc/php/8.2/apache2/php.ini

Change the following settings:

memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 32M

Restart the Apache service to apply the changes:

# systemctl restart apache2

Step 4: Install MariaDB and create a database

You can install the MariaDB server with the following command:

# apt install mariadb-server mariadb-client

Start the database server daemon, and also enable it to start automatically at the next boot with the following commands:

# systemctl start mariadb
# systemctl enable mariadb

Verify the status of the MariaDB service using systemctl status command:

# systemctl status mariadb

Output:

● mariadb.service - MariaDB 10.11.3 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 774 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 9 (limit: 2273)
     Memory: 245.4M
        CPU: 5.791s
     CGroup: /system.slice/mariadb.service
             └─774 /usr/sbin/mariadbd

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script.

# mysql_secure_installation

Configure it like this:

- 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

Now run the command below to log in to the MariaDB shell.

# mysql -u root -p

Once you are logged in to your database server you need to create a database for the SuiteCRM installation:

MariaDB [(none)]> CREATE DATABASE suitecrm;
MariaDB [(none)]> CREATE USER 'suitecrm'@'localhost' IDENTIFIED BY 'Str0ng-Passw0rd';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON suitecrm.* TO 'suitecrm'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 5: Download SuiteCRM

Download the latest stable version of SuiteCRM from the SuiteCRM website using the following command:

# wget https://suitecrm.com/download/141/suite714/562969/suitecrm-7-14-0.zip

Unzip the downloaded release file with the following command:

# unzip suitecrm-7-14-0.zip

Rename it to make it simpler:

# mv /var/www/SuiteCRM-7.14.0/ /var/www/suitecrm

Enable permission for the Apache webserver user to access the files:

# chown -R www-data:www-data /var/www/suitecrm/

Step 6: Create Virtualhost for SuiteCRM

Then, create an virtual host configuration file to host SuiteCRM:

# nano /etc/apache2/sites-available/suitecrm.conf

Paste the content as shown below:

<VirtualHost *:80>
    ServerAdmin admin@your-domain.com
    DocumentRoot /var/www/suitecrm
    ServerName suitecrm.your-domain.com

    <Directory /var/www/suitecrm/>
	Options Indexes FollowSymLinks
	AllowOverride All
	Require all granted
    </Directory>

    ErrorLog /var/log/apache2/your-domain.com-error_log
    CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

Remember to replace suitecrm.your-domain.com with the domain name of your server.

Save and exit the configuration file.

Then enable the "rewrite" module in Apache:

# /usr/sbin/a2enmod rewrite

To enable this site run the command:

To enable this site run the command:

# /usr/sbin/a2ensite suitecrm.conf

To implement the changes, restart Apache webserver:

# systemctl restart apache2

Step 7: Access SuiteCRM Web Interface

Go to your browser and visit http://suitecrm.your-domain.com. You should see the following page:

The first page displays the license agreement. Scroll down Accept the License agreement and click Next.

If everything is okay, click the Next button.

Provide your database name, database username, password, admin username and password. Then, click on the Next button.

You are presented with the details of SuiteCRM configuration completion. Click the Next button and you should see the login page:

Provide your admin credential and click on the LOG IN button, you should see the SuiteCRM dashboard in the following page:

Step 8: Set up Cron Jobs

SuiteCRM needs cron jobs to function properly. Edit the www-data user’s crontab file.

# sudo crontab -e -u www-data

Add the following line at the end of the file.

*    *    *    *    *     cd /var/www/suitecrm; php -f cron.php > /dev/null 2>&1

Save and close the file.

Comments and Conclusion

That’s it. You have successfully installed SuiteCRM on Debian 12.

For additional help or useful information, we recommend you to check the official SuiteCRM documentation.

If you have any questions please leave a comment below.

How to Install NextCloud on Debian 12

Nextcloud is a versatile and community-driven project, making it a popular choice for individuals, businesses, and organizations looking for a secure and self-hosted cloud storage and collaboration solution.

It is similar in functionality to popular cloud storage services like Dropbox, Google Drive, and Microsoft OneDrive but gives users greater control over their data and privacy because it can be deployed on their own servers or a cloud infrastructure of their choice.

In this tutorial, we will show you how to install Nextcloud on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Step 2: Install Nginx webserver

You can install Nginx via apt package manager by executing the following command.

# apt install nginx

You can start the Nginx service and configure it to run on startup by entering the following commands:

# systemctl start nginx
# systemctl enable nginx

Verify the status of the Nginx service using systemctl status command:

# systemctl status nginx

Output:

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:nginx(8)
    Process: 1280 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 1281 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 1304 (nginx)
      Tasks: 2 (limit: 2273)
     Memory: 1.7M
        CPU: 23ms
     CGroup: /system.slice/nginx.service
             ├─1304 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             └─1307 "nginx: worker process"

Step 3: Install PHP and PHP extensions for Nextcloud

To install PHP and the necessary extensions, run the following command:

# apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-intl php-curl php-xml php-mbstring php-bcmath php-gmp

Once the installation is complete verify if PHP is installed:

# php -v
Output:
PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

After installing all the packages, edit the php.ini file:

# nano /etc/php/8.2/fpm/php.ini

Change the following settings per your requirements:

max_execution_time = 300
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M

To implement the changes, restart the php-fpm service:

# systemctl restart php8.2-fpm

Step 4: Install MariaDB database server

To install the MariaDB database server, run the following command:

# apt install mariadb-server mariadb-client

Verify the status of the MariaDB service using systemctl status command:

# systemctl status mariadb

Output:

● mariadb.service - MariaDB 10.11.3 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 14433 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 11 (limit: 2273)
     Memory: 163.8M
        CPU: 513ms
     CGroup: /system.slice/mariadb.service
             └─14433 /usr/sbin/mariadbd

Once the installation is complete, run the following command to secure your MariaDB server:

# mysql_secure_installation

Configure it like this:

- 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

Restart the database server for the changes to take effect.

# systemctl restart mariadb

Step 5: Create a New Database for Nextcloud

Once you have installed MariaDB, you’ll need to create a new database and user for Nextcloud to use.

To do this, log in to your MariaDB server using the following command:

# mysql -u root -p

You will be prompted to enter your root password. Once you have entered your password, you will be taken to the MariaDB prompt.

Run the following commands to create a new database and user:

MariaDB [(none)]> CREATE DATABASE nextcloud;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'Password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Note: Make sure to replace 'Password' with a strong password of your choice.

Step 6: Download and Install Nextcloud

You can download the latest version of Nextcloud from the Nextcloud Official site.

Use the following command to download the latest version of Nextcloud:

# wget  https://download.nextcloud.com/server/releases/latest.zip

Extract file into the folder /var/www/ with the following command:

# unzip latest.zip -d /var/www/

Change ownership of the /var/www/nextcloud directory to www-data.

# chown -R www-data:www-data /var/www/nextcloud

Step 7: Configure Nginx for Nextcloud

Run the commands below to create a new VirtualHost file called nextcloud in the /etc/nginx/conf.d/ directory.

# nano /etc/nginx/conf.d/nextcloud.conf

Paste the content as shown below:

server {
  listen 80;
  server_name your-domain.com www.your-domain.com;
  root /var/www/nextcloud;
  index index.php index.html;
  charset utf-8;
  location / {
    try_files $uri $uri/ /index.php?$args;
  }
  location ~ .php$ {
    fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
}

Remember to replace your-domain.com with the domain name of your server.

Save and exit the configuration file.

To implement the changes, restart Nginx webserver:

# systemctl restart nginx

Step 8: Install free Let’s Encrypt SSL certificate

First we need to install the Certbot client which is used to create Let’s Encrypt certificates:

# apt install certbot python3-certbot-nginx

To get the SSL certificate using the Certbot, type the command given below:

# certbot --nginx -d your-domain.com -d www.your-domain.com

If the SSL certificate is successfully obtained, certbot displays a message to show the configuration was successful:

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/your-domain.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/your-domain.com/privkey.pem
   Your cert will expire on 2023-12-03. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. 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

Now, you have successfully installed SSL on your website.

Step 9: Access Nextcloud Web Interface

Open your web browser and type the URL https://your-domain.com. You should see the Nextcloud installation page.

Click the Install button, you will see the Web interface of NextCloud.

Comments and Conclusion

That’s it. You have successfully installed NextCloud on Debian 12 OS.

For additional help or useful information, we recommend you to check  the official Nextcloud documentation.

If you have any questions please leave a comment below.

How to Install AWStats with Apache on Debian 12

AWStats (Advanced Web Statistics) is an open-source web analytics tool that analyzes and generates comprehensive reports about web server log files. It provides detailed information about various aspects of web traffic and visitor behavior on a website.

It’s important to note that AWStats relies on server log files, so it may not provide real-time data and requires proper configuration to work effectively.

In this tutorial, we will show you how to install AWStats on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to the latest version with the following command:

# apt update && apt upgrade

Step 2: Install Apache webserver

You can install it via apt package manager by executing the following command.

# apt install apache2

Verify the status of the Apache service using systemctl status command:

# systemctl status apache2

Output:

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running)
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 928 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 933 (apache2)
      Tasks: 56 (limit: 2273)
     Memory: 11.2M
        CPU: 1.891s
     CGroup: /system.slice/apache2.service
             ├─933 /usr/sbin/apache2 -k start
             ├─934 /usr/sbin/apache2 -k start
             ├─935 /usr/sbin/apache2 -k start
             └─936 /usr/sbin/apache2 -k start

Step 3: Install AWStats

To install AWStats, you need to run the following command:

# apt install awstats

This command will start the installation process. It will resolve dependencies, run a transaction check, and install the necessary packages.

To get GeoIP information install the following Perl packages:

# apt install libgeo-ip-perl libgeo-ipfree-perl

Step 4: Configure AWStats

Once the installation routine is completed, edit the file awstats.conf as follows:

LogFile="/var/log/apache2/access.log"
LogFormat=1
SiteDomain="your-domain.com"
HostAliases=”www.your-domain.com your-domain.com”
DNSLookup=0
AllowFullYearView=3
LoadPlugin="tooltips"

Step 5: Configure Apache for AWStats

Open the Apache configuration file /etc/apache2/conf-available/awstats.conf :

# nano /etc/apache2/conf-available/awstats.conf

Paste the content as shown below:

Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Save and exit the configuration file.

To enable this conf run the command:

# ln -s /etc/apache2/conf-available/awstats.conf /etc/apache2/conf-enabled/awstats.conf

Then enable the "cgi" module in Apache:

# /usr/sbin/a2enmod cgi

To implement the changes, restart Apache webserver:

# systemctl restart apache2

To implement the changes, restart Apache webserver:

# systemctl restart apache2

You can see how the installation is progressing by pointing your web browser to:

# http://your-domain.com/cgi-bin/awstats.pl

The top line displays the time when statistics were updated. It probably reads ‘Never updated’. It is all right, you just have to manually run the first update.

# /usr/lib/cgi-bin/awstats.pl -config=your-domain.com -update

After it is done, if it is successful, with no errors, you should get some output like:

Create/Update database for config "/etc/awstats/awstats.conf" by AWStats version 7.8 (build 20200416)
From data in log file "/var/log/apache2/access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 4258
 Found 0 dropped records,
 Found 0 comments,
 Found 0 blank records,
 Found 0 corrupted records,
 Found 0 old records,
 Found 4258 new qualified records.

Step 6: Secure Your AWStats via .htaccess

A basic, simple way of restricting access is to set up a http password. Open your apache2 configuration file

# nano /etc/apache2/sites-available/your-domain.com.conf

Paste the content as shown below:

<Directory /usr/lib/cgi-bin/>
    Options +ExecCGI
    AddHandler cgi-script .cgi
    AuthType Basic
    AuthName 'Password Protected Area'
    AuthUserFile '/usr/lib/cgi-bin/.htpasswd'
    Require valid-user
</Directory>

If you don’t  have a password that can be used for this purpose, the command htpasswd can do it for you.

# htpasswd -cb /usr/lib/cgi-bin/.htpasswd admin Str0ngPassw0rd

Comments and Conclusion

Congratulations! You have successfully installed AWStats with Apache on your Debian 12 OS.

For additional help or useful information, we recommend you to check  the official AWStats documentation.

How to Install Strapi with Nginx on Debian 12

Strapi is a most advanced open source content management system (CMS) designed to help developers to build powerful API.

Strapi follows a “headless” architecture, which means it separates the content management backend from the frontend presentation, giving developers the freedom to use various technologies and frameworks on the frontend.

In this tutorial, we will show you how to install Strapi on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Step 2: Install Nginx webserver

You can install Nginx via apt package manager by executing the following command.

# apt install nginx

You can start the Nginx service and configure it to run on startup by entering the following commands:

# systemctl start nginx
# systemctl enable nginx

Verify the status of the Nginx service using systemctl status command:

# systemctl status nginx

Output:

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:nginx(8)
    Process: 627 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 646 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 655 (nginx)
      Tasks: 2 (limit: 2273)
     Memory: 3.8M
        CPU: 27ms
     CGroup: /system.slice/nginx.service
             ├─655 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             └─656 "nginx: worker process"

Step 3: Install Node.js

Strapi is based on Node.js, for that reason, you need to have Node.js installed on your server.

To install Node.js and npm on your Debian OS use the following command:

# apt install nodejs npm

You can verify the Node.js version with the following command:

# node --version

You should see the following output:

v18.13.0

Also, verify the npm version with the following command:

# npm --version

You should get the following output:

9.2.0

Step 4: Install PostgreSQL

Strapi uses PostgreSQL as a database backend, so you will need to install PostgreSQL on your server.

You can run the following command to install the PostgreSQL server:

# apt-get install postgresql-15

After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:

# systemctl start postgresql
# systemctl enable postgresql

Verify that is active and running on your server:

# systemctl status postgresql
Output
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 13153 (code=exited, status=0/SUCCESS)
        CPU: 1ms

Next, connect to the PostgreSQL shell:

# su postgres
# psql

Then, we create the Strapi database:

postgres=# CREATE DATABASE strapidb; 
postgres=# CREATE USER strapi WITH PASSWORD 'Your-Strong-Password'; 
postgres=# GRANT ALL PRIVILEGES ON DATABASE strapidb to strapi; 
postgres=# \q

Return to your root user account.

# exit

Step 5: Create a Strapi Application

Once PostgreSQL and Node.js have been installed, we can proceed to install Strapi.

You can use the npx command line utility to easily create a Strapi app.

# cd /opt
# npx create-strapi-app@latest strapi --no-run

You will see the following output.

Need to install the following packages:
  create-strapi-app@4.12.1
Ok to proceed? (y) y

Proceed with the creation by pressing y.

In the interactive shell, select custom installation then your database client, database name and user name as provisioned.

? Choose your installation type Custom (manual settings)
? Choose your preferred language JavaScript
? Choose your default database client postgres
? Database name: strapidb
? Host: 127.0.0.1
? Port: 5432
? Username: strapi
? Password: ********************
? Enable SSL connection: No

Next, navigate to the strapi directory and build the application with the following command.

# cd strapi
# npm run build

Output:

> strapi@0.1.0 build
> strapi build

Building your admin UI with development configuration...

✔ Webpack
  Compiled successfully in 1.12m

Admin UI built successfully

Then run Strapi in development mode.

# npm run develop

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


Press the CTRL+C to stop the application.

Step 6: Run Strapi with PM2

In this step we will describe you to how to run Strapi app with PM2 command. PM2 is a Production Process Manager for Node.js applications.

First, install PM2 application by running the following command:

# npm install pm2@latest -g

Now create a pm2 ecosystem file which is where you can setup some environment variables for each pm2 app you want to install and run.

# nano /root/ecosystem.config.js

Paste the following content in the file.

module.exports = {
  apps: [
    {
      name: 'strapi',
      cwd: '/opt/strapi',
      script: 'npm',
      args: 'start',
      env: {
        NODE_ENV: 'production',
        DATABASE_HOST: 'localhost',
        DATABASE_PORT: '5432',
        DATABASE_NAME: 'strapidb',
        DATABASE_USERNAME: 'strapi',
        DATABASE_PASSWORD: 'Your-Strong-Password'
      },
    },
  ]
};

Note: /opt/strapi is the path to your project, you are required to replace this with your own path before you proceed.

Once modified, save the file then start the app in the background with the command:

# pm2 start /root/ecosystem.config.js

You can see that the status of the app is set to online.

# pm2 list

To allow the app to start automatically on boot, use the command:

# pm2 startup -u root

Save the process:

# pm2 save

Your Strapi service is now running in the background in production mode.

Step 7: Configure Nginx for Strapi

Create a new Nginx virtual host configuration file.

# nano /etc/nginx/conf.d/strapi.conf

Add the following configurations:

upstream strapi {
server 127.0.0.1:1337;
}

server {

listen 80;
server_name your-domain.com www.your-domain.com;

location / {
        proxy_pass http://strapi;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass_request_headers on;
      }
}

Save and close the file, then edit the Nginx main configuration file.

# nano /etc/nginx/nginx.conf

Add the following line after the line http{: but before the line include /etc/nginx/conf.d/*.conf;.

server_names_hash_bucket_size 64;

Save the file, then verify the Nginx configuration.

# /usr/sbin/nginx -t

You should see the following output:

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

Restart the Nginx service to implement the changes.

# systemctl restart nginx

Step 8: Access Strapi Web Interface

Now, open your web browser and access the Strapi web UI using the URL http://your-domain.com/admin. You should see the Strapi default page:

Then click on the Let’s start button. You should see the Strapi dashboard:

Comments and Conclusion

Congratulations. You have learned how to install Strapi on Debian 12 OS. You can now create your own application easily using Strapi.

For additional help or useful information, we recommend you to check  the official Strapi documentation.

How to Install GlassFish on Debian 12

Glassfish is a free, open-source Java application server that simplifies the process of deploying Java applications to a scalable platform. Originally developed by Sun Microsystems, GlassFish is now maintained by Oracle and is released under both the Common Development and Distribution License as well as the GPL.

In this tutorial, we will show you the complete steps to install GlassFish on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Step 2: Install Java (OpenJDK) on Debian 12

Java packages are available on Debian 12 repositories and you can install it with the following command:

# apt install default-jdk

Check Java version after installation:

# java -version
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb12u1, mixed mode, sharing)

Step 3: Download GlassFish

Check the official GlassFish Download page to locate the latest version of the software.

The latest version at the moment is 7.0.6. You can download it with the following command:

# wget https://download.eclipse.org/ee4j/glassfish/glassfish-7.0.6.zip

Once that downloads, unpack it into /opt with:

# unzip glassfish-7.0.6.zip -d /opt

Step 4: Create a systemd file for GlassFish

You need to create a systemd file so you can control the GlassFish service. Create the file with the following command:

# nano /usr/lib/systemd/system/glassfish.service

In that file, paste the following content:

[Unit]
Description = GlassFish Server v7.0.6
After = syslog.target network.target

[Service]
User = root
ExecStart = /usr/bin/java -jar /opt/glassfish7/glassfish/lib/client/appserver-cli.jar start-domain
ExecStop = /usr/bin/java -jar /opt/glassfish7/glassfish/lib/client/appserver-cli.jar stop-domain
ExecReload = /usr/bin/java -jar /opt/glassfish7/glassfish/lib/client/appserver-cli.jar restart-domain
Type = forking

[Install]
WantedBy = multi-user.target

Reload system daemon and start the service:

# systemctl daemon-reload
# systemctl start glassfish
# systemctl enable glassfish

To confirm everything is working normally, check the status of service:

# systemctl status glassfish

Output:

● glassfish.service - GlassFish Server v7.0.6
     Loaded: loaded (/lib/systemd/system/glassfish.service; enabled; preset: enabled)
     Active: active (running)
    Process: 1355 ExecStart=/usr/bin/java -jar /opt/glassfish7/glassfish/lib/client/appserver-cli.jar start-domain (code=exited, status=0/SUCCESS)
   Main PID: 1370 (java)
      Tasks: 89 (limit: 2273)
     Memory: 314.9M
        CPU: 22.599s
     CGroup: /system.slice/glassfish.service

Step 5: Access GlassFish console on web browser

To test your installation, open your web browser and type https://your-IP-address:8080. You will see the default GlassFish page.

Step 6: Configure GlassFish

With GlassFish installed, you now must configure it with an admin password. The default password is blank, so you’ll want to create one with the command:

# /opt/glassfish7/bin/asadmin --port 4848 change-admin-password

When you run this command, you will be prompted to supply the admin password and details as shown below.

Enter admin user name [default: admin]> admin
Enter the admin password> )> Just press the Enter key
Enter the new admin password> 
Enter the new admin password again>

Once that’s taken care of, to access the administration panel remotely, run the following command.

# /opt/glassfish7/bin/asadmin --port 4848 enable-secure-admin
Enter admin user name> admin
Enter admin password for user " admin" >  
You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.

After setting the administrative panel, restart the domain.

# /opt/glassfish7/bin/asadmin --port 4848 restart-domain

You can now access the GlassFish admin panel at http://your-IP-address:4848.

Provide your admin username and password and click on Login. You should see the GlassFish dashboard:

Comments and Conclusion

That’s it! You have now installed and started GlassFish on your Debian system. Remember that this guide assumes you have administrative privileges on your system. Always check the official GlassFish documentation for the most up-to-date installation instructions and any specific considerations related to your system configuration.

How to Install WordPress on Debian 12

WordPress is a popular content management system (CMS) used for creating and managing websites. It is an open-source platform written in PHP and paired with a MySQL or MariaDB database. WordPress provides a user-friendly interface and a wide range of themes, plugins, and customization options, making it accessible to users with varying levels of technical expertise.

In this tutorial we’ll show you how to install WordPress on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Also, install necessary packages:

# apt install nano wget unzip

Step 2: Install Nginx web server on Debian 12

To install Nginx, run the following command:

# apt install nginx

You can start the Nginx service and configure it to run on startup by entering the following commands:

# systemctl start nginx
# systemctl enable nginx

Verify the status of the Nginx service using systemctl status command:

# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:nginx(8)
    Process: 674 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 873 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 875 (nginx)
      Tasks: 2 (limit: 2273)
     Memory: 4.5M
        CPU: 402ms
     CGroup: /system.slice/nginx.service
             ├─875 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             └─876 "nginx: worker process"

Step 3: Install PHP and PHP extensions for WordPress

You can install PHP and other supporting packages using the following command:

# apt install php php-curl php-fpm php-bcmath php-gd php-soap php-zip php-curl php-mbstring php-mysqlnd php-gd php-xml php-intl php-zip

Verify if PHP is installed.

php -v

Output:

PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

After installing all the packages, edit the php.ini file:

# nano /etc/php/8.2/fpm/php.ini

Change the following settings per your requirements:

max_execution_time = 300
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M

To implement the changes, restart the php-fpm service:

# systemctl restart php8.2-fpm

Step 4: Install MariaDB Database Server

You can install MariaDB with the following command:

# apt install mariadb-server mariadb-client

Start the database server daemon, and also enable it to start automatically at the next boot with the following commands:

# systemctl start mariadb
# systemctl enable mariadb

Verify the status of the MariaDB service using systemctl status command:

# systemctl status mariadb

Output:

● mariadb.service - MariaDB 10.11.3 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 959 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 12 (limit: 2273)
     Memory: 256.5M
        CPU: 6.621s
     CGroup: /system.slice/mariadb.service
             └─959 /usr/sbin/mariadbd

Once the database server is installed, run the following command to secure your MariaDB server:

# mysql_secure_installation

You will then be asked several configuration questions, which you must answer Y to each of them.

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

Restart the database server for the changes to take effect.

# systemctl restart mariadb

Step 5: Create a New Database for WordPress

To do this, log in to your MariaDB server using the following command:

# mysql -u root -p

Run the following commands to create a new database and user:

MariaDB [(none)]> CREATE DATABASE wordpress_db;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT

Note: Make sure to replace 'password' with a strong password of your choice.

Step 6: Download WordPress

We will now download the latest version of WordPress from the WordPress Official site.

Use the following command to download WordPress:

# wget https://wordpress.org/latest.zip

Extract file into the folder /var/www/html/ with the following command,

# unzip latest.zip -d /var/www/html/

Next, navigate to the  /var/www/html/wordpress/ directory:

# cd /var/www/html/wordpress

WordPress comes with a configuration sample file. Make a copy of this file:

# cp wp-config-sample.php wp-config.php

Next, edit the WordPress configuration file and define your database settings:

# nano wp-config.php

Change the following lines that match your database settings:

/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress_db' );

/** MySQL database username */
define( 'DB_USER', 'wordpress_user' );

/** MySQL database password */
define( 'DB_PASSWORD', 'password' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

Save the file when you are finished.

Change the permission of the website directory:

# chown -R www-data:www-data /var/www/html/wordpress/

Step 7: Configure Nginx Web Server for WordPress

Navigate to /etc/nginx/conf.d directory and run the following command to create a configuration file for your installation:

# nano /etc/nginx/conf.d/wordpress.conf

Add the following content:

server {
  listen 80;

    server_name  your-domain.com www.your-domain.com;
    root   /var/www/html/wordpress;
    index  index.php;

    access_log /var/log/nginx/your-domain.com.access.log;
    error_log /var/log/nginx/your-domain.com.error.log;

    client_max_body_size 100M;

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

    location ~ \.php$ {
         include snippets/fastcgi-php.conf;
         fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
         include fastcgi_params;
         fastcgi_intercept_errors on;
    }
}

Save the file and Exit.

Restart the Nginx web server.

# systemctl restart nginx

Step 8: Access WordPress Web Installer

Open your browser type your domain e.g http://your-domain.com You will be redirected to the language selection screen:

Select your language and click on the Continue button.

Provide the requested information and click on the Install WordPress button. Once the installation has been finished. You should see the following screen:

Click on the Log in button. You should see the WordPress login screen:

Enter your administrator user, password and click on the Log In button. You will get the dashboard in the following screen:

Comments and Conclusion

That’s it. You have successfully installed WordPress CMS (Content Management System) on Debian 12 OS.

For additional help or useful information, we recommend you to check the official WordPress documentation.

If you have any questions please leave a comment below.