Installing or Migrating XUNO

This article talks about the basic installation and migration process of XUNO on a Windows 2016 server located in a school environment.

Each installation and migration will be different, but should follow these basic installation steps. New schools need only follow the installation guide, however schools migrating to a new server should complete both the Installation and the Migration processes.

Installation guide:

Migration guide:

XUNO server minimum requirements
The new XUNO server must meet the minimum requirements found here. Installation of XUNO on a server that does not meet these requirements will result in problems installing and maintaining the XUNO installation.

XUNO DNS host record
Before the XUNO website will be accessible, the school technician will need to create a DNS record which resolves the host header 'xuno' to the server on which XUNO is to be installed. This should be done after the migration has been completed, and the old server has been shut down.    
To check if the DNS record has been created correctly, run the following command in command prompt:

nslookup xuno

Up-to-date
If you are moving from an old XUNO server to a new one, to ensure the migration will run smoothly and all the required packages install correctly, please make sure your server is running with the latest Windows Updates. 

   

Installing IIS

The following steps will guide you through installing and configuring IIS on the XUNO server.

  1. On the XUNO server, open the Server Manager console.
  2. Navigate to Add roles and features.
  3. Click Next on the Before You Begin page.
  4. Leave Role-based or feature-based installation selected as the installation type and click Next.
  5. Click Next to leave the current server as the destination server.
  6. Find and check Web Server (IIS) from the list of available server roles.
  7. Click on Role Services.
  8. Find and check CGI from the list of Role Services, under Application Development.
  9. Click Next then Install to finalize the installation.
  10.  Tick to restart the server if necessary.

Installing IIS URL Rewrite Module

The following steps will guide you through installing IIS URL Rewrite Module on the XUNO server.

  1. Download the Web Platform Installer.
  2. Click Install this extension to download the Web Platform installer.
  3. Start the installer.
  4. Enter Application Request Routing 3.0 in the search field, and press Enter.
  5. Select Application Request Routing 3.0.
  6. Click Add.
  7. Click Install.
  8. Click I Accept.
  9. Click Finish, and then click Exit to quit the Web Platform Installer.

Installing XUNO on the new Server

The following steps will guide you through installing the XUNO website files. 

  1. Download the XUNO installation file onto the XUNO server.
  2. Run the installation file on the XUNO server and follow the prompts.

    Destination Location
    Do not install XUNO in the default installation located in C:\Inetpub\wwwroot\xuno. Instead, install the XUNO installation folder in a new folder called 'Websites' located in the root path of a local server drive. e.g. C:\Websites\XUNO.

  3. Once the website files are installed, navigate to the 'XUNO' folder in Windows Explorer.
  4. Create the folders: docs, tmp, photos, reports, uploads (if they do not already exist).
  5. Right click on the docs folder and select Properties.
  6. Click on the Security tab.
  7. Click on the Edit button.
  8. Click on the Add button.
  9. Under the 'Enter the object names to select' text box, type IUSR and click 'Check Names'.
  10. Click on the Advanced button.
  11. Click on the Locations button and select the local XUNO server.
  12. Click on the Find Now button.
  13. In the search results, find and select the IIS_IUSRS group.
  14. Click the OK button to return to the 'Select Users or Groups' window.
  15. Click the OK button to return to the 'Permissions for <folder>' window.
  16. Make sure that IUSR and IIS_IUSRS have modify access set.
  17. Click the OK button to return to the '<folder> Properties' window.
  18. Click the OK button to confirm the permission changes and close the '<folder> Properties' window.
  19. Repeat steps 6 to 18 for the following folders: includes\customimages, tmp, uploads, photos, reports and C:\Windows\Temp.
  20. Right click on the secure folder and select Properties.
  21. Click on the Security tab.
  22. Click on the Advanced button.
  23. Check the checkbox which reads Replace all child object permission entries with...
  24. Remove the IUSR and IIS_IUSRS rows (if they exist).
  25. Save your changes.

Configuring the XUNO website in IIS

The following steps will guide you through creating the XUNO website in IIS.

  1. Open the Internet Information Services Manager (in the Windows Administrative Tools folder via the Start Menu).
  2. In the left panel of the IIS Manager, open Sites and delete the default website as it is not being used.
  3. Right-click Sites and select Add Website...
  4. Name the website 'XUNO'.
  5. Set the physical path of the website to the XUNO installation directory e.g. C:\Websites\XUNO.
  6. Set the host name of the website to 'xuno'.
  7. Click the OK button to create the website.
  8. Highlight the XUNO website.
  9. On the right panel, open up HTTP Response Headers > Set Common Headers > Enable HTTP Keep Alive.
  10. On the right panel open up Handler Mappings.
  11. Double click on php-cgi. The name of this file may vary from computer to computer. EG PHP_via_FastCGI. If the php-cgi doesn't show up, please go to next session and install PHP.
  12. Click on Request Restrictions.
  13. Select the Verbs tab.
  14. Choose All Verbs.
  15. Click OK.
  16. Click OK.
  17. If you see an error message reading:
    "The specified executable for the handler must be a .dll or .exe file. If the path to the script processor (only in the case of a .exe. file) has spaces, use double quotation mars to specify the executable." Click OK. Then type double quotes at the start and end of the Executable row. Click OK.

Important! Do not add an empty binding to the XUNO website. The only bindings added should be specific to XUNO.

Installing PHP and SQL Server Drivers for IIS

The following steps will guide you through installing and configuring PHP and SQL Server Drivers on the XUNO server.

  1. Open the Internet Information Services Manager which can be found under Administrative Tools.
  2. Select the IIS server from the navigation panel on the left.
  3. From the actions panel located on the right, select Get New Web Platform Components which will launch the Web Platform Installer.
  4. Select the Products tab.
  5. Search for 'SQL server 5.3 PHP x64' in the search bar and hit Enter (we are looking for the latest PHP version & SQL server drivers that are supported in IIS).
  6. Find the latest version (At the time of writing it is 'Microsoft Drivers 5.3 (x64) for PHP v7.2 for SQL Server in IIS') do not choose x86 or IISExpress versions.
  7. Click Add and then click Install below.
  8. Follow the prompts to install.
  9. Download the latest ssl libraries. 
    1. This may be done by downloading the cacert.pem file from https://curl.haxx.se/docs/caextract.html
  10. Download loaders.
    1. Download the appropriate Windows loadings.zip file from https://www.sourceguardian.com/loaders.html
    2. Unzip the file.
  11. Copy downloaded files into the PHP folder.
    1. Go to the PHP folder via Windows Explorer (C:\Program Files\PHP\v7.2)
    2. Copy the cacert.pem file from step 9a into this folder.
    3. Open the ext folder.
    4. Copy the file ixed7.2win from step 10b into the ext folder. If you are not using PHP 7.2, copy the appropriate file.
  12. Follow the steps found in part 3 from step 12 onwards, of the article How to install or update PHP to configure the php.ini file for the XUNO installation.

You should now be able to test the installation of XUNO by selecting the XUNO website from the IIS navigation panel and then clicking the Browse xuno on *:80 (http) button from the actions panel on the left hand side of the console.

Installing MySQL

The following steps will guide you through installing and configuring MySQL on the XUNO server.

You will need to install Visual C++ Redistributable for Visual Studio 2015 (both x86 and x64) before installing MySQL. You can download that here

  1. Download and run the MySQL installer on the XUNO server.
  2. Open the installer.
  3. Click to accept the license terms.
  4. Choose Custom setup type.
  5. Click on Edit.
  6. Change Age to Other Releases and Architecture to 64-bit.
  7. Click Filter to show options.
  8. Expand MySQL Server/s.
  9. At the moment XUNO supports the latest build of MySQL Server 5.7.x
  10. Now expand Applications and select the latest version of MySQL Workbench (At the time of writing it is MySQL Workbench 8.0.1.2 - x64).
  11. Click Next .
  12. Click Execute to Install the requirements if any.
  13. Click Execute to Install.
  14. Click Next to continue.
  15. Click Next to continue.
  16. Choose Standalone MySQL Server / Classic MySQL Replication.
  17. Choose Config Type: Server Computer.
  18. Click Next to continue.
  19. Choose a complicated MySQL Root password.
  20. Click Next to continue.
  21. Click Next to continue.
  22. Click Next to continue without enabling X Protocol.
  23. Click Execute to Apply Configuration.
  24. Click Next to continue.
  25. Click Finish  complete installation.
  26. Press Windows Key + Pause.
  27. On the left pane, click Advanced system settings.
  28. Click Environment Variables.
  29. Down the bottom in System variables, choose to edit Path.
  30. Click New, and then Browse.
  31. Navigate to the MySQL bin folder (Normally found at C:\Program Files\MySQL\MySQL Server 5.7\bin).
  32. Click Ok to add the folder to Path.
  33. Open up a new command prompt and type 'mysql'.
  34. If you get the message:
    ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
    	

    Then Success! Otherwise try restarting the server.

Optimising the MySQL Database

See MySQL performance and optimisation settings.

Migrating XUNO database to new server (if applicable)

New schools
New schools will not need to do any data migration - this section is only for existing on-premise XUNO schools moving to a new server.

Archiving and backing up XUNO data

Important! Before we go further, you will need to make sure IIS is stopped on the old server. You can do this by opening IIS, clicking on the server and clicking Stop on the right actions panel

In MYSQL Workbench -> Server -> Data Export, select the XUNO database (structure and data) and check "Dump Stored Procedures and Functions". Click on "Start Export".

Once done, zip up the Dumped folder (lets called it xunodb_suite.zip) so that we can copy this zip file across to the new server easily.

Copy data across

    1.  From the old XUNO server, copy the xunodb_suite.zip to the Desktop of the new server.

      The transferring of this ZIP file from the old server to your new server, can take a long time depending on the size of the folders and your network speed. It has taken over 24 hours in the past, so grab a coffee!
    2. Once copied, on the new server extract the xunodb_suite.zip to the path of the XUNO installation. Be sure to click Yes to overwrite any existing files.
    3. Go to the includes > custom folder in the XUNO directory, and open customconfig.inc.php.
    4. Change the old 'password' to the new XUNO Database password.
    5. Change the 'server' value to the address of the new XUNO server, if the old one is listed.
    6. Change the 'database' value to the new XUNO database name. Let's call it xunosuite_db

Import Database

It's time to import the database so we can start using XUNO.

  1. In MYSQL Workbench, create a new database called xunosuite_db.
  2. To prevent timeout issues if the database is large, In MYSQL Workbench -> Edit -> Preferences -> SQL Editor, set DBMS connection read time out to something very large.
  3. In MYSQL workbench -> Server -> Data Import. Select the dumped folder and click "Start Import".
  4. Once import is completed, run the XUNO setup again on the new server. You can download it from here.
  5. Login to XUNO and test that it's working.
  6. Delete all unwanted dumped sql files.
  7. Celebrate! You have completed the migration.

You will now need to make sure all DNS records are pointing to the new server

You will also need to ensure the EduHub sync is pointing to the new XUNO server. Have a look at the instructions here to set up EduHub for the new server.

If necessary, don't forget to set scheduled backups of your XUNO database. Have a look at our article here that talks about setting a scheduled task using our backup template. 

If you are pointing to the old server's mySQL and receive the following error message ' ERROR: Unable to connect to MySQL server! Error: Host 'xxxxxxx' is not allowed to connect to this MySQL server' then run the following SQL query
mysql> CREATE USER 'root'@'new IP address' IDENTIFIED BY 'root_password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'new IP address' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

on the SQL server to grant permission to the new server.