This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| getting_started:install_ubuntu_nginx [2016/10/18 16:16] – [Performance tune Nginx] admin | getting_started:install_ubuntu_nginx [2017/07/06 21:17] (current) – [Install RADIUSdesk] admin | ||
|---|---|---|---|
| Line 125: | Line 125: | ||
| * Be sure to supply a root password for the MySQL 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 MySQL database when asked for it if you are security conscious else simply hit the ESC key. | ||
| <code bash> | <code bash> | ||
| - | sudo apt-get install mysql-server | + | sudo apt-get install mysql-server |
| </ | </ | ||
| + | |||
| + | === 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 / | ||
| + | </ | ||
| + | * Enter these two lines: | ||
| + | <code bash> | ||
| + | [mysqld] | ||
| + | sql_mode=IGNORE_SPACE, | ||
| + | </ | ||
| + | * Save the file and restart the MySQL service | ||
| + | < | ||
| + | sudo systemctl restart mysql.service | ||
| + | </ | ||
| + | |||
| ----- | ----- | ||
| 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 ^/ | rewrite ^/ | ||
| rewrite ^/ | rewrite ^/ | ||
| 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. |
| - | * **rd_login_pages** is a directory with various login pages which are centrally managed through the RADIUSdesk **Dynamic | + | * **rd_login** is a directory with various login pages which are centrally managed through the RADIUSdesk **Dynamic |
| - | * We will use SVN (subversion) to either | + | * 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 == | ||
| + | |||
| * Make sure the following packages are installed: | * Make sure the following packages are installed: | ||
| <code bash> | <code bash> | ||
| - | sudo apt-get install | + | sudo apt-get install |
| </ | </ | ||
| - | * Install | + | |
| - | <code bash> | + | == Install |
| - | sudo apt-get install language-pack-af language-pack-fa | + | |
| - | </ | + | * 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.7.8 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 cakephp-2.7.8.tar.gz / | + | sudo cp 2.9.7.tar.gz / |
| cd / | cd / | ||
| - | sudo tar -xzvf cakephp-2.7.8.tar.gz | + | sudo tar -xzvf 2.9.7.tar.gz |
| - | sudo ln -s ./ | + | sudo ln -s ./ |
| </ | </ | ||
| - | * Reload | + | * Reload |
| <code bash> | <code bash> | ||
| - | sudo systemctl reload | + | sudo systemctl reload |
| </ | </ | ||
| - | === Install RADIUSdesk CakePHP Application === | + | == Install |
| * 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 216: | Line 242: | ||
| sudo svn checkout svn:// | sudo svn checkout svn:// | ||
| </ | </ | ||
| - | <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 / | ||
| - | </ | ||
| * Change the following directories to be writable by www-data: | * Change the following directories to be writable by www-data: | ||
| Line 230: | Line 253: | ||
| sudo chown -R www-data. / | sudo chown -R www-data. / | ||
| sudo chown -R www-data. / | sudo chown -R www-data. / | ||
| + | </ | ||
| + | |||
| + | == Install the RADIUSdesk CakePHP v3 Application == | ||
| + | |||
| + | * Check out the cake3 branch from trunk to / | ||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo svn checkout svn:// | ||
| + | </ | ||
| + | |||
| + | * Change the following directories to be writable by www-data: | ||
| + | <code bash> | ||
| + | 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 235: | Line 277: | ||
| * Create the following blank database: | * Create the following blank database: | ||
| <code bash> | <code bash> | ||
| + | sudo su | ||
| mysql -u root | mysql -u root | ||
| create database rd; | create database rd; | ||
| Line 243: | Line 286: | ||
| * Populate the database (trunk): | * Populate the database (trunk): | ||
| <code bash> | <code bash> | ||
| - | mysql -u root rd < / | + | |
| </ | </ | ||
| Line 254: | Line 297: | ||
| </ | </ | ||
| - | | ||
| === 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 /cake2/rd_cake or with /cake3/rd_cake. |
| * Edit /// | * Edit /// | ||
| <code bash> | <code bash> | ||
| Line 267: | Line 309: | ||
| | | ||
| } | } | ||
| + | |||
| + | location / | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| </ | </ | ||
| * Reload the Nginx web server: | * Reload the Nginx web server: | ||
| Line 273: | Line 321: | ||
| </ | </ | ||
| - | === 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:// | ||
| - | * Your browser should show a JSON encrypted string: | ||
| - | <code bash> | ||
| - | {" | ||
| - | </ | ||
| * 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 291: | Line 333: | ||
| </ | </ | ||
| - | + | | |
| - | <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 / | + | |
| - | </ | + | |
| - | + | ||
| - | | + | |
| * Checkout and unzip the GPL version under the / | * Checkout and unzip the GPL version under the / | ||
| <code bash> | <code bash> | ||
| cd / | cd / | ||
| sudo svn checkout svn:// | sudo svn checkout svn:// | ||
| - | sudo mv ext-6-sencha_cmd.tar.gz ./rd | + | sudo mv ext-6-2-sencha_cmd.tar.gz ./rd |
| cd / | cd / | ||
| - | sudo tar -xzvf ext-6-sencha_cmd.tar.gz | + | sudo tar -xzvf ext-6-2-sencha_cmd.tar.gz |
| </ | </ | ||
| * Now try to log in on the following URL with username **root** and password **admin**: http:// | * Now try to log in on the following URL with username **root** and password **admin**: http:// | ||
| - | * Alternatively (also if you do not have Internet Access on the machine use this URL which is a bit slower: http:// | + | * Alternatively |
| --------------------------- | --------------------------- | ||
| Line 313: | 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**' | * To activate the cron scripts execute the following command, which will add **RADIUSdesk**' | ||
| - | * For Apache | ||
| - | <code bash> | ||
| - | sudo cp / | ||
| - | </ | ||
| - | * For Nginx | ||
| <code bash> | <code bash> | ||
| sudo cp / | sudo cp / | ||
| Line 325: | Line 357: | ||
| * Be sure to also install **FreeRADIUS** and **Node.js**, | * Be sure to also install **FreeRADIUS** and **Node.js**, | ||
| * [[Getting Started: | * [[Getting Started: | ||
| - | * [[Getting Started:Install Ubuntu Node.js|Install node.js]] | + | * [[getting_started:install_ubuntu_node_js|Install node.js]] |