RADIUSdesk

logo

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
getting_started:20_install_ubuntu_nginx [2022/06/13 20:04]
admin
getting_started:20_install_ubuntu_nginx [2023/01/12 21:37] (current)
admin [Installing RADIUSdesk on Ubuntu 20.04 using Nginx]
Line 1: Line 1:
 ====== Installing RADIUSdesk on Ubuntu 20.04 using Nginx ====== ====== Installing RADIUSdesk on Ubuntu 20.04 using Nginx ======
 +<WRAP center round important 100%>
 +  * As from January 2023 we encourage you to run the latest RADIUSdesk code on Ubuntu 22.04 or higher.
 +  * If you however are not able to do for whatever reason, use the URL below for **reference** instructions to replace PHP v7.4 with PHP v8.1 on Ubuntu 20.04.
 +  * https://www.cloudbooklet.com/how-to-install-or-upgrade-php-8-1-on-ubuntu-20-04/
 +  * The latest RADIUSdesk code requires a minimum of PHP v8.1.
 +  * **The instructions on this page will not work with the latest RADIUSdesk code since they are for Ubuntu 20.04 and NOT 22.04.** 
 +</WRAP>
 +
 ===== Skills Required to Install ===== ===== Skills Required to Install =====
  
Line 15: Line 23:
   * This section will cover the steps you have to go through to get RADIUSdesk working with a **LEMP** stack on Ubuntu 20.04   * This section will cover the steps you have to go through to get RADIUSdesk working with a **LEMP** stack on Ubuntu 20.04
      * * A LEMP stack is one of those acronyms you can impress your friends with. It stands for Linux NginX MySQL and PHP.      * * A LEMP stack is one of those acronyms you can impress your friends with. It stands for Linux NginX MySQL and PHP.
 +
 +<WRAP center round tip 100%>
 +  * We moved recently from CakePHPv3 to CakePHPv4.
 +  * If you manage devices using MESHdesk and APdesk be sure to also execute the instructions that include cake3 in order for your system to have backwards compatibility.
 +  * The firmware on these devices might still point to the **cake3** directory thus we need to include support for it 
 +</WRAP>
 +
  
 ----------- -----------
Line 235: Line 250:
 </code> </code>
   * Add the following inside the server section:   * Add the following inside the server section:
 +<code bash>
 +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;
 +}
 +
 +</code>
 +  * Add below **only** if you require backward compatibility (MESHdesk and APdesk).
 <code bash> <code bash>
 location ~ ^/cake3/.+\.(jpg|jpeg|gif|png|ico|js|css)$ { location ~ ^/cake3/.+\.(jpg|jpeg|gif|png|ico|js|css)$ {
Line 255: Line 281:
   * 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.
-    * **cake3** is a CakePHPv3 application and can be considered the engine room. Here the data is processed before being presented by the presentation layer.+    * **cake4** is a CakePHPv4 application and can be considered the engine room. Here the data is processed before being presented by the presentation layer.
     * **login** is a directory with various login pages which are centrally managed through the RADIUSdesk **Dynamic Login Pages** applet.     * **login** is a directory with various login pages which are centrally managed through the RADIUSdesk **Dynamic Login Pages** applet.
   * Later we will create various symbolic links from locations inside the **rdcore** directory to locations inside the web server's document root directory.   * Later we will create various symbolic links from locations inside the **rdcore** directory to locations inside the web server's document root directory.
Line 262: Line 288:
   * Make sure the following packages are installed:   * Make sure the following packages are installed:
 <code bash> <code bash>
-sudo apt-get -y install php-cli php-mysql php-gd php-curl php-xml php-mbstring php-intl 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 php7.4-fpm sudo systemctl restart php7.4-fpm
 </code> </code>
Line 277: Line 303:
 cd /var/www/html cd /var/www/html
 sudo ln -s ../rdcore/rd ./rd sudo ln -s ../rdcore/rd ./rd
-sudo ln -s ../rdcore/cake3 ./cake3+sudo ln -s ../rdcore/cake4 ./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/cake3/rd_cake/setup/scripts/reporting ./reporting+sudo ln -s ../rdcore/cake4/rd_cake/setup/scripts/reporting ./reporting
 </code> </code>
  
Line 286: Line 314:
   * Change the ownership of the following files to www-data so Nginx can make changes to the files/directories   * Change the ownership of the following files to www-data so Nginx can make changes to the files/directories
 <code bash> <code bash>
-sudo mkdir -p  /var/www/html/cake3/rd_cake/logs +sudo mkdir -p  /var/www/html/cake4/rd_cake/logs 
-sudo mkdir -p /var/www/html/cake3/rd_cake/webroot/files/imagecache +sudo mkdir -p /var/www/html/cake4/rd_cake/webroot/files/imagecache 
-sudo mkdir -p /var/www/html/cake3/rd_cake/tmp +sudo mkdir -p /var/www/html/cake4/rd_cake/tmp 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/tmp +sudo chown -R www-data. /var/www/html/cake4/rd_cake/tmp 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/logs +sudo chown -R www-data. /var/www/html/cake4/rd_cake/logs 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/webroot/img/realms +sudo chown -R www-data. /var/www/html/cake4/rd_cake/webroot/img/realms 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/webroot/img/dynamic_details +sudo chown -R www-data. /var/www/html/cake4/rd_cake/webroot/img/dynamic_details 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/webroot/img/dynamic_photos +sudo chown -R www-data. /var/www/html/cake4/rd_cake/webroot/img/dynamic_photos 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/webroot/img/access_providers +sudo chown -R www-data. /var/www/html/cake4/rd_cake/webroot/img/access_providers 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/webroot/img/hardwares +sudo chown -R www-data. /var/www/html/cake4/rd_cake/webroot/img/hardwares 
-sudo chown -R www-data. /var/www/html/cake3/rd_cake/webroot/files/imagecache+sudo chown -R www-data. /var/www/html/cake4/rd_cake/webroot/files/imagecache
 </code> </code>
  
Line 320: Line 348:
   * Populate the database:   * Populate the database:
 <code bash> <code bash>
-sudo mysql -u root rd < /var/www/html/cake3/rd_cake/setup/db/rd.sql+sudo mysql -u root rd < /var/www/html/cake4/rd_cake/setup/db/rd.sql
 </code> </code>
  
 === Configure Nginx === === Configure Nginx ===
  
-  * Configure Nginx to rewrite some RdCore URLs starting with ///cake3/rd_cake//.+  * Configure Nginx to rewrite some RdCore URLs starting with ///cake4/rd_cake//.
   * Edit ///etc/nginx/sites-enabled/default//   * Edit ///etc/nginx/sites-enabled/default//
 <code bash> <code bash>
Line 333: Line 361:
 <code bash> <code bash>
 server_name _; server_name _;
 +location /cake4/rd_cake/node-reports/submit_report.json {
 +    try_files $uri $uri/ /reporting/reporting.php;
 +}
 +</code>
 +  * If you need backward compatibility support (MESHdesk and APdesk) also add this section:
 +<code bash>
 location /cake3/rd_cake/node-reports/submit_report.json { location /cake3/rd_cake/node-reports/submit_report.json {
     try_files $uri $uri/ /reporting/reporting.php;     try_files $uri $uri/ /reporting/reporting.php;
Line 338: Line 372:
 </code> </code>
   * Add the following configuration block inside the server section (This you can add towards the end):   * Add the following configuration block inside the server section (This you can add towards the end):
 +<code bash>
 +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;
 +}
 +</code>
 +  * If you need backward compatibility support (MESHdesk and APdesk) also add this section:
 <code bash> <code bash>
 location /cake3/rd_cake { location /cake3/rd_cake {
Line 367: Line 408:
   * To activate the cron scripts execute the following command, which will add **RADIUSdesk**'s crons scripts to the Cron system   * To activate the cron scripts execute the following command, which will add **RADIUSdesk**'s crons scripts to the Cron system
 <code bash> <code bash>
-sudo cp /var/www/html/cake3/rd_cake/setup/cron/cron3 /etc/cron.d/+sudo cp /var/www/html/cake4/rd_cake/setup/cron/cron4 /etc/cron.d/
 </code> </code>
   * If you want to change the default intervals at which the scripts get executed, just edit the /etc/cron.d/cron3 file.    * If you want to change the default intervals at which the scripts get executed, just edit the /etc/cron.d/cron3 file.