This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
getting_started:22_install_ubuntu_nginx [2022/09/02 22:21] admin |
getting_started:22_install_ubuntu_nginx [2023/11/22 09:58] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Installing RADIUSdesk on Ubuntu 22.04 using Nginx ====== | ====== Installing RADIUSdesk on Ubuntu 22.04 using Nginx ====== | ||
- | ===== Skills | + | ===== Skills |
- | To install RADIUSdesk you need sufficient knowledge and experience | + | To install RADIUSdesk, you need sufficient knowledge and experience |
- | * Install | + | * Installing |
- | * Edit text files from the terminal using a text editor | + | * Edit text files from the terminal using a text editor |
* Install packages from a repository. | * Install packages from a repository. | ||
- | * Be comfortable | + | * You must be familiar |
===== Background ===== | ===== Background ===== | ||
- | | + | * Nginx is a web server that seems to have overtaken Apache in terms of popularity and number of active |
- | * It is fresh, lightweight, | + | * It is new, lightweight, |
- | | + | * Nginx is the new Apache so to speak. |
- | * This section | + | * This section |
- | * * A LEMP stack is one of those acronyms you can impress your friends | + | * A LEMP stack is one of those acronyms you can use to impress your friends. It stands for Linux NginX MySQL and PHP. |
<WRAP center round tip 100%> | <WRAP center round tip 100%> | ||
- | * We moved recently from CakePHPv3 to CakePHPv4. | + | * We recently |
- | * If you manage devices | + | * If you manage devices |
- | * The firmware on these devices might still point to the **cake3** directory | + | * The firmware on these devices might still point to the cake3 directory, so we need to include support for this directory. |
- | + | ||
</ | </ | ||
- | |||
----------- | ----------- | ||
- | ===== What do we require ===== | ||
- | | + | ===== What do we need ===== |
- | * The part that is more involved is to tweak **Nginx** to do the following: | + | |
+ | | ||
+ | * The more complicated | ||
^ Requirement | ^ Requirement | ||
- | | Interpret | + | | Interpreting |
- | | Be able to have access to the MySQL functions | + | | Access |
- | | Modify | + | | Change |
- | | Compress text before | + | | Compress |
- | | Enable rewrite rules in CakePHP for pretty | + | | Enable rewrite rules in CakePHP for pretty |
-------- | -------- | ||
Line 43: | Line 41: | ||
===== HOWTO ===== | ===== HOWTO ===== | ||
<WRAP center round alert 100%> | <WRAP center round alert 100%> | ||
- | * Please note that the shell behavior in Ubuntu 22.04 changed. | + | * Please note that the behavior |
- | * It seems that it **DOES | + | * It seems that it does NOT execute |
- | * You thus have to copy past these instructions | + | * So unfortunately you have to copy these commands |
</ | </ | ||
+ | |||
+ | |||
==== Add a sudo user ==== | ==== Add a sudo user ==== | ||
- | * We assume you have a clean install | + | * We assume |
* If you have not yet added a sudo user add one now. | * If you have not yet added a sudo user add one now. | ||
<code bash> | <code bash> | ||
Line 55: | Line 55: | ||
sudo adduser system | sudo adduser system | ||
# Update the system to the latest | # Update the system to the latest | ||
- | usermod -aG sudo system | + | sudo usermod -aG sudo system |
</ | </ | ||
- | ==== Networking | + | ==== Introduction |
- | * If you do not yet have a working network configuration on the server you plan to do the installation | + | * If you do not yet have a working network configuration on the server |
- | * Since there is such a huge difference between | + | * Since there is a big difference between Ubuntu 16.04 and Ubuntu 22.04, we feel that this section will help those who need to get used to the new way of working. |
- | * For this we assume you have a bare VM (like the ones from https:// | + | * We assume |
- | * We also assume you used this to create a VM in Virtualbox and are now faced with only the local loopback interface (127.0.0.1) when issuing | + | * We also assume |
- | * To see which interfaces are available (yet some might just not yet be configured) | + | * To see which interfaces are available (although |
<code bash> | <code bash> | ||
ip a | ip a | ||
Line 152: | Line 152: | ||
==== Configure Nginx to interpret .php files ==== | ==== Configure Nginx to interpret .php files ==== | ||
=== php-fpm === | === php-fpm === | ||
- | * The default | + | * The default |
* We will install a program (actually a service) called **php-fpm**. | * We will install a program (actually a service) called **php-fpm**. | ||
- | * This service | + | * This service |
- | * Install the php-fpm service by installing the default version 8.1 of the packages | + | * Install the php-fpm service by installing the default version 8.1 of the packages |
<code bash> | <code bash> | ||
sudo apt-get -y install php-fpm | sudo apt-get -y install php-fpm | ||
Line 163: | Line 163: | ||
==== Modify Nginx ==== | ==== Modify Nginx ==== | ||
- | * Now that the php-fpm service is installed | + | * Now that the php-fpm service is installed, let's modify |
* Edit the default server file: | * Edit the default server file: | ||
<code bash> | <code bash> | ||
Line 173: | Line 173: | ||
index index.php index.html index.htm index.nginx-debian.html; | index index.php index.html index.htm index.nginx-debian.html; | ||
</ | </ | ||
- | * Activate | + | * Enable |
<code bash> | <code bash> | ||
# pass PHP scripts to FastCGI server | # pass PHP scripts to FastCGI server | ||
Line 186: | Line 186: | ||
} | } | ||
</ | </ | ||
- | * Enable | + | * Activate |
<code bash> | <code bash> | ||
# deny access to .htaccess files, if Apache' | # deny access to .htaccess files, if Apache' | ||
Line 195: | Line 195: | ||
} | } | ||
</ | </ | ||
- | * Reload the **Nginx** web server's configuration | + | * Reload the configuration of the Nginx web server |
<code bash> | <code bash> | ||
sudo systemctl reload nginx.service | sudo systemctl reload nginx.service | ||
Line 209: | Line 209: | ||
?> | ?> | ||
</ | </ | ||
- | * Navigate to http:// | + | * Navigate to http:// |
----------- | ----------- | ||
==== Install MariaDB ==== | ==== Install MariaDB ==== | ||
=== Why MariaDB? === | === Why MariaDB? === | ||
- | * We discovered | + | * We have found that the version of MySQL that is delivered |
- | * For this reason we install | + | * For this reason, we have installed |
- | * MariaDB is an open-source relational database management system, commonly | + | * MariaDB is an open-source relational database management system |
- | * It is intended | + | * It is intended |
- | * Be sure to supply | + | * Make sure to provide |
<code bash> | <code bash> | ||
sudo apt-get -y install mariadb-server php8.1-mysql | sudo apt-get -y install mariadb-server php8.1-mysql | ||
Line 227: | Line 227: | ||
=== Disable strict mode === | === Disable strict mode === | ||
- | * With Ubuntu 22.04, the bundled | + | * With Ubuntu 22.04, the bundled |
- | * We will disable | + | * We will disable |
<code bash> | <code bash> | ||
sudo vi / | sudo vi / | ||
Line 276: | Line 276: | ||
==== Install RADIUSdesk | ==== Install RADIUSdesk | ||
- | * The first part prepared | + | * In the first part, everything |
- | * This part will go through | + | * This part explains |
* 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. | ||
Line 295: | Line 295: | ||
sudo git clone https:// | sudo git clone https:// | ||
</ | </ | ||
- | * This will create an **rdcore** directory | + | * This will create an **rdcore** directory |
+ | * It is recommended that you also include the RD Mobile UI. | ||
+ | * Check out the **rd_mobile** git repository. | ||
+ | <code bash> | ||
+ | cd /var/www | ||
+ | sudo git clone https:// | ||
+ | </ | ||
- | === Create | + | === Create |
- | * We will create | + | * We will create |
<code bash> | <code bash> | ||
cd / | cd / | ||
Line 308: | Line 314: | ||
sudo ln -s ../ | sudo ln -s ../ | ||
sudo ln -s ../ | sudo ln -s ../ | ||
+ | #For the RD Mobile UI | ||
+ | sudo ln -s ../ | ||
</ | </ | ||
- | === Change | + | === Change |
* Change the ownership of the following files to www-data so Nginx can make changes to the files/ | * Change the ownership of the following files to www-data so Nginx can make changes to the files/ | ||
<code bash> | <code bash> | ||
Line 327: | Line 335: | ||
=== The Database === | === The Database === | ||
- | * Make sure the timezone | + | * Make sure that the time zone on the server is set to UTC |
- | * Populate | + | * Fill the time zone data in the DB |
<code bash> | <code bash> | ||
#NOTE FAILING THIS STEP will break the RADIUS graphs | #NOTE FAILING THIS STEP will break the RADIUS graphs | ||
Line 349: | Line 357: | ||
sudo mysql -u root rd < / | sudo mysql -u root rd < / | ||
</ | </ | ||
+ | <WRAP center round important 100%> | ||
+ | * RADIUSdesk is under active development and sometimes we add SQL patches. | ||
+ | * The SQL patches are located at **/ | ||
+ | * These patches are non-destructive and you can run them against the database | ||
+ | * See the sample below | ||
+ | <code bash> | ||
+ | sudo mysql -u root rd < / | ||
+ | </ | ||
+ | </ | ||
+ | |||
=== Configure Nginx === | === Configure Nginx === | ||
Line 396: | Line 414: | ||
sudo cp -R / | sudo cp -R / | ||
</ | </ | ||
+ | * To load the RD Mobile UI, go to http:// | ||
== Login Credentials == | == Login Credentials == | ||
Line 403: | Line 422: | ||
----- | ----- | ||
- | ===== Cron Scripts | + | ===== Cron scripts |
- | * **RADIUSdesk** requires | + | * **RADIUSdesk** requires |
- | * 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 adds the **RADIUSdesk** |
<code bash> | <code bash> | ||
sudo cp / | sudo cp / | ||
</ | </ | ||
- | * If you want to change the default intervals at which the scripts | + | * If you want to change the default intervals at which the scripts |
===== Add LETSENCRYPT certificate ===== | ===== Add LETSENCRYPT certificate ===== | ||
- | * Rather than repeating existing documentation we will just add a URL with the instructions | + | * Instead of repeating |
- | * You might want to run the following first before | + | * You may want to do the following first before |
<code bash> | <code bash> |