NTER Installation Instructions

1. Overview The following instructions describe how to completely build out an entire NTER software stack onto a single server virtual machine running TurnKey Core/Ubuntu Server 10.04 on VMWare Fusion 3.1. Although VMWare Fusion is the Mac OS X-specific version of VMWare, the instructions should be same, if not, then very similar to installing on VMWare Workstation on Windows. Of course, it is also possible to install TurnKey Core on other virtual machine technologies such as VirtualBox or Xen if needed, but these instructions will not address those. In order to correctly configure the virtual machine, especially with regards to single sign-on and Shibboleth, it's best to use a real domain name if possible. Since the NTER project recently acquired the nterlearning.org domain name, it is recommended that NTER developers will simply use their first initial and last name as a sub-domain (i.e. kwingerden.nterlearning.org).

2. Creating a VMWare Virtual Machine 1. The first thing you need is the latest version of the TurnKey Core Linux ISO. You can download it from here. 2. In VMWare Fusions, create a new virtual machine: File → New 3. On the Create New Virtual Machine panel, select the “Use operating system installation disc image file” option. 4. In the Finder, choose the TurnKey Core ISO file (i.e. turnkey-core-11.1-lucid-x86.iso) downloaded in step 1 and then press the “Choose” button followed by the “Continue” button. 5. On the Choose Operating System panel, select “Linux” for the “Operating System”, select “Ubuntu” for the “Version” (note: do not choose the 64-bit version), and press the “Continue” button. 6. On the Finish panel, press the “Customize Settings” button. 7. In the Save As dialog, specify the virtual machine directory and file name and then press the "Save" button. (Tip: use the domain name for the file name of the VM. For example, kwingerden.nterlearning.org). 8. Update VM settings 8.1. On the Settings screen under the System Settings panel: a) Disable “Sharing” b) Leave “Applications” disabled c) Leave “Processors & RAM” set to the defaults. However, if you have the resources, then for the best results use 2+ CPUs and 2048+ MBs of RAM. d) Leave “Display” disabled e) Leave “Printers” disabled. If not disabled, then remove “Printers” • Press the “Printers” button • Uncheck the “Enabled” check box • Return to the main screen by pressing the “Show All” button f) Leave “Auto Protect” disabled g) Leave the “Advanced” options set to the defaults 8.2. On the Settings screen under the Removable Devices panel a) Update the “Network” settings • Press the "Network" button • Leave the "Connected" check box selected • Leave the "Share the Mac's network connection (NAT)" selected • Expand the “Advanced” options label and press the "Generate" button to generate a MAC address. Note the MAC address for future reference. b) Leave the “Hard Disks” set to the defaults c) Leave "CDs & DVDs" set to the defaults d) Update the “Sound” settings • Press the "Sound" button • Press the "Remove Sound Device" button • In the popup dialog, press the "Remove" button to confirm removal • Press the "Show All" button to return to the main screen e) Update the USB settings • Press the "USB Devices" button • Press the "Remove USB Controller" button • In the popup dialog, press the "Remove" button to confirm removal • Press the "Show All" button to return to the main screen f) Update the other devices • Press the "Other Devices" button • Select the "Serial Port - For printer data" list item • Press the "-" (minus) button to remove the serial port • In the popup dialog, press the "Remove" button to confirm removal • Press the "Show All" button to return to the main screen 8.3. Close the Settings screen

3. IP Address Configuration Although we'll be configuring Ubuntu to use DHCP for automatic network configuration, we can configure VMWare's embedded DHCP server to always allocate the same IP address based on the VM's MAC address. To do this, you will need to perform the following steps:

1. In a terminal, edit the VMWare DHCP configuration file with the following command:

sudo vi "/Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf"

2. Towards the top of the dhcpd.conf you will see a block of configuration that looks like the following:

subnet 172.16.212.0 netmask 255.255.255.0 { range 172.16.212.128 172.16.212.254; option broadcast-address 172.16.212.255; option domain-name-servers 172.16.212.2; option domain-name localdomain; default-lease-time 1800; # default is 30 minutes max-lease-time 7200; # default is 2 hours option routers 172.16.212.2; }

3. Note the subnet and IP address range (in bold). Choose an IP address that is outside of the range, but within the subnet. For example, 172.16.212.100. 4. Append the following to the end of the file using your chosen domain name for the host, the MAC address, and the chosen IP address:

host kwingerden.nterlearning.org { hardware ethernet 00:50:56:26:83:90; fixed-address 172.16.212.100; }

5. In order for the new settings to affect, the VMWare DHCP server needs to be restarted with the following command:

sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart 4. Domain Name Configuration Since the NTER project has obtained the nterlearning.org domain name, sub-domains can be assigned to each developer. With the chosen IP address from step 3.3, coordinate with the nterlearning.org DNS administrators to have a new sub-domain created and associated with the IP address. If obtaining a real nterlearning.org sub-domain is not an option, then you can simply add an entry, like the following, to your system's hosts file: kwingerden.nterlearning.org 172.16.212.100

To updated the hosts file on a Mac refer to this article. For Windows, refer to this article.

5. Install TurnKey Linux 1. In the VMWare Virtual Machine Library window, select the VM that was just created and press the ">" (start) button to launch the VM 2. When the VM starts, click anywhere within the VM window to grab input focus 3. On the TurnKey Linux startup screen, make sure that "Install to hard disk" is highlighted and press the Enter/Return key 4. For the “Partioning method”: 4.1. Use directional arrow keys to select "Guided - use entire disk" 4.2. Press the Tab key until "Ok" is highlighted 4.3. Press the Enter/Return key 5. For "Write changes to disks?": 5.1. Using directional arrow keys, select "Yes" 5.2. Press the Enter/Return key 6. For "Install the GRUB boot loader tot he master boot record?": 6.1. Using directional arrow keys, select "Yes" 6.2. Press the Enter/Return key 7. For "Would you like to restart now?": 7.1. Using directional arrow keys, select "Yes" 7.2. Press the Enter/Return key 8. On "Root Password" screen 8.1. Enter the password for the root account. If this is a non-public or personal development system, then just use a simple password like "password". 8.2. Press the Tab key to highlight the "OK" button 8.3. Press Enter/Return 9. On "Confirm password" screen 9.1. Enter the password specified for step 8.1 again 9.2. Press the Tab key to highlight the "OK" button 9.3. Press Enter/Return 10. On the "Link TKLBAM to the TurnKey Hub" screen 10.1. Press the Tab key until the "Skip" button is highlighted 10.2. Press Enter/Return 11. On the "Security updates" screen 11.1. Press the Tab key until the "Install" button is highlighted 11.2. Press Enter/Return 11.3. Updates will be downloaded and applied. This may take a while. 11.4. Once the updates have been applied, the "TurnKey Linux Configuration Console" will be displayed in the terminal. This screen displays the assigned IP address along with the name of the server. Make sure that the displayed IP address is the same as the IP address chosen for step 3.3. 6. Initial System Configuration 1. Secure shell as the root user into the VM with your nterlearning.org domain name:

ssh [email protected]

2. You will be prompted for the root password. Enter the password chosen during step 8.1. Note that if this is the first time you have secure shelled into this VM, you will also be prompted as to whether or not you would like to connect (responses in bold):

The authenticity of host 'kwingerden.nterlearning.org (172.16.212.100)' can't be established. RSA key fingerprint is 1c:ba:23:65:c2:0e:c3:8a:65:dd:d0:9c:fc:fb:e9:bc. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'kwingerden.nterlearning.org,172.16.212.100' (RSA) to the list of known hosts. [email protected]'s password: password

3. Install some pre-requisite software:

root@core ~# apt-get install -y aptitude sudo python-software-properties

4. Create the nter user:

root@core ~# adduser nter Adding user `nter' ... Adding new group `nter' (1001) ... Adding new user `nter' (1000) with group `nter' ... The home directory `/home/nter' already exists. Not copying from `/etc/skel'. Enter new UNIX password: password Retype new UNIX password: password passwd: password updated successfully Changing the user information for nter Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Y

5. Add the nter user to the sudo and adm group:

root@core ~# adduser nter sudo Adding user `nter' to group `sudo' ... Adding user nter to group sudo Done.

root@core ~# adduser nter adm Adding user `nter' to group `adm' ... Adding user nter to group adm Done.

6. Set the host name to name chosen domain name:

root@core ~# vi /etc/hostname

replace “core” with your domain name i.e. “kwingerden.nterlearning.org”

7. Update the hosts file definition for localhost (127.0.0.1):

root@core ~# vi /etc/hosts

127.0.0.1 kwingerden.nterlearning.org kwingerden localhost 8. Reboot the system so all new settings take affect:

root@core ~# shutdown -r now

9. After the system has reboot, login again, but this time as the nter user:

ssh [email protected] [email protected]'s password: password

10. Verify that the nter user has sudo privileges:

nter@kwingerden ~$ sudo ls -la [sudo] password for nter: password total 28 drwxr-xr-x 4 nter nter 4096 Jun 3 21:44 . drwxr-xr-x 3 root root 4096 Jun 3 21:25 .. -rw-r--r-- 1 nter nter 220 Jun 3 21:25 .bash_logout -rw-r--r-- 1 nter nter 2924 Jun 3 21:25 .bashrc drwxr-xr-x 2 nter nter 4096 Jun 3 21:25 .bashrc.d drwx------2 nter nter 4096 Jun 3 21:44 .cache -rw-r--r-- 1 nter nter 0 Jun 3 21:44 .penv -rw-r--r-- 1 nter nter 675 Jun 3 21:25 .profile

11. Install prerequisite libraries and utilities:

nter@kwingerden ~$ sudo aptitude install -y \ curl \ htmldoc \ imagemagick \ libapr1-dev \ libshibsp-dev \ libshibsp-doc \ libtcnative-1 \ mutt \ ntp \ opensaml2-tools \ php5-cli \ php5-curl \ php5-gd \ php5-mysql \ php5-xsl \ s3cmd \ sendmail \ shibboleth-sp2-schemas \ ssl-cert \ wget \ zip

Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initializing package states... Done The following NEW packages will be installed: curl libapr1{a} libapr1-dev libcurl3{a} libdb4.7{a} liblockfile1{a} libtcnative-1 m4{a} make{a} procmail{a} sendmail sendmail-base{a} sendmail-bin{a} sendmail-cf{a} sensible-mda{a} uuid-dev{a} zip The following packages will be upgraded: libuuid1 ntp 2 packages upgraded, 17 newly installed, 0 to remove and 35 not upgraded. Need to get 5400kB of archives. After unpacking 18.4MB will be used. Writing extended state information... Done Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libuuid1 2.17.2-0ubuntu1.10.04.2 [61.8kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main liblockfile1 1.08-3ubuntu1 [19.4kB] Get:3 http://us.archive.ubuntu.com/ubuntu/ lucid/main make 3.81-7ubuntu1 [156kB] Get:4 http://us.archive.ubuntu.com/ubuntu/ lucid/main libcurl3 7.19.7-1ubuntu1 [224kB] … 12. Generate SSH key:

nter@kwingerden ~$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/nter/.ssh/id_rsa): Created directory '/home/nter/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/nter/.ssh/id_rsa. Your public key has been saved in /home/nter/.ssh/id_rsa.pub. The key fingerprint is: 39:5d:86:51:d6:5d:c9:34:1a:63:20:35:6e:13:90:84 [email protected] The key's randomart image is: +--[ RSA 2048]----+ | o+=*+=o++| | E .o++ =oo| | .+o. | | o.o. | | S . | | . | | | | | | | +------+ 13. (Optional) Upload public key from your workstation to allow key-based, no password required login to your VM:

wingerdens-MacBook-Pro:~ wingerden$ scp .ssh/id_rsa.pub [email protected]: [email protected]'s password: password id_rsa.pub 100% 420 0.4KB/s 00:00

wingerdens-MacBook-Pro:~ wingerden$ ssh [email protected] [email protected]'s password: password

nter@kwingerden ~$ cat id_rsa.pub >> .ssh/authorized_keys nter@kwingerden ~$ rm id_rsa.pub 14. Some of the NTER buildout artifacts are stored on Amazon's S3 file service. In order to download these artifacts, the s3cmd utility will need to be configured with credentials (access key and secret key) that allow read-only access to them:

nter@kwingerden ~$ s3cmd --configure Enter new values or accept defaults in brackets with Enter. Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3 Access Key: AKIAJC2IIAKB57TUNW5Q Secret Key: CXkTqZpO8wmFwpSP4m4Ho5PIF//Ayjb9HOzAFib1

Encryption password is used to protect your files from reading by unauthorized persons while in transfer to S3 Encryption password: Path to GPG program [/usr/bin/gpg]:

When using secure HTTPS protocol all communication with Amazon S3 servers is protected from 3rd party eavesdropping. This method is slower than plain HTTP and can't be used if you're behind a proxy Use HTTPS protocol [No]: Yes

New settings: Access Key: AKIAJC2IIAKB57TUNW5Q Secret Key: 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 Encryption password: Path to GPG program: /usr/bin/gpg Use HTTPS protocol: True HTTP Proxy server name: HTTP Proxy server port: 0 Test access with supplied credentials? [Y/n] n Save settings? [y/N] y Configuration saved to '/home/nter/.s3cfg'

15. Execute the following commands to download NTER artifacts needed for the installation:

~$ s3cmd -r --skip-existing get s3://nterlearning.org/buildout ERROR: Skipping ./buildout/: Is a directory ERROR: Skipping ./buildout/apache2/: Is a directory ERROR: Skipping ./buildout/apache2/sites-available/: Is a directory s3://nterlearning.org/buildout/apache2/sites-available/nter -> ./buildout/apache2/sites- available/nter [4 of 20] 821 of 821 100% in 0s 1409.03 B/s done s3://nterlearning.org/buildout/apache2/sites-available/nter-ssl -> ./buildout/apache2/sites- available/nter-ssl [5 of 20] 9891 of 9891 100% in 0s 13.32 kB/s done s3://nterlearning.org/buildout/apache2/workers.properties -> ./buildout/apache2/workers.properties [6 of 20] 516 of 516 100% in 0s 855.15 B/s done … (you can safely ignore the ERRORs reported above)

16. Update the permissions of the some of the downloaded files:

~$ chmod 755 -R ~/buildout/bin ~/buildout/install/*.bin 17. Add symbolic link to nter user's bin directory:

~$ ln -s ~/buildout/bin 7. Installing Oracle's Development Kit 1. Since Oracle's (Sun's) JDK is no longer part of the Ubuntu “multiverse” and is now part of its partner repository, execute the following commands to add the partner repository:

nter@kwingerden ~$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" could not open file '/etc/apt/sources.list' could not open file '/etc/apt/sources.list'

(you can safely ignore the “could not open file” warnings)

2. Update the package manager so that the system is aware of the new repository:

nter@kwingerden ~$ sudo aptitude update Hit http://archive.turnkeylinux.org lucid-security Release.gpg Get:1 http://us.archive.ubuntu.com lucid-security Release.gpg [198B] Hit http://us.archive.ubuntu.com lucid Release.gpg Get:2 http://us.archive.ubuntu.com lucid-updates Release.gpg [198B] Hit http://archive.turnkeylinux.org lucid Release.gpg Get:3 http://archive.canonical.com lucid Release.gpg [198B] … 3. Pre-accept Oracle's license with the following command:

nter@kwingerden ~$ sudo debconf-set-selections << END > sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true > sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true > sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true > END 4. Install the Java Development Kit: nter@kwingerden ~$ sudo aptitude install -y sun-java6-jdk Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initializing package states... Done The following NEW packages will be installed: java-common{a} libltdl7{a} libx11-6{a} libx11-data{a} libxau6{a} libxcb1{a} libxdmcp6{a} odbcinst{a} odbcinst1debian1{a} sun-java6-bin{a} sun-java6-jdk sun-java6-jre{a} unixodbc{a} The following packages are RECOMMENDED but will NOT be installed: gsfonts-x11 libasound2 libnss-mdns liboss-salsa-asound2 libxext6 libxi6 libxtst6 0 packages upgraded, 13 newly installed, 0 to remove and 37 not upgraded. Need to get 58.4MB of archives. After unpacking 173MB will be used. Writing extended state information... Done Get:1 http://archive.canonical.com/ lucid/partner sun-java6-jre 6.24-1build0.10.04.1 [6386kB] Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid/main java-common 0.34 [80.3kB] … 5. Ensure that Java is installed:

nter@kwingerden ~$ java -version java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode) 7. Installing MySQL Database 1. Install both the client and server MySQL packages:

nter@kwingerden ~$ sudo aptitude install -y mysql-client mysql-server could not open file '/etc/apt/sources.list' could not open file '/etc/apt/sources.list'

(you can safely ignore the “could not open file” warnings)

2. When the “Configuring mysql-server-5.1” dialog is displayed, leave the password field empty and press the Enter/Return key. For a development system, leaving the password blank is acceptable and convenient, but a “real” password should be used in a production system. Note, that you will be prompted for a root password three times. Each time, leave the password field empty and press the Enter/Return key.

3. After installation the MySQL database will be running. Connect to as the root user with the following command:

nter@kwingerden ~$ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39 Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 4. At the mysql> prompt, enter the following commands to create the NTER databases:

mysql> create database jasperserver character set utf8; Query OK, 1 row affected (0.00 sec)

mysql> create database juddiv3 character set utf8; Query OK, 1 row affected (0.00 sec)

mysql> create database nter character set utf8; Query OK, 1 row affected (0.00 sec)

mysql> create database nwtp character set utf8; Query OK, 1 row affected (0.00 sec)

mysql> create database sso character set utf8; Query OK, 1 row affected (0.00 sec) 5. Verify that the databases have been created:

mysql> show databases; +------+ | Database | +------+ | information_schema | | jasperserver | | juddiv3 | | mysql | | nter | | nwtp | | sso | +------+ 7 rows in set (0.14 sec) 6. When you are ready, quit the MySQL client:

mysql> quit Bye nter@kwingerden ~$ 8. Installing Apache 1. Install Apache Web Server libraries and utilities:

nter@kwingerden ~$ sudo aptitude install -y \ apache2-mpm-prefork \ libapache2-mod-jk \ libapache2-mod-shib2 \ libapache2-mod-php5

Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initializing package states... Done The following NEW packages will be installed: apache2-mpm-prefork …

2. Enable specific Apache Web Server modules:

nter@kwingerden ~$ sudo a2enmod ssl shib2 rewrite php5 proxy proxy_http jk

Enabling module ssl. See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self- signed certificates. Enabling module shib2. Enabling module rewrite. Enabling module proxy. Considering dependency proxy for proxy_http: Module proxy already enabled Enabling module proxy_http. Run '/etc/init.d/apache2 restart' to activate new configuration!

3. Execute the following commands to position the configuration files within Apache's configuration directories:

~$ sudo cp ~/buildout/apache2/conf.d/mod_jk /etc/apache2/conf.d ~$ sudo cp ~/buildout/apache2/workers.properties /etc/apache2 ~$ sudo cp ~/buildout/apache2/sites-available/nter* /etc/apache2/sites-available ~$ sudo cp ~/buildout/ssl/nterlearning.org.crt /etc/ssl/certs ~$ sudo cp ~/buildout/ssl/nterlearning.org.key /etc/ssl/private ~$ sudo cp ~/buildout/ssl/sf_bundle.crt /etc/ssl/certs

4. Enable the NTER and SSL enabled sites:

nter@kwingerden ~$ sudo a2ensite nter nter-ssl

Enabling site nter. Enabling site nter-ssl. Run '/etc/init.d/apache2 reload' to activate new configuration!

5. Disable default site:

nter@kwingerden ~$ sudo a2dissite default

Site default disabled. Run '/etc/init.d/apache2 reload' to activate new configuration!

6. Edit the nter and nter-ssl host configuration files:

nter@kwingerden ~$ sudo vi /etc/apache2/sites-available/nter*

In both nter site configuration file, change the “www” portion of the ServerName to your subdomain. For example: kwingerden.nterlearning.org

7. Restart Apache:

nter@kwingerden ~$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting ...done. 8. Verify that Apache has started by navigating to the following URL in your browser:

http://kwingerden.nterlearning.org/index.html

You should see the following: It works! This is the default web page for this server. The web server software is running but no content has been added, yet.

9. Installing JasperReport Server 1. Unpack Tomcat distribution:

nter@kwingerden ~$ tar xvfz buildout/install/apache-tomcat-6.0.32.tar.gz

apache-tomcat-6.0.32/bin/catalina.sh apache-tomcat-6.0.32/bin/digest.sh apache-tomcat-6.0.32/bin/setclasspath.sh apache-tomcat-6.0.32/bin/shutdown.sh apache-tomcat-6.0.32/bin/startup.sh apache-tomcat-6.0.32/bin/tool-wrapper.sh apache-tomcat-6.0.32/bin/version.sh apache-tomcat-6.0.32/conf/ ... 2. Rename the tomcat directory:

nter@kwingerden ~$ mv apache-tomcat-6.0.32 jasperserver

3. Update server.xml configuration file:

nter@kwingerden ~$ vi jasperserver/conf/server.xml

3.1. Update the shutdown port:

replace on line 22:

with:

3.2. Update the http port:

replace on line 69:

with:

3.3. Update the AJP port:

replace on line 90:

with:

4. Launch the installer and respond to the prompts as follows:

nter@kwingerden ~$ ./buildout/install/jasperserver-ce-3.7.1-linux-installer.bin

------Welcome to the JasperServer CE 3.7.1 Setup Wizard.

------Please read the following License Agreement. You must accept the terms of this agreement before continuing with the installation.

Press [Enter] to continue : ... Do you accept this license? [y/n]: y

------Installation Directory

Please specify the directory where JasperServer CE 3.7.1 will be installed.

Installation directory: [/home/nter/jasperserver-ce-3.7.1]: /home/nter/jasperserver

------Please select the Tomcat configuration you wish to use

Tomcat installation:

[1] I wish to use the bundled Tomcat [2] I wish to use an existing Tomcat Please choose an option [1] : 2

------Database Installation

Please select which database configuration you wish to use:

[1] I wish to use the bundled MySQL database [2] I wish to use an existing MySQL database Please choose an option [1] : 2

Setup will try to install new databases and will overwrite any existing duplicate. Do you wish you continue? [Y/n]: Y

------Tomcat Directory

Please specify the directory where Tomcat is located.

Tomcat directory: [/home/nter/jasperserver/apache-tomcat]: /home/nter/jasperserver

------Install Sample Data

Would you like to install sample databases and sample reports?

[Y/n]: Y

------Install iReport

The iReport application is a graphical designer for JasperReports. iReport connects to JasperServer to upload and download reports.

Would you like to install iReport?

[Y/n]: Y

------MySQL Information

Please enter your MySQL database information.

MySQL Binary Directory: [/home/nter/jasperserver/mysql/bin]: /usr/bin

Port: [3306]:

IP/Hostname Value Used: 127.0.0.1

------MySQL Credentials

Please enter your MySQL database credentials.

Please enter your database root username:

Username: [nter]: root

Please enter your database root user password:

Password: : Re-enter password: : The following JasperServer database user will be created: jasperdb/password

------Setup is now ready to begin installing JasperServer CE 3.7.1 on your computer.

Do you want to continue? [Y/n]: Y

------Please wait while Setup installs JasperServer CE 3.7.1 on your computer.

Installing 0% ______50% ______100% ########################################Info: Please shut down your and press OK to continue. Press [Enter] to continue : #

------Setup has finished installing JasperServer CE 3.7.1 on your computer.

Register at JasperForge for community support [Y/n]: n

Opt in for JasperServer Heartbeat. Help us build better products by opting in.

By allowing the Heartbeat to collect data, you confirm consent, where relevant, from all individual users in your organization.

For info see: www.jaspersoft.com/heartbeat.

[Y/n]: n

5. Start the JasperReport Server:

nter@kwingerden ~$ ./jasperserver/bin/startup.sh

Using CATALINA_BASE: /home/nter/jasperserver Using CATALINA_HOME: /home/nter/jasperserver Using CATALINA_TMPDIR: /home/nter/jasperserver/temp Using JRE_HOME: /usr Using CLASSPATH: /home/nter/jasperserver/bin/bootstrap.jar 6. In your browser, navigate to https://kwingerden3.nterlearning.org/jasperserver and enter jasperadmin for User ID and Password.

7. (Optional – recommended for production system) Change the Jasper admin user password to something more secure and delete the anonymous and joeuser user.

8. Add the NWTP database data source: 8.1. Make sure that you are on the “Home” page by clicking the Home tab link. 8.2. Right-click on the “Data Sources” folder under the root folder. 8.3. In the pop-up menu select Add Resource → Data Source. 8.4. Select JDBC Data Source and press the Next >> button. 8.5. On the JDBC Data Source page, enter the following information: a)Name: MySQLDataSource b)Label: MySQL Data Source c)Driver: com.mysql.jdbc.Driver d)URL: jdbc:mysql://localhost:3306/nwtp e)User Name: root f)Password: g)Press the “Test connection” button to verify JDBC settings, then press the “Save” button.

9. Using your browser, download the following course_admin Jasper report files to a temporary location: https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/course_admin/Failed+Questions.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/course_admin/Feedback+per+User.jrxml 10. Using your browser, download the following sys_admin Jasper report files to a temporary location: https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/Audit+Log.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/Audit+Object.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/Audit+User.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/Courses+and+Users.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/GeneralCommentsFeedback.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/Users.jrxml https://s3.amazonaws.com/nterlearning.org/buildout/install/reports/sys_admin/WebsiteErrorFeedback.jrxml 11. Add NWTP course_admin and sys_admin report folders: 11.1. Make sure that you are on the “Home” page by clicking the Home tab link. 11.2. Right-click on the “Reports” folder under the root folder and select “Add Folder”. 11.3. In the “New Folder” pop-up, enter “nwtp” for the “Display Name” and press the “Add” button. 11.4. Right-click on the newly created “nwtp” folder and select “Add Folder”. 11.5. In the “New Folder” pop-up, enter “course_admin” for the “Display Name” and press the “Add” button. 11.6. Right-click on the “nwtp” folder again and select “Add Folder”. 11.7. In the “New Folder” pop-up, enter “sys_admin” for the “Display Name” and press the “Add” button.

12. For each of the course_admin and sys_admin report files, perform the following steps: 12.1. Right-click on on the “course_admin” or “sys_admin” folder and select Add Resource → JasperServer Report. 12.2. On the “Report Wizard – Naming” page, enter the following (using the Failed Questions report as an example. Note the “Name” has no spaces and the “Label” does): a) Name: FailedQuestions b) Label: Failed Questions c) Press the “Next” button 12.3. On the “Report Wizard – Main JRXML” page, enter the following: a) Select “From File System” radio button. b) Press the “Browse” button and choose the downloaded report file (i.e. Failed+Questions.jrxml). c) Press the “Next” button. 12.4. On the “Report Wizard – Resources List” page, press the “Next” button. 12.5. On the “Report Wizard – Locate Data Source” page: a)Select “From File Repository” radio button. b)Select “/datasources/MySQLDataSource” from the drop-down. c)Press the “Finish” button. 12.6. On the “Report Wizard – Validation” page, a message should be displayed that states that the report was validated successful. 12.7. Press the “Save” button. 12.8. Under the “Refine” section, select “All types” from the second drop-down and make sure that report is listed under the “Repository” section.

10. Installing NWTP

1. Run the NWTP installer:

nter@kwingerden ~$ java -jar ~/buildout/install/install-nwtp-2.8.0.0-2600.newt2-nwtp-only.jar ~/buildout/install/install-nwtp-2.8.0.0-2600.newt2-nwtp-only.xml

[ Starting automated installation ] Read pack list from xml definition. Try to add to selection [Name: NWTP and Index: 0] Modify pack selection. [ Starting to unpack ] [ Processing package: NWTP (1/1) ] [ Unpacking finished ] [ Automated installation done ] 2. Add nwtp to the Apache web server document root:

nter@kwingerden ~$ sudo ln -s ~/nwtp/nwtp /var/www 3. Edit the .ini file:

nter@kwingerden ~$ sudo vi /etc/php5/apache2/php.ini

Make sure that the following values are set:

memory_limit = 200M post_max_size = 180M upload_max_filesize = 160M max_execution_time = 800 max_input_time = 800 error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED display_errors = On cgi.force_redirect = 0 cgi.fix_pathinfo = 1 .impersonate = 1 default_socket_timeout = 600 sendmail_from = [email protected] session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 3600 session.entropy_file = 4. Make NWTP support directories:

nter@kwingerden ~$ mkdir -p ~/nwtp/bin ~/nwtp/data ~/nwtp/lucene ~/nwtp/uploads

5. Create an empty log file:

nter@kwingerden ~$ touch ~/nwtp/nwtplog.txt 6. Create the Lucene index server configuration file:

nter@kwingerden ~$ vi ~/nwtp/nwtp/Services/WebServices/RPC/lib/ilServer.ini

[Server] IpAddress = 127.0.0.1 Port = 11111 IndexPath = /home/nter/nwtp/lucene LogFile = /home/nter/nwtp/lucene/ilServer.log LogLevel = INFO NumThreads = 1 RamBufferSize = 256

[Client1] ClientId = nwtp NicId = 0 IliasIniPath = /var/www/nwtp/ilias.ini.php 7. Create the Lucene server startup script:

nter@kwingerden ~$ vi ~/nwtp/bin/startup.sh

#!/bin/bash

pushd /home/nter/nwtp/nwtp/Services/WebServices/RPC/lib nohup java -jar ilServer.jar ilServer.ini start & popd 8. Create the Lucene server shutdown script:

nter@kwingerden ~$ vi ~/nwtp/bin/shutdown.sh

#!/bin/bash

pushd /home/nter/nwtp/nwtp/Services/WebServices/RPC/lib java -jar ilServer.jar ilServer.ini stop popd 9. Make the control files executable:

nter@kwingerden ~$ chmod +x ~/nwtp/bin/* 10. Start the Lucene server:

nter@kwingerden ~$ ~/nwtp/bin/startup.sh ~/nwtp/nwtp/Services/WebServices/RPC/lib ~ ~ nohup: appending output to `nohup.out'

(to stop ~/nwtp/bin/shutdown.sh) 11. Adjust the permissions/ownership of the nwtp directories:

nter@kwingerden ~$ sudo chown -R www-data.nter ~/nwtp/data ~/nwtp/lucene ~/nwtp/uploads nwtp/nwtp ~/nwtp/nwtplog.txt nter@kwingerden ~$ sudo chmod -R 775 ~/nwtp 12. Navigate to https://kwingerden.nterlearning.org/nwtp/setup/setup.php in your browser: 12.1. On the “Preliminaries” page, all listed items should be marked as “OK” 12.2. Verify the NWTP version at the bottom of the page: nwtp 2.8.0.0.2600 newt2 20110523 (NTER Setup Version 2 Revision: 22049) 12.3. Press the “Installation” button 12.4. On the “Basic Settings” page a)Data Directory in Webspace: /home/nter/nwtp/nwtp/data b)Data Directory outside Webspace: /home/nter/nwtp/data c)Path to Log File: /home/nter/nwtp/nwtplog.txt d)Leave Disable Logging unchecked e)Time Zone: GMT-8:00 f)ImageMagick Convert Path: /usr/bin/convert g)Path to Zip: /usr/bin/zip h)Path to Unzip: /usr/bin/unzip i)Path to Java: /usr/bin/java j)Path to HTMLdoc: /usr/bin/htmldoc k)Path to mkisofs: /usr/bin/mkisofs l)URL to LaTeX CGI Script: leave blank m)Virus Scanner: None n)Scan Command: leave blank o)Clean Command: leave blank p)Password: password 12.5. Press the “Save” button. Press the “Create New Client...” button 12.6. On the “Database Selection” page, select MySQL 5.0.x or higher for the database type. 12.7. Press the “Save” button 12.8. On the “Create New Client” page, enter the following information: a)Client ID: nwtp b)Database Type: MySQL c)Database Host: localhost d)Database Name: nwtp e)Database User: root f)Database Port: 3306 g)Database Password: leave blank 12.9. Press the “Save” button. Press the “Next” button 12.10. On the “Database” page, leave values set to the defaults and press the “Install Database” button. 12.11. Once the database has been installed, press the “Next” button. 12.12. On the “Languages” page, leave values set to the defaults and press the “Next” button. 12.13. On the “Contact Information” page, enter the following information: a)Name: NTER Admin b)First Name: NTER c)LastName: Admin d)Email: [email protected] e)Leave all other fields blank 12.14. Press the “Save” button. Press the “Next” button. 12.15. On the “Registration” page, select “Skip Registration” 12.16. Press the “Save” button and then the “Finish Setup” button. 12.17. On the “Finishing Setup” button, note the root user name and password and press the “Login” button. 12.18. On the NWTP home page, enter the root user name and password and press the “Sign In” button. 12.19. Make the following changes from the Administration UI: a) Administration -> User Accounts -> root -> Properties • Password: set to secure password • Email: [email protected] • Press the “Save” button b) Administration -> General Settings -> Cron-Jobs • Update Lucene search index: check • Press the “Save” button c) Administration -> General Settings -> Java-Server • Host: check • Port: 11111 • Press the “Save” button • Press the “Status” button and verify that the Status is “Running”. (Note that if the status check failed, then try shutting down and the starting up the Lucene server as indicated by step 10 above). d) Administration -> Mail -> Settings • Mail Subject: [NTER] • no-reply address: [email protected] • Press the “Save” button e) Administration -> Learning Resources -> Edit Settings • Upload directory: /home/nter/nwtp/uploads • Replicate Export to Import Directory: checked • Press the “Save” button b) Administration -> Search -> Settings • Search Type: Lucene search • Press the “Save” button

13. Create the initial Lucene index:

nter@kwingerden ~$ cd ~/nwtp/nwtp/Services/WebServices/RPC/lib nter@kwingerden RPC/lib$ java -jar ilServer.jar ilServer.ini createIndex nwtp_0 14. Update the following PHP files: nter@kwingerden ~$ vi ~/nwtp/nwtp/Modules/Reporting/classes/class.ilObjSysAdminReportsGUI.php

replace on line 197:

$password = "j@sp3r@dm1nS3cr3t";

with:

$password = "jasperadmin";

(note: in production system, this password should be changed to something more secure – step 9.7, but for a development system using the default jasper admin password is sufficient)

nter@kwingerden ~$ vi ~/nwtp/nwtp/Modules/Reporting/scripts/client.php

replace on line 26:

$GLOBALS["jasper_webservices_uri"] = "http://127.0.0.1:8080/jasperserver/services/repository";

with:

$GLOBALS["jasper_webservices_uri"] = "http://127.0.0.1:8502/jasperserver/services/repository";

15. Test the daily NWTP cron script (using the chosen NWTP root password):

nter@kwingerden ~$ php /home/nter/nwtp/nwtp/cron/cron.php root nwtp PHP Notice: Undefined index: REMOTE_ADDR in /home/nter/nwtp/nwtp/cron/cron.php on line 37

(The PHP Notice can be safely ignored) 16. Configure the daily NWTP cron script:

nter@kwingerden ~$ crontab -e

(remove any text in the file. add the following entry, and save the file)

@daily php /home/nter/nwtp/nwtp/cron/cron.php root nwtp