This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:20_install_ubuntu_nginx [2021/01/17 17:14] – [Viewer component] admin | getting_started:20_install_ubuntu_nginx [2022/01/14 13:09] (current) – [Install RADIUSdesk] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Installing RADIUSdesk on Ubuntu | + | ====== Installing RADIUSdesk on Ubuntu |
+ | ===== Skills Required to Install ===== | ||
+ | |||
+ | To install RADIUSdesk you need sufficient knowledge and experience on Linux to: | ||
+ | * Install the Linux operating system | ||
+ | * Edit text files from the terminal using a text editor like **Vi** or **Nano**. | ||
+ | * Install packages from a repository. | ||
+ | * Be comfortable with the working of TCP/IP networking. | ||
===== Background ===== | ===== Background ===== | ||
Line 18: | Line 26: | ||
| Interpret PHP Scripts | | Interpret PHP Scripts | ||
| Be able to have access to the MySQL functions of PHP | Since we set up a LEMP server, we need to have a MySQL server installed and accessible from PHP. | | | Be able to have access to the MySQL functions of PHP | Since we set up a LEMP server, we need to have a MySQL server installed and accessible from PHP. | | ||
- | | Modify the expiry date of http headers to encourage caching | We want files that does not change (e.g. css or images) to be cached on the client' | + | | Modify the expiry date of HTTP headers to encourage caching | We want files that does not change (e.g. CSS or images) to be cached on the client' |
| Compress text before they are served to the client | We can compress the text that flows between the client and the server and in this way reduce the //over the line// bytes which in turn should also give the client a more pleasant experience | | | Compress text before they are served to the client | We can compress the text that flows between the client and the server and in this way reduce the //over the line// bytes which in turn should also give the client a more pleasant experience | | ||
| Enable rewrite rules in CakePHP for pretty URL's | CakePHP makes use of the .htaccess files in Apache to enable pretty URLs. Since Nginx does not support .htaccess files, we need to change Nginx to behave in the same way. | | | Enable rewrite rules in CakePHP for pretty URL's | CakePHP makes use of the .htaccess files in Apache to enable pretty URLs. Since Nginx does not support .htaccess files, we need to change Nginx to behave in the same way. | | ||
Line 35: | Line 43: | ||
</ | </ | ||
- | + | ==== Networking Introduction on Ubuntu | |
- | ==== Networking Introduction on Ubuntu | + | |
* If you do not yet have a working network configuration on the server you plan to do the installation on, please use this section as reference, else just proceed to the next section. | * If you do not yet have a working network configuration on the server you plan to do the installation on, please use this section as reference, else just proceed to the next section. | ||
- | * Since there is such a huge difference between the way of doing things in Ubuntu 16.04 and Ubuntu | + | * Since there is such a huge difference between the way of doing things in Ubuntu 16.04 and Ubuntu |
* For this we assume you have a bare VM (like the ones from https:// | * For this we assume you have a bare VM (like the ones from https:// | ||
- | * 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 the **ifconfig** command. | + | * 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 the **ip a** command. |
* To see which interfaces are available (yet some might just not yet be configured) | * To see which interfaces are available (yet some might just not yet be configured) | ||
<code bash> | <code bash> | ||
Line 102: | Line 109: | ||
< | < | ||
sudo systemctl stop apache2.service | sudo systemctl stop apache2.service | ||
- | sudo apt-get remove apache2 | + | sudo apt-get |
</ | </ | ||
</ | </ | ||
Line 115: | Line 122: | ||
* Ensure the English language pack is installed | * Ensure the English language pack is installed | ||
<code bash> | <code bash> | ||
- | sudo apt-get install language-pack-en-base | + | sudo apt-get |
</ | </ | ||
* Install Nginx | * Install Nginx | ||
<code bash> | <code bash> | ||
- | sudo apt-get install nginx | + | sudo apt-get |
</ | </ | ||
* Ensure the web server starts up and is running | * Ensure the web server starts up and is running | ||
Line 135: | Line 142: | ||
* Install the php-fpm service: | * Install the php-fpm service: | ||
<code bash> | <code bash> | ||
- | sudo apt-get install php-fpm | + | sudo apt-get |
sudo systemctl enable php7.4-fpm | sudo systemctl enable php7.4-fpm | ||
sudo systemctl start php7.4-fpm | sudo systemctl start php7.4-fpm | ||
Line 198: | Line 205: | ||
* Be sure to supply a root password for the MariaDB database when asked for it if you are security conscious else simply hit the ESC key. | * Be sure to supply a root password for the MariaDB database when asked for it if you are security conscious else simply hit the ESC key. | ||
<code bash> | <code bash> | ||
- | sudo apt-get install mariadb-server php-mysql | + | sudo apt-get |
sudo systemctl enable mariadb | sudo systemctl enable mariadb | ||
sudo systemctl restart mariadb | sudo systemctl restart mariadb | ||
sudo systemctl status mariadb | sudo systemctl status mariadb | ||
+ | </ | ||
+ | |||
+ | === Disable strict mode === | ||
+ | * With Ubuntu 20.04, the bundled release of MariaDB is at version 10.3 which introduced a few Strict modes which have some problems with RADIUSdesk database implementation. | ||
+ | * We will disable Strict SQL Mode in MariaDB by creating a new file / | ||
+ | <code bash> | ||
+ | sudo vi / | ||
+ | </ | ||
+ | * Enter these two lines: | ||
+ | <code bash> | ||
+ | [mysqld] | ||
+ | sql_mode=IGNORE_SPACE, | ||
+ | </ | ||
+ | * Save the file and restart the MySQL Server | ||
+ | <code bash> | ||
+ | sudo systemctl restart mariadb | ||
</ | </ | ||
Line 227: | Line 250: | ||
---------- | ---------- | ||
- | ==== Install RADIUSdesk ==== | + | ==== Install RADIUSdesk |
* The first part prepared everything to install **RADIUSdesk**. | * The first part prepared everything to install **RADIUSdesk**. | ||
- | * This part will go through the steps to install the latest RADIUSdesk. | + | * This part will go through the steps to install the latest |
* 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. | * **cake3** is a CakePHPv3 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. Although this is optional, it is used by most installs. | + | * **login** is a directory with various login pages which are centrally managed through the RADIUSdesk **Dynamic Login Pages** applet. |
- | * We will use git to check out the latest version (master) of RADIUSdesk. | + | * Later we will create various symbolic links from locations inside the **rdcore** directory |
=== Required packages === | === Required packages === | ||
* Make sure the following packages are installed: | * Make sure the following packages are installed: | ||
<code bash> | <code bash> | ||
- | sudo apt-get install php-cli php-mysql php-gd php-curl php-xml php-mbstring php-intl git wget | + | sudo apt-get |
+ | sudo systemctl restart php7.4-fpm | ||
</ | </ | ||
- | * Check out the RdCore | + | * Check out the **rdcore** |
<code bash> | <code bash> | ||
cd /var/www | cd /var/www | ||
- | sudo git clone https://blablabla | + | sudo git clone https://github.com/ |
</ | </ | ||
- | * This will create an **rd_code** directory containing some sub-folders. | + | * This will create an **rdcore** directory containing some sub-folders. |
=== Create soft links === | === Create soft links === | ||
Line 252: | Line 276: | ||
<code bash> | <code bash> | ||
cd / | cd / | ||
- | sudo ln -s ../rd_code/rd ./rd | + | sudo ln -s ../rdcore/rd ./rd |
- | sudo ln -s ../rd_code/cake3 ./cake3 | + | sudo ln -s ../rdcore/cake3 ./cake3 |
- | sudo ln -s ../rd_code/login ./login | + | sudo ln -s ../rdcore/login ./login |
+ | sudo ln -s ../ | ||
+ | sudo ln -s ../ | ||
</ | </ | ||
Line 269: | Line 295: | ||
sudo chown -R www-data. / | sudo chown -R www-data. / | ||
sudo chown -R www-data. / | sudo chown -R www-data. / | ||
- | sudo chown -R www-data. / | + | sudo chown -R www-data. / |
sudo chown -R www-data. / | sudo chown -R www-data. / | ||
</ | </ | ||
Line 278: | Line 304: | ||
<code bash> | <code bash> | ||
#NOTE FAILING THIS STEP will break the RADIUS graphs | #NOTE FAILING THIS STEP will break the RADIUS graphs | ||
+ | #There might be some error messages in the output which is fine - no need to be alarmed | ||
sudo su | sudo su | ||
mysql_tzinfo_to_sql / | mysql_tzinfo_to_sql / | ||
Line 295: | Line 322: | ||
sudo mysql -u root rd < / | sudo mysql -u root rd < / | ||
</ | </ | ||
+ | |||
=== Configure Nginx === | === Configure Nginx === | ||
- | | + | |
+ | | ||
* Edit /// | * Edit /// | ||
<code bash> | <code bash> | ||
- | | + | sudo vi / |
+ | </ | ||
+ | * 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. | ||
+ | <code bash> | ||
+ | server_name _; | ||
+ | location / | ||
+ | try_files $uri $uri/ / | ||
+ | } | ||
</ | </ | ||
- | * Add the following | + | * Add the following |
<code bash> | <code bash> | ||
location / | location / | ||
Line 308: | Line 344: | ||
} | } | ||
</ | </ | ||
- | * Reload the Nginx web server: | + | * Reload the Nginx: |
<code bash> | <code bash> | ||
- | sudo systemctl reload nginx.service | + | sudo systemctl reload nginx |
</ | </ | ||
- | ----- | + | === Important URLs === |
+ | * The following URLs are important to reach the UI | ||
+ | * To load the optimized UI, go to http:// | ||
+ | * If you want to serve the content directly out of the webroot, do the following: | ||
+ | <code bash> | ||
+ | sudo cp -R / | ||
+ | </ | ||
+ | == Login Credentials == | ||
+ | * By default you can log in with the following credentials | ||
+ | Username: **root** Password: **admin** | ||
+ | ----- | ||
===== Cron Scripts ===== | ===== Cron Scripts ===== | ||
Line 321: | Line 367: | ||
* To activate the cron scripts execute the following command, which will add **RADIUSdesk**' | * To activate the cron scripts execute the following command, which will add **RADIUSdesk**' | ||
<code bash> | <code bash> | ||
- | sudo cp /usr/share/nginx/html/cake2/rd_cake/Setup/Cron/rd / | + | sudo cp /var/www/html/cake3/rd_cake/setup/cron/cron3 / |
+ | </ | ||
+ | * If you want to change the default intervals at which the scripts get executed, just edit the / | ||
+ | |||
+ | ===== Add LETSENCRYPT certificate ===== | ||
+ | * Rather than repeating existing documentation we will just add a URL with the instructions to do it. | ||
+ | * You might want to run the following first before going to the instructions in the URL | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get update | ||
+ | sudo apt-get -y install software-properties-common | ||
</ | </ | ||
- | * If you want to change the default intervals at which the scripts get executed, just edit the /etc/cron.d/rd file. | + | * https://www.digitalocean.com/ |
===== Next steps ===== | ===== Next steps ===== | ||
- | * Be sure to also install **FreeRADIUS** | + | * Be sure to also install **FreeRADIUS** |
- | * [[Getting Started:18_install_ubuntu_freeradius_3|Install FreeRADIUS]] | + | * [[Getting Started:20_install_ubuntu_freeradius_3|Install FreeRADIUS]] |
- | * [[getting_started: | + |