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
install_22_4 [2024/02/08 17:18] – [Performance tuning for Nginx] systeminstall_22_4 [2024/09/19 10:20] (current) – [Install MariaDB] system
Line 1: Line 1:
 +<nav type="pills" justified="false">
 +  * [[:user_manuals|Back to Documentation]]
 +  * [[:install_22_4|Install on Ubuntu 22.04]]
 +</nav>
 +
 +----
 +
 ====== Installation of RADIUSdesk on Ubuntu 22.04 with Nginx ====== ====== Installation of RADIUSdesk on Ubuntu 22.04 with Nginx ======
 ===== Skills required for the installation ===== ===== Skills required for the installation =====
Line 242: Line 249:
 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+=== 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>
 +  * 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> </code>
  
Line 285: Line 316:
   * 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. Here the data is processed before being presented by 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. 
-    * **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 that are managed centrally via 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'document root directory.+  * Later we will create various symbolic links from locations within the **rdcore** directory to locations within the document root directory of the web server.
  
 === Required packages === === Required packages ===
-  * Make sure the following packages are installed.+  * Make sure that 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 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
Line 300: Line 331:
 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 that contains some subfolders.+  *   This will create an **rdcore** directory containing some subfolders.
   * 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 308: Line 339:
 </code> </code>
  
-=== Create softlinks ===+=== Create soft links ===
   * We will create softlinks in the directory where Nginx provides the RADIUSdesk content.   * We will create softlinks in the directory where Nginx provides the RADIUSdesk content.
 <code bash> <code bash>
Line 324: Line 355:
  
 === Change ownership === === Change ownership ===
-  * 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 that Nginx can make changes to the files/directories
 <code bash> <code bash>
 sudo mkdir -p  /var/www/html/cake4/rd_cake/logs sudo mkdir -p  /var/www/html/cake4/rd_cake/logs
Line 339: Line 370:
 </code> </code>
  
-=== The Database ===+=== The database ===
   * Make sure that the time zone on the server is set to UTC   * Make sure that the time zone on the server is set to UTC
   * Fill the time zone data in the DB   * Fill the time zone data in the DB
 <code bash> <code bash>
-#NOTE FAILING THIS STEP will break the RADIUS graphs +#NOTE FAILING TO DO THIS STEP will break the RADIUS graphs 
-#There might be some error messages in the output which is fine - no need to be alarmed+#Some error messages may appear in the outputwhich is not a problem - no need to worry
 sudo su sudo su
 mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root  mysql mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root  mysql
Line 365: Line 396:
 <alert type="warning"> <alert type="warning">
   * RADIUSdesk is under active development and sometimes we add SQL patches.   * RADIUSdesk is under active development and sometimes we add SQL patches.
-  * The SQL patches are located at **/var/www/html/cake4/rd_cake/setup/db/**.+  * The SQL patches are located under **/var/www/html/cake4/rd_cake/setup/db/**.
   * These patches are non-destructive and you can run them against the database   * These patches are non-destructive and you can run them against the database
-  * See the sample 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/rdcore/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/cake4/rd_cake/tmp/cache/models
 +rm *
 +exit
 </code> </code>
 </alert> </alert>
- 
  
 === Configure Nginx === === Configure Nginx ===
  
-  * Configure Nginx to rewrite some RdCore URLs starting with ///cake4/rd_cake//.+  * Configure Nginx to rewrite some RdCore URLs that start with ///cake4/rd_cake//.
   * Edit ///etc/nginx/sites-enabled/default//   * Edit ///etc/nginx/sites-enabled/default//
 <code bash> <code bash>
 sudo vi /etc/nginx/sites-enabled/default sudo vi /etc/nginx/sites-enabled/default
 </code> </code>
-  * Add this once section directly below **server_name** item. (This is so that this rule is **hit** first for the reporting side. We do not use CakePHP for the reporting anymore due to performance issues.+  * Insert this section directly under the **server_name** entry. (This is so that this rule is **hit** first for the reporting side. Due to performance issues, we no longer use CakePHP for reporting.
 <code bash> <code bash>
 server_name _; server_name _;
Line 388: Line 425:
 } }
 </code> </code>
-  * If you need backward compatibility support (MESHdesk and APdesk) also add this section:+  * If you need support for backward compatibility (MESHdesk and APdesk)add this section as well:
 <code bash> <code bash>
 location /cake3/rd_cake/node-reports/submit_report.json { location /cake3/rd_cake/node-reports/submit_report.json {
Line 394: Line 431:
 } }
 </code> </code>
-  * Add the following configuration block inside the server section (This you can add towards the end):+  * Insert the following configuration block into the server section (you can add this towards the end):
 <code bash> <code bash>
 location /cake4/rd_cake { location /cake4/rd_cake {
Line 401: Line 438:
 } }
 </code> </code>
-  * If you need backward compatibility support (MESHdesk and APdesk) also add this section:+  *  If you need support for backward compatibility (MESHdesk and APdesk)add this section as well:
 <code bash> <code bash>
 location /cake3/rd_cake { location /cake3/rd_cake {
Line 414: Line 451:
  
 === Important URLs ===   === Important URLs ===  
-  * The following URLs are important to reach the UI +  * The following URLs are important to reach the user interface 
-  * To load the optimized UI, go to http://127.0.0.1/rd/build/production/Rd/ +  * To load the optimized user interface, go to http://127.0.0.1/rd/build/production/Rd/ 
-  * If you want to serve the content directly out of the webroot, do the following:+  * If you want to deliver the content directly from the webroot, proceed as follows:
 <code bash> <code bash>
 sudo cp -R /var/www/html/rd/build/production/Rd/* /var/www/html/ sudo cp -R /var/www/html/rd/build/production/Rd/* /var/www/html/
Line 422: Line 459:
   * To load the RD Mobile UI, go to http://127.0.0.1/rd_mobile   * To load the RD Mobile UI, go to http://127.0.0.1/rd_mobile
  
-== Login Credentials == +== Login credentials == 
   * By default you can log in with the following credentials   * By default you can log in with the following credentials
 Username: **root** Password: **admin** Username: **root** Password: **admin**
Line 437: Line 474:
  
 ===== Add LETSENCRYPT certificate ===== ===== Add LETSENCRYPT certificate =====
-  * Instead of repeating the existing documentation, we simply add a URL with the appropriate instructions. +  * Instead of repeating the existing documentation, we simply add a URL with the corresponding instructions 
-  * You may want to do the following first before following the instructions in the URL +  * Before you follow the instructions in the URL, you should first do the following
 <code bash> <code bash>
 sudo apt-get update sudo apt-get update
Line 446: Line 482:
   * https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-22-04   * https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-22-04
 ===== Next steps ===== ===== Next steps =====
-  * Be sure to also install **FreeRADIUS**+  * Make sure that you also install **FreeRADIUS**.
   * [[install_22_4_freeradius|Install FreeRADIUS]]   * [[install_22_4_freeradius|Install FreeRADIUS]]
  • install_22_4.1707405492.txt.gz
  • Last modified: 2024/02/08 17:18
  • by system