This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:18_install_ubuntu_nginx [2019/12/19 11:09] – admin | getting_started:18_install_ubuntu_nginx [2019/12/19 12:27] (current) – [Install RADIUSdesk] admin | ||
---|---|---|---|
Line 95: | Line 95: | ||
</ | </ | ||
+ | * Make sure it is up to date. | ||
+ | <code bash> | ||
+ | # Get the latest package lists | ||
+ | sudo apt-get update | ||
+ | # Update the system to the latest | ||
+ | sudo apt-get upgrade | ||
+ | </ | ||
* Ensure the English language pack is installed | * Ensure the English language pack is installed | ||
<code bash> | <code bash> | ||
Line 129: | Line 136: | ||
<code bash> | <code bash> | ||
sudo apt-get install php-fpm | sudo apt-get install php-fpm | ||
+ | sudo systemctl enable php7.2-fpm | ||
+ | sudo systemctl start php7.2-fpm | ||
</ | </ | ||
Line 149: | Line 158: | ||
include snippets/ | include snippets/ | ||
# | # | ||
- | # # With php7.0-cgi | + | # # With php-fpm (or other unix sockets): |
+ | # ===HEADS-UP We use 7.2 and NOT 7.0 as commented out === | ||
+ | fastcgi_pass unix:/ | ||
+ | # # With php-cgi (or other tcp sockets): | ||
# | # | ||
- | # # With php7.0-fpm: | + | } |
- | fastcgi_pass unix:/ | + | |
- | | + | |
</ | </ | ||
* Enable the hiding of .htaccess files | * Enable the hiding of .htaccess files | ||
Line 185: | Line 195: | ||
<code bash> | <code bash> | ||
sudo apt-get install mysql-server php-mysql | sudo apt-get install mysql-server php-mysql | ||
+ | sudo systemctl enable mysql | ||
</ | </ | ||
=== Disable strict mode === | === Disable strict mode === | ||
- | * With the 16.04 release of MySQL there were some changes to the MySQL configuration which causes problems on the current RADIUSdesk database implementation. | + | * With the 18.04 release of MySQL there were some changes to the MySQL configuration which causes problems on the current RADIUSdesk database implementation. |
* We will disable Strict SQL Mode in MySQL 5.7. | * We will disable Strict SQL Mode in MySQL 5.7. | ||
<code bash> | <code bash> | ||
Line 202: | Line 213: | ||
sudo systemctl restart mysql.service | sudo systemctl restart mysql.service | ||
</ | </ | ||
- | |||
----- | ----- | ||
Line 216: | Line 226: | ||
rewrite ^/ | rewrite ^/ | ||
rewrite ^/ | rewrite ^/ | ||
+ | access_log off; | ||
+ | expires max; | ||
+ | add_header Cache-Control public; | ||
+ | } | ||
+ | |||
+ | location ~ ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
access_log off; | access_log off; | ||
expires max; | expires max; | ||
Line 225: | Line 243: | ||
sudo systemctl reload nginx.service | sudo systemctl reload nginx.service | ||
</ | </ | ||
- | === Compress the text before sending it to client === | ||
- | * Edit the main config file of **Nginx**. | ||
- | <code bash> | ||
- | sudo vi / | ||
- | </ | ||
- | * Change the compression section to contain the following: | ||
- | < | ||
- | gzip on; | ||
- | gzip_disable " | ||
- | |||
- | gzip_vary on; | ||
- | gzip_proxied any; | ||
- | gzip_comp_level 6; | ||
- | gzip_buffers 16 8k; | ||
- | gzip_http_version 1.1; | ||
- | gzip_types text/plain text/css application/ | ||
- | |||
- | </ | ||
- | * Restart Nginx | ||
- | <code bash> | ||
- | sudo systemctl restart nginx.service | ||
- | </ | ||
- | |||
---------- | ---------- | ||
Line 255: | Line 250: | ||
* **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. | ||
* **rd_cake** is a CakePHP application and can be considered the engine room. Here the data is processed before being presented by the presentation layer. **(We currently use one CakePHP v2 and one CakePHP v3 application in order to migrate from CakePHP v2 to CakePHP v3)** | * **rd_cake** is a CakePHP application and can be considered the engine room. Here the data is processed before being presented by the presentation layer. **(We currently use one CakePHP v2 and one CakePHP v3 application in order to migrate from CakePHP v2 to CakePHP v3)** | ||
- | * **rd_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. Although this is optional, it is used by most installs. |
* We will use SVN (subversion) to check out the latest version (trunk) of RADIUSdesk. | * We will use SVN (subversion) to check out the latest version (trunk) of RADIUSdesk. | ||
=== Install CakePHP === | === Install CakePHP === | ||
- | <WRAP center round info 100%> | ||
- | * As from December 2016 we started a migration process of migrating from CakePHP v2 to CakePHP v3. | ||
- | * The ORM component of CakePHP v3 is completely new and different which makes the migration fairly involved. | ||
- | * Since the architecture of RADIUSdesk is following modern design principles it allows us to run both CakePHP v2 and CakePHP v3 simultaneously. | ||
- | * We can then do the migration gradually over time. | ||
- | </ | ||
- | |||
== 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-gd php-curl php-xml php-mbstring php-intl | + | sudo apt-get install php-cli |
</ | </ | ||
== Install CakePHP v2 == | == Install CakePHP v2 == | ||
- | * Download the 2.x version of CakePHP (Version 2.9.7 as of this writing). https:// | + | * Download the 2.x version of CakePHP (Version 2.10.19 as of this writing). https:// |
* There are two formats to choose from when selecting to download, Zip or Tar.gz. Select Tar.gz. | * There are two formats to choose from when selecting to download, Zip or Tar.gz. Select Tar.gz. | ||
* Copy and extract it inside the directory that Nginx is serving its content from (/ | * Copy and extract it inside the directory that Nginx is serving its content from (/ | ||
<code bash> | <code bash> | ||
- | sudo cp 2.9.7.tar.gz / | + | sudo cp 2.10.19.tar.gz / |
cd / | cd / | ||
- | sudo tar -xzvf 2.9.7.tar.gz | + | sudo tar -xzvf 2.10.19.tar.gz |
- | sudo ln -s ./ | + | sudo ln -s ./ |
</ | </ | ||
- | * Reload php7.0-fpm | + | * Reload php7.2-fpm |
<code bash> | <code bash> | ||
- | sudo systemctl reload php7.0-fpm.service | + | sudo systemctl reload php7.2-fpm.service |
</ | </ | ||
Line 347: | Line 335: | ||
sudo mysql -u root rd < / | sudo mysql -u root rd < / | ||
</ | </ | ||
- | |||
- | <WRAP center round tip 80%> | ||
- | * If you have a small server like a Raspberry Pi you, run the following SQL for better performance. | ||
- | <code sql> | ||
- | use rd; | ||
- | delete from phrase_values where language_id=16 OR language_id=15 or language_id=13 or language_id=5 or language_id=14; | ||
- | </ | ||
- | </ | ||
- | |||
=== Configure Nginx === | === Configure Nginx === | ||
* Since CakePHP uses rewrite rules, we have to configure Nginx in such a way as to allow rewriting of the URL's that starts with / | * Since CakePHP uses rewrite rules, we have to configure Nginx in such a way as to allow rewriting of the URL's that starts with / | ||
Line 415: | Line 394: | ||
===== Next steps ===== | ===== Next steps ===== | ||
* Be sure to also install **FreeRADIUS** and **Node.js**, | * Be sure to also install **FreeRADIUS** and **Node.js**, | ||
- | * [[Getting Started:install_ubuntu_freeradius_3|Install FreeRADIUS]] | + | * [[Getting Started:18_install_ubuntu_freeradius_3|Install FreeRADIUS]] |
- | * [[getting_started: | + | * [[getting_started: |