To install RADIUSdesk, you need sufficient knowledge and experience with Linux:
Requirement | Comment |
---|---|
Interpreting PHP scripts | We want the web server to call the PHP interpreter when a page with the .php extension is requested. |
Accessing MySQL functions from PHP | Since we are setting up a LEMP server, we need to install a MySQL server and access it from PHP. We will install MariaDB, which is a direct replacement for MySQL. |
Change the expiration date of the HTTP headers to encourage caching. | We want files that do not change (e.g. CSS or images) to be cached on the client side to make the experience more pleasant for the client |
Compress the text before it is sent to the client. | We can compress the text that flows between the client and the server and in this way reduce the number of bytes transmitted over the wire, which in turn should provide a more pleasant experience for the client |
Enable rewrite rules in CakePHP for pretty URLs | CakePHP uses the .htaccess files in Apache to enable pretty URLs. Since Nginx does not support .htaccess files, we need to modify Nginx to behave the same way. |
# Add the system user sudo adduser system sudo usermod -aG sudo system # Update the system to the latest sudo apt-get upgrade
ip a
sudo vi /etc/netplan/50-cloud-init.yaml
# This file is generated from the information provided by # the data source. Changes to it do not persist across an instance. # To disable the network configuration functions of cloud-init, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following content: # network: {config: disabled} network: version: 2 ethernets: enp0s3: addresses: [] dhcp4: true optional: true enp0s8: addresses: [] dhcp4: true optional: true
sudo netplan --debug apply
ip addr #Feedback contains 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:fe:57:09 brd ff:ff:ff:ff:ff:ff inet 192.168.1.111/24 brd 192.168.1.255 scope global dynamic enp0s3 valid_lft 255675sec preferred_lft 255675sec inet6 fe80::a00:27ff:fefe:5709/64 scope link valid_lft forever preferred_lft forever 3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:8c:d3:32 brd ff:ff:ff:ff:ff:ff inet6 fe80::a00:27ff:fe8c:d332/64 scope link valid_lft forever preferred_lft forever
sudo systemctl stop apache2.service sudo apt-get -y remove apache2
# Get the latest package lists sudo apt-get update # Update the system to the latest sudo apt-get upgrade
sudo apt-get -y install language-pack-en-base
sudo apt-get -y install nginx
sudo systemctl stop nginx.service sudo systemctl start nginx.service
sudo apt-get -y install php-fpm sudo systemctl enable php8.3-fpm sudo systemctl start php8.3-fpm
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.3-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(); ?>
sudo apt-get -y install mariadb-server php8.3-mysql sudo systemctl enable mariadb sudo systemctl restart mariadb sudo systemctl status mariadb
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 vi /etc/mysql/conf.d/enable_event_scheduler.cnf
[mysqld] event_scheduler=on
sudo systemctl restart mariadb
sudo mysql -u root MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'event_scheduler'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | event_scheduler | ON | +-----------------+-------+ 1 row in set (0.001 sec)
sudo vi /etc/nginx/sites-available/default
location ~ ^/cake4/.+\.(jpg|jpeg|gif|png|ico|js|css)$ { rewrite ^/cake4/rd_cake/webroot/(.*)$ /cake4/rd_cake/webroot/$1 break; rewrite ^/cake4/rd_cake/(.*)$ /cake4/rd_cake/webroot/$1 break; access_log off; expires max; add_header Cache-Control public; }
sudo systemctl reload nginx.service
sudo apt-get -y install php-cli php-mysql php-gd php-curl php-xml php-mbstring php-intl php-sqlite3 git wget sudo systemctl restart php8.3-fpm
cd /var/www sudo git clone https://github.com/RADIUSdesk/rdcore.git
cd /var/www sudo git clone https://github.com/RADIUSdesk/rd_mobile.git
cd /var/www/html sudo ln -s ../rdcore/rd ./rd sudo ln -s ../rdcore/cake4 ./cake4 sudo ln -s ../rdcore/login ./login sudo ln -s ../rdcore/AmpConf/build/production/AmpConf ./conf_dev sudo ln -s ../rdcore/cake4/rd_cake/setup/scripts/reporting ./reporting #For the RD Mobile UI sudo ln -s ../rd_mobile/build/production/RdMobile ./rd_mobile
sudo mkdir -p /var/www/html/cake4/rd_cake/logs sudo mkdir -p /var/www/html/cake4/rd_cake/webroot/files/imagecache sudo mkdir -p /var/www/html/cake4/rd_cake/tmp sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/tmp sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/logs sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/img/realms sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/img/dynamic_details sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/img/dynamic_photos sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/img/access_providers sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/img/hardwares sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/files/imagecache
#NOTE FAILING TO DO THIS STEP will break the RADIUS graphs #Some error messages may appear in the output, which is not a problem - no need to worry sudo su mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
sudo su mysql -u root create database rd; GRANT ALL PRIVILEGES ON rd.* to 'rd'@'127.0.0.1' IDENTIFIED BY 'rd'; GRANT ALL PRIVILEGES ON rd.* to 'rd'@'localhost' IDENTIFIED BY 'rd'; exit;
sudo mysql -u root rd < /var/www/html/cake4/rd_cake/setup/db/rd.sql
sudo mysql -u root rd < /var/www/rdcore/cake4/rd_cake/setup/db/8.068_add_email_sms_histories.sql
* Some of these patches may add new columns to existing database tables. In this case, it is recommended to clear the CakePHP models (tables) cache to ensure that the latest changes are also applied there:
sudo su cd /var/www/rdcore/cake4/rd_cake/tmp/cache/models rm * exit
sudo vi /etc/nginx/sites-enabled/default
server_name _; location /cake4/rd_cake/node-reports/submit_report.json { try_files $uri $uri/ /reporting/reporting.php; }
location /cake4/rd_cake { rewrite ^/cake4/rd_cake(.+)$ /cake4/rd_cake/webroot$1 break; try_files $uri $uri/ /cake4/rd_cake/index.php$is_args$args; }
sudo systemctl reload nginx
sudo cp -R /var/www/html/rd/build/production/Rd/* /var/www/html/
Username: root Password: admin
sudo cp /var/www/html/cake4/rd_cake/setup/cron/cron4 /etc/cron.d/
sudo apt-get update sudo apt-get -y install software-properties-common