RADIUSdesk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:install_ubuntu_nginx [2016/10/18 16:59] – [Install MySQL] admingetting_started:install_ubuntu_nginx [2017/07/06 21:17] (current) – [Install RADIUSdesk] admin
Line 127: Line 127:
 sudo apt-get install mysql-server php-mysql sudo apt-get install mysql-server php-mysql
 </code> </code>
 +
 +=== 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.
 +  * We will disable Strict SQL Mode in MySQL 5.7.
 +<code bash>
 +sudo vi /etc/mysql/conf.d/disable_strict_mode.cnf
 +</code> 
 +  * Enter these two lines:
 +<code bash>
 +[mysqld]
 +sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
 +</code>
 +  * Save the file and restart the MySQL service
 +<code>
 +sudo systemctl restart mysql.service
 +</code>
 +
  
 ----- -----
Line 137: Line 154:
   * Add the following inside the server section:   * Add the following inside the server section:
 <code bash> <code bash>
-location ~^.+\.(jpg|jpeg|gif|png|ico|js|css)$ {+location ~ ^/cake2/.+\.(jpg|jpeg|gif|png|ico|js|css)$ {
     rewrite ^/cake2/rd_cake/webroot/(.*)$ /cake2/rd_cake/webroot/$1 break;     rewrite ^/cake2/rd_cake/webroot/(.*)$ /cake2/rd_cake/webroot/$1 break;
     rewrite ^/cake2/rd_cake/(.*)$ /cake2/rd_cake/webroot/$1 break;     rewrite ^/cake2/rd_cake/(.*)$ /cake2/rd_cake/webroot/$1 break;
Line 178: Line 195:
   * 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.
-    * **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.+    * **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.     * **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.
  
Line 184: Line 201:
  
 === 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.
 +</WRAP>
 +
 +== 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+sudo apt-get install php-cli php-gd php-curl php-xml php-mbstring php-intl
 </code> </code>
-  * Download the 2.x version of CakePHP (Version 29.as of this writing). https://github.com/cakephp/cakephp/tags+ 
 +== Install CakePHP v2 == 
 + 
 +  * Download the 2.x version of CakePHP (Version 2.9.as of this writing). https://github.com/cakephp/cakephp/tags
   * 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 (/usr/share/nginx/html)   * Copy and extract it inside the directory that Nginx is serving its content from (/usr/share/nginx/html)
 <code bash> <code bash>
-sudo cp 2.9.1.tar.gz /usr/share/nginx/html+sudo cp 2.9.7.tar.gz /usr/share/nginx/html
 cd /usr/share/nginx/html cd /usr/share/nginx/html
-sudo tar -xzvf 2.9.1.tar.gz  +sudo tar -xzvf 2.9.7.tar.gz  
-sudo ln -s ./cakephp-2.9../cake2+sudo ln -s ./cakephp-2.9../cake2
 </code> </code>
   * Reload php7.0-fpm   * Reload php7.0-fpm
Line 202: Line 231:
 </code> </code>
  
-=== Install RADIUSdesk CakePHP Application ===+== Install the RADIUSdesk CakePHP v2 Application == 
   * Install subversion in order for you to check out the latest source for RADIUSdesk.   * Install subversion in order for you to check out the latest source for RADIUSdesk.
 <code bash> <code bash>
Line 223: Line 253:
 sudo chown -R www-data. /usr/share/nginx/html/cake2/rd_cake/webroot/img/dynamic_photos sudo chown -R www-data. /usr/share/nginx/html/cake2/rd_cake/webroot/img/dynamic_photos
 sudo chown -R www-data. /usr/share/nginx/html/cake2/rd_cake/webroot/files/imagecache sudo chown -R www-data. /usr/share/nginx/html/cake2/rd_cake/webroot/files/imagecache
 +</code>
 +
 +== Install the RADIUSdesk CakePHP v3 Application ==
 +
 +  * Check out the cake3 branch from trunk to /usr/share/nginx/html.
 +<code bash>
 +cd /usr/share/nginx/html/
 +sudo svn checkout svn://dvdwalt@svn.code.sf.net/p/radiusdesk/code/trunk/cake3 ./cake3
 +</code>
 +
 +  * Change the following directories to be writable by www-data:
 +<code bash>
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/tmp
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/logs
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/webroot/img/realms
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/webroot/img/dynamic_details
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/webroot/img/dynamic_photos
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/webroot/img/access_providers
 +sudo chown -R www-data. /usr/share/nginx/html/cake3/rd_cake/webroot/files/imagecache
 </code> </code>
  
Line 237: Line 286:
   * Populate the database (trunk):   * Populate the database (trunk):
 <code bash> <code bash>
-    mysql -u root rd < /usr/share/nginx/html/cake2/rd_cake/Setup/Db/rd.sql+    sudo mysql -u root rd < /usr/share/nginx/html/cake3/rd_cake/setup/db/rd.sql
 </code> </code>
  
Line 249: Line 298:
  
 === 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 /cake2/rd_cake.+  * 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 /cake2/rd_cake or with /cake3/rd_cake.
   * Edit ///etc/nginx/sites-enabled/default//   * Edit ///etc/nginx/sites-enabled/default//
 <code bash> <code bash>
Line 260: Line 309:
      try_files $uri $uri/ /cake2/rd_cake/webroot/index.php?q=$uri&$args;      try_files $uri $uri/ /cake2/rd_cake/webroot/index.php?q=$uri&$args;
 } }
 +
 +location /cake3/rd_cake {
 +   rewrite ^/cake3/rd_cake(.+)$ /cake3/rd_cake/webroot$1 break;
 +   try_files $uri $uri/ /cake3/rd_cake/index.php$is_args$args;
 +}
 +
 </code> </code>
   * Reload the Nginx web server:   * Reload the Nginx web server:
Line 266: Line 321:
 </code> </code>
  
-=== Test things out === 
-  * RADIUSdesk supports multiple languages which are sourced during loading. To confirm that the CakePHP application is working as intended, go to this URL: 
-    http://127.0.0.1/cake2/rd_cake/phrase_values/get_language_strings.json?_dc=1355816922405&language= 
-  * Your browser should show a JSON encrypted string: 
-<code bash> 
-    {"data":{"phrases":{"spclCountry":"United Kingdom","spclLanguage":"English","sUsername":"......,"success":true} 
-</code> 
   * Congratulations you are almost there. Next we will install the viewer component   * Congratulations you are almost there. Next we will install the viewer component
 +
  
 ----- -----
Line 284: Line 333:
 </code> </code>
  
- +  * For the viewer component you need the ExtJS toolkit. We've added version 6.2.0 to the SVN repository for easy download :-)
-<WRAP center round tip 60%> +
-If you are following the development of RADIUSdesk and want to make sure you have the latest SVN you can simply cd to /usr/share/nginx/html/rd and run **svn update** to fetch the latest changes. +
-</WRAP> +
- +
-  * For the viewer component you need the ExtJS toolkit. We've added version 6 to the SVN repository for easy download :-)+
   * Checkout and unzip the GPL version under the /usr/share/nginx/html/rd directory. <wrap hi>**NOTE**: This is a single big file which will take some time to download over slow connections.</wrap>   * Checkout and unzip the GPL version under the /usr/share/nginx/html/rd directory. <wrap hi>**NOTE**: This is a single big file which will take some time to download over slow connections.</wrap>
 <code bash> <code bash>
 cd /usr/share/nginx/html/ cd /usr/share/nginx/html/
 sudo svn checkout svn://svn.code.sf.net/p/radiusdesk/code/extjs ./ sudo svn checkout svn://svn.code.sf.net/p/radiusdesk/code/extjs ./
-sudo mv  ext-6-sencha_cmd.tar.gz ./rd+sudo mv  ext-6-2-sencha_cmd.tar.gz ./rd
 cd /usr/share/nginx/html/rd cd /usr/share/nginx/html/rd
-sudo tar -xzvf ext-6-sencha_cmd.tar.gz+sudo tar -xzvf ext-6-2-sencha_cmd.tar.gz
 </code> </code>
   * Now try to log in on the following URL with username **root** and password **admin**: http://127.0.0.1/rd/build/production/Rd/index.html   * Now try to log in on the following URL with username **root** and password **admin**: http://127.0.0.1/rd/build/production/Rd/index.html
-  * Alternatively (also if you do not have Internet Access on the machine use this URL which is a bit slower: http://127.0.0.1/rd/index.html?cache+  * Alternatively //(also if you do not have Internet Access on the machine)// use this URL which is a bit slower: http://127.0.0.1/rd/index.html?cache
  
 --------------------------- ---------------------------
Line 306: Line 350:
   * **RADIUSdesk** requires a few scripts to run periodically in order to maintain a healthy and working system.   * **RADIUSdesk** requires a few scripts to run periodically in order to maintain a healthy and working system.
   * 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 will add **RADIUSdesk**'s crons scripts to the Cron system
-  * For Apache 
-<code bash> 
-sudo cp /var/www/cake2/rd_cake/Setup/Cron/rd /etc/cron.d/ 
-</code> 
-  * For Nginx 
 <code bash> <code bash>
 sudo cp /usr/share/nginx/html/cake2/rd_cake/Setup/Cron/rd /etc/cron.d/ sudo cp /usr/share/nginx/html/cake2/rd_cake/Setup/Cron/rd /etc/cron.d/
Line 318: Line 357:
   * 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:install_ubuntu_freeradius_3|Install FreeRADIUS]]
-  * [[Getting Started:Install Ubuntu Node.js|Install node.js]]+  * [[getting_started:install_ubuntu_node_js|Install node.js]]