Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
install_24_4 [2024/02/20 12:41] – created systeminstall_24_4 [2026/08/15 07:32] (current) system
Line 22: Line 22:
   * This section describes the steps you need to take to get RADIUSdesk up and running with a LEMP stack on Ubuntu 24.04   * This section describes the steps you need to take to get RADIUSdesk up and running with a LEMP stack on Ubuntu 24.04
      * A LEMP stack is one of those acronyms you can use to impress your friends. It stands for Linux NginX MySQL and PHP.      * A LEMP stack is one of those acronyms you can use to impress your friends. It stands for Linux NginX MySQL and PHP.
- 
-<alert type="info"> 
-  * We recently switched from CakePHPv3 to CakePHPv4. 
-  *  If you manage devices with MESHdesk and APdesk, make sure you also run the instructions that include cake3 so that your system is backwards compatible. 
-  * The firmware on these devices may still point to the cake3 directory, so we need to include support for this directory. 
-</alert> 
  
 ----------- -----------
Line 166: Line 160:
   * We will install a program (actually a service) called **php-fpm**.    * We will install a program (actually a service) called **php-fpm**. 
   * This service waits for requests for interpretation.   * This service waits for requests for interpretation.
-  * Install the php-fpm service by installing the default version 8.of the packages +  * Install the php-fpm service by installing the default version 8.of the packages 
 <code bash> <code bash>
 sudo apt-get -y install php-fpm sudo apt-get -y install php-fpm
-sudo systemctl enable php8.1-fpm +sudo systemctl enable php8.3-fpm 
-sudo systemctl start php8.1-fpm+sudo systemctl start php8.3-fpm
 </code> </code>
  
Line 184: Line 178:
 index index.php index.html index.htm index.nginx-debian.html; index index.php index.html index.htm index.nginx-debian.html;
 </code> </code>
-  * Enable PHP processing by leaving this section uncommented. Note that we are using the UNIX socket and that we are using 8.and not 7.4, which was originally specified in the configuration file.+  * Enable PHP processing by leaving this section uncommented. Note that we are using the UNIX socket and that we are using 8.and not 7.4, which was originally specified in the configuration file.
 <code bash> <code bash>
 # Pass PHP scripts to FastCGI server # Pass PHP scripts to FastCGI server
Line 192: Line 186:
     #     #
     #       # With php-fpm (or other unix sockets):     #       # With php-fpm (or other unix sockets):
-    fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;+    fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
     #       # With php-cgi (or other tcp sockets):     #       # With php-cgi (or other tcp sockets):
     #       fastcgi_pass 127.0.0.1:9000;     #       fastcgi_pass 127.0.0.1:9000;
Line 232: Line 226:
  
 <code bash> <code bash>
-sudo apt-get -y install mariadb-server php8.1-mysql+sudo apt-get -y install mariadb-server php8.3-mysql
 sudo systemctl enable mariadb sudo systemctl enable mariadb
 sudo systemctl restart mariadb sudo systemctl restart mariadb
Line 249: Line 243:
 sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
 </code> </code>
-  * Save the file and restart the MySQL server+  * Save the file
 + 
 +=== Enable the Event Scheduler === 
 +  * MariaDB and MySQL has a built in Event Scheduler (like CRON for a database) which is disabled by default. 
 +  * We make use of this feature to automatically optimize some of the database tables. 
 +  * We will enable the Event Scheduler in MariaDB by creating a new file /etc/mysql/conf.d/enable_event_scheduler.cnf 
 +<code bash> 
 +sudo vi /etc/mysql/conf.d/enable_event_scheduler.cnf 
 +</code> 
 +  * Enter these two lines: 
 +<code bash> 
 +[mysqld] 
 +event_scheduler=on 
 +</code> 
 +  * Save the file. 
 +  *  Restart the MySQL server
 <code bash> <code bash>
 sudo systemctl restart mariadb sudo systemctl restart mariadb
 </code> </code>
 +  * You can confirm that it is now enabled by checking the following from the SQL terminal: 
 +<code bash> 
 +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) 
 +</code>
 ----- -----
 ==== Performance tuning for Nginx ==== ==== Performance tuning for Nginx ====
Line 266: Line 285:
     rewrite ^/cake4/rd_cake/webroot/(.*)$ /cake4/rd_cake/webroot/$1 break;     rewrite ^/cake4/rd_cake/webroot/(.*)$ /cake4/rd_cake/webroot/$1 break;
     rewrite ^/cake4/rd_cake/(.*)$ /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; 
-} 
-</code> 
-  * Only add the following information if you require backward compatibility (MESHdesk and APdesk). 
-<code bash> 
-location ~ ^/cake3/.+\.(jpg|jpeg|gif|png|ico|js|css)$ { 
-    rewrite ^/cake3/rd_cake/webroot/(.*)$ /cake3/rd_cake/webroot/$1 break; 
-    rewrite ^/cake3/rd_cake/(.*)$ /cake3/rd_cake/webroot/$1 break; 
     access_log off;     access_log off;
     expires max;     expires max;
Line 292: Line 301:
   * RADIUSdesk consists of three components.   * RADIUSdesk consists of three components.
     * **rd** directory with its contents contains all the HTML and JavaScript code and is used as the presentation layer.     * **rd** directory with its contents contains all the HTML and JavaScript code and is used as the presentation layer.
-    * **cake4** is a CakePHPv4 application and can be considered the engine room. This is where the data is processed before it is displayed by the presentation layer.+    * **cake4** is a CakePHPv5 (It was CakePHPv4 initially) application  and can be considered the engine room. This is where the data is processed before it is displayed by the presentation layer.
     * **login** is a directory with various login pages that are managed centrally via the **RADIUSdesk Dynamic Login Pages** applet.     * **login** is a directory with various login pages that are managed centrally via the **RADIUSdesk Dynamic Login Pages** applet.
   * Later we will create various symbolic links from locations within the **rdcore** directory to locations within the document root directory of the web server.   * Later we will create various symbolic links from locations within the **rdcore** directory to locations within the document root directory of the web server.
Line 300: Line 309:
 <code bash> <code bash>
 sudo apt-get -y install php-cli php-mysql php-gd php-curl php-xml php-mbstring php-intl php-sqlite3 git wget 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.1-fpm+sudo systemctl restart php8.3-fpm
 </code> </code>
   *  Check out the **rdcore** git repository.   *  Check out the **rdcore** git repository.
Line 307: Line 316:
 sudo git clone https://github.com/RADIUSdesk/rdcore.git sudo git clone https://github.com/RADIUSdesk/rdcore.git
 </code> </code>
-  *   This will create an **rdcore** directory containing some subfolders.+  * This will create an **rdcore** directory containing some sub-folders. 
 +  * Check out the CakePHPv5 API back-end application 
 +<code bash> 
 +cd /var/www  
 +sudo git clone https://github.com/RADIUSdesk/rd_cake5.git 
 +</code>
   * It is recommended that you also include the RD Mobile UI.   * It is recommended that you also include the RD Mobile UI.
   * Check out the **rd_mobile** git repository.   * Check out the **rd_mobile** git repository.
Line 313: Line 327:
 cd /var/www cd /var/www
 sudo git clone https://github.com/RADIUSdesk/rd_mobile.git sudo git clone https://github.com/RADIUSdesk/rd_mobile.git
 +</code>
 +  * It is further recommended that you include RD-Connect for users to manage their accounts.
 +<code bash>
 +cd /var/www
 +sudo git clone https://github.com/RADIUSdesk/rd_connect.git
 +</code>
 +  * If you feel brave you can also try out out latest RdClient for clients to manage a couple of APs, Mesh Nodes or Permanent Users.
 +<code bash>
 +cd /var/www
 +sudo git clone https://github.com/RADIUSdesk/rd_client.git
 </code> </code>
  
Line 320: Line 344:
 cd /var/www/html cd /var/www/html
 sudo ln -s ../rdcore/rd ./rd sudo ln -s ../rdcore/rd ./rd
-sudo ln -s ../rdcore/cake4 ./cake4 +sudo ln -s ../rd_cake5 ./cake4
-#If backward compatibility is required for older firmware of MESHdesk +
-sudo ln -s ../rdcore/cake4 ./cake3+
 sudo ln -s ../rdcore/login ./login sudo ln -s ../rdcore/login ./login
 sudo ln -s ../rdcore/AmpConf/build/production/AmpConf ./conf_dev sudo ln -s ../rdcore/AmpConf/build/production/AmpConf ./conf_dev
-sudo ln -s ../rdcore/cake4/rd_cake/setup/scripts/reporting ./reporting+sudo ln -s ../rd_cake5/rd_cake/setup/scripts/reporting ./reporting
 #For the RD Mobile UI #For the RD Mobile UI
 sudo ln -s ../rd_mobile/build/production/RdMobile ./rd_mobile sudo ln -s ../rd_mobile/build/production/RdMobile ./rd_mobile
 +#For the RD-Connect Mobile UI
 +sudo ln -s ../rd_connect/build/production/RdConnect ./rd_connect
 +#For the RD-Client Mobile UI
 +sudo ln -s ../rd_client/build/production/RdClient ./rd_client
 </code> </code>
  
Line 336: Line 362:
 sudo mkdir -p /var/www/html/cake4/rd_cake/webroot/files/imagecache sudo mkdir -p /var/www/html/cake4/rd_cake/webroot/files/imagecache
 sudo mkdir -p /var/www/html/cake4/rd_cake/tmp sudo mkdir -p /var/www/html/cake4/rd_cake/tmp
-sudo chown -R www-data/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/var/www/html/cake4/rd_cake/logs +sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/logs 
-sudo chown -R 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/realms 
-sudo chown -R 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_details 
-sudo chown -R 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/dynamic_photos 
-sudo chown -R 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/access_providers 
-sudo chown -R 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/img/hardwares 
-sudo chown -R www-data/var/www/html/cake4/rd_cake/webroot/files/imagecache+sudo chown -R www-data:www-data /var/www/html/cake4/rd_cake/webroot/files/imagecache
 </code> </code>
  
Line 353: Line 379:
 #Some error messages may appear in the output, which is not a problem - no need to worry #Some error messages may appear in the output, which is not a problem - no need to worry
 sudo su sudo su
-mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root  mysql+mariadb-tzinfo-to-sql /usr/share/zoneinfo | sudo mysql -u root mysql
 </code> </code>
  
Line 376: Line 402:
   * See the example below   * See the example below
 <code bash> <code bash>
-sudo mysql -u root rd < /var/www/rdcore/cake4/rd_cake/setup/db/8.068_add_email_sms_histories.sql +sudo mysql -u root rd < /var/www/html/cake4/rd_cake/setup/db/8.068_add_email_sms_histories.sql  
 +</code> 
 + * 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: 
 +<code bash> 
 +sudo su 
 +cd /var/www/rdcore/html/rd_cake/tmp/cache/models 
 +rm * 
 +exit
 </code> </code>
 </alert> </alert>
Line 391: Line 424:
 server_name _; server_name _;
 location /cake4/rd_cake/node-reports/submit_report.json { location /cake4/rd_cake/node-reports/submit_report.json {
-    try_files $uri $uri/ /reporting/reporting.php; 
-} 
-</code> 
-  * If you need support for backward compatibility (MESHdesk and APdesk), add this section as well: 
-<code bash> 
-location /cake3/rd_cake/node-reports/submit_report.json { 
     try_files $uri $uri/ /reporting/reporting.php;     try_files $uri $uri/ /reporting/reporting.php;
 } }
Line 405: Line 432:
    rewrite ^/cake4/rd_cake(.+)$ /cake4/rd_cake/webroot$1 break;    rewrite ^/cake4/rd_cake(.+)$ /cake4/rd_cake/webroot$1 break;
    try_files $uri $uri/ /cake4/rd_cake/index.php$is_args$args;    try_files $uri $uri/ /cake4/rd_cake/index.php$is_args$args;
-} 
-</code> 
-  *  If you need support for backward compatibility (MESHdesk and APdesk), add this section as well: 
-<code bash> 
-location /cake3/rd_cake { 
-   rewrite ^/cake3/rd_cake(.+)$ /cake3/rd_cake/webroot$1 break; 
-   try_files $uri $uri/ /cake3/rd_cake/index.php$is_args$args; 
 } }
 </code> </code>
Line 438: Line 458:
   * To activate the cron scripts, execute the following command, which adds the **RADIUSdesk** cron scripts to the cron system   * To activate the cron scripts, execute the following command, which adds the **RADIUSdesk** cron scripts to the cron system
 <code bash> <code bash>
-sudo cp /var/www/html/cake4/rd_cake/setup/cron/cron4 /etc/cron.d/+sudo cp /var/www/html/cake4/rd_cake/setup/cron/rd_cake5 /etc/cron.d/
 </code> </code>
   * If you want to change the default intervals at which the scripts are executed, simply edit the file /etc/cron.d/cron3.   * If you want to change the default intervals at which the scripts are executed, simply edit the file /etc/cron.d/cron3.
  
 ===== Add LETSENCRYPT certificate ===== ===== Add LETSENCRYPT certificate =====
 +<alert type="success">
 +Since instructions for Ubuntu 24.04 has not yet been released, we will use the instructions for 22.04, which should work just as well
 +</alert>
   * Instead of repeating the existing documentation, we simply add a URL with the corresponding instructions   * Instead of repeating the existing documentation, we simply add a URL with the corresponding instructions
   * Before you follow the instructions in the URL, you should first do the following   * Before you follow the instructions in the URL, you should first do the following
Line 449: Line 472:
 sudo apt-get -y install software-properties-common sudo apt-get -y install software-properties-common
 </code> </code>
-  * https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-24-04+  * https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-22-04 
 + 
 ===== Next steps ===== ===== Next steps =====
   * Make sure that you also install **FreeRADIUS**.   * Make sure that you also install **FreeRADIUS**.
   * [[install_24_4_freeradius|Install FreeRADIUS]]   * [[install_24_4_freeradius|Install FreeRADIUS]]
  • install_24_4.1708425698.txt.gz
  • Last modified: 2024/02/20 12:41
  • by system