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/02/02 09:15] – [Background] admin | getting_started:20_install_ubuntu_nginx [2022/01/14 13:09] (current) – [Install RADIUSdesk] admin | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== Skills Required to Install ===== | ===== Skills Required to Install ===== | ||
- | To install RADIUSdesk | + | To install RADIUSdesk you need sufficient knowledge and experience on Linux to: |
* Install the Linux operating system | * Install the Linux operating system | ||
* Edit text files from the terminal using a text editor like **Vi** or **Nano**. | * Edit text files from the terminal using a text editor like **Vi** or **Nano**. | ||
* Install packages from a repository. | * Install packages from a repository. | ||
- | * Compile software through the **configure**, | ||
* Be comfortable with the working of TCP/IP networking. | * Be comfortable with the working of TCP/IP networking. | ||
- | |||
===== Background ===== | ===== Background ===== | ||
Line 28: | 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 49: | Line 47: | ||
* Since there is such a huge difference between the way of doing things in Ubuntu 16.04 and Ubuntu 20.04 we felt that adding this section will help those who are getting used to this newer way of doing things. | * Since there is such a huge difference between the way of doing things in Ubuntu 16.04 and Ubuntu 20.04 we felt that adding this section will help those who are getting used to this newer way of doing things. | ||
* 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 111: | Line 109: | ||
< | < | ||
sudo systemctl stop apache2.service | sudo systemctl stop apache2.service | ||
- | sudo apt-get remove apache2 | + | sudo apt-get |
</ | </ | ||
</ | </ | ||
Line 124: | 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 144: | 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 207: | 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 | ||
Line 252: | 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://git.code.sf.net/p/ | + | sudo git clone https://github.com/RADIUSdesk/rdcore.git |
</ | </ | ||
- | * 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 277: | Line 276: | ||
<code bash> | <code bash> | ||
cd / | cd / | ||
- | sudo ln -s ../rd_code/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 294: | 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 321: | Line 322: | ||
sudo mysql -u root rd < / | sudo mysql -u root rd < / | ||
</ | </ | ||
+ | |||
=== Configure Nginx === | === Configure Nginx === | ||
- | | + | |
+ | | ||
* Edit /// | * Edit /// | ||
<code bash> | <code bash> | ||
sudo vi / | sudo vi / | ||
</ | </ | ||
- | * Add the following | + | |
+ | <code bash> | ||
+ | server_name _; | ||
+ | location / | ||
+ | try_files $uri $uri/ / | ||
+ | } | ||
+ | </ | ||
+ | | ||
<code bash> | <code bash> | ||
location / | location / | ||
Line 334: | 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 === | === Important URLs === | ||
* The following URLs are important to reach the UI | * The following URLs are important to reach the UI | ||
- | * To load the standard | + | * To load the optimized |
* If you want to serve the content directly out of the webroot, do the following: | * If you want to serve the content directly out of the webroot, do the following: | ||
<code bash> | <code bash> | ||
- | sudo cp -R / | + | sudo cp -R / |
</ | </ | ||
+ | |||
== Login Credentials == | == Login Credentials == | ||
* By default you can log in with the following credentials | * By default you can log in with the following credentials | ||
Line 358: | Line 369: | ||
sudo cp / | sudo cp / | ||
</ | </ | ||
- | * If you want to change the default intervals at which the scripts get executed, just edit the / | + | * If you want to change the default intervals at which the scripts get executed, just edit the / |
===== Add LETSENCRYPT certificate ===== | ===== Add LETSENCRYPT certificate ===== | ||
Line 366: | Line 377: | ||
<code bash> | <code bash> | ||
sudo apt-get update | sudo apt-get update | ||
- | sudo apt-get install software-properties-common | + | sudo apt-get |
</ | </ | ||
* https:// | * https:// |