This is an old revision of the document!
Install Nginx
Prep
# Get the latest package lists
sudo apt-get update
# Update the system to the latest
sudo apt-get upgrade
sudo apt-get -y install nginx
sudo systemctl stop nginx.service
sudo systemctl start nginx.service
Navigate to the IP Address of the server where you installed
Nginx using a browser to ensure Nginx serves content e.g.
http://127.0.0.1
The default install of Nginx does not support the serving of .php files.
We will install a program (actually a service) called php-fpm.
This service will listen for requests to interpret.
Install the php-fpm service by installing the default version 8.2 of the packages
sudo apt-get -y install php-fpm
sudo systemctl enable php8.2-fpm
sudo systemctl start php8.2-fpm
Modify Nginx
sudo vi /etc/nginx/sites-enabled/default
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
sudo systemctl reload nginx.service
sudo vi /var/www/html/test.php
<?php
phpinfo();
?>
Install MariaDB
Why MariaDB?
We discovered that the version of MySQL that comes bundled by default with Debian 12 (bookworm) are breaking things on RADIUSdesk.
For this reason we install MariaDB as an alternative.
MariaDB is an open-source relational database management system, commonly used as an alternative for MySQL as the database portion of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack.
It is intended to be a drop-in replacement for MySQL.
Be sure to supply a root password for the MariaDB database when asked for it if you are security conscious else simply hit the ESC key.
sudo apt-get -y install mariadb-server php8.2-mysql
sudo systemctl enable mariadb
sudo systemctl restart mariadb
sudo systemctl status mariadb
Disable strict mode
With Debian 12 (bookworm), the bundled release of MariaDB is at version 15.1 which introduced a few Strict modes which have some problems with RADIUSdesk database implementation.
We will disable Strict SQL Mode in MariaDB by creating a new file /etc/mysql/conf.d/disable_strict_mode.cnf
sudo vi /etc/mysql/conf.d/disable_strict_mode.cnf
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sudo systemctl restart mariadb