HGustavs / LenaSYS

Code Viewer and Course Organization System used in some courses at University of Skövde
57 stars 31 forks source link

LenaSYS

University of Skövde Code Viewer and Course Organization System

Install Instructions

Make sure you have a working install of apache2 and other needed packages. Look at the wiki page for this at Configuring web server for LenaSYS installation for further information.

To install a fresh copy of LenaSYS on your system an installer has been created called 'install.php'. This installer is located in the LenaSYS directory. What the installer will do is help you create a new user in the MySQL database and a new database and fill it with some test data (if desired) to help you get started.

1. To start the installation, put the LenaSYS directory at the place you want the system located.

2. When the the directory is in the right place, go to the installer from a web browser of your choosing.

3. Set permissions for Apache.

4. Database credentials used by the system

5. Database credentials for installer

6. Database creation

7. Database overwrite

8. Installation start

9. Installation finished

10. The installer will, after successful creation of database, tell you what to do next.

The installation should now be completed and the website should be linked to the database.

CONGRATULATIONS!

11. Handling possible remaining errors

If LenaSYS is still not functional, possible errors may be found in \apache2\logs. It is very possible that the installer promts you to change upload_max_filesize in ini.php. Make sure that the webserver is restarted after any changes to php.ini. Another issue commonly encountered is ": PHP Fatal error: Uncaught PDOException:could not find driver...". To solve this, enbale the following drivers in the ini.php file by uncommenting them: php_pdo.dll, php_pdo_mysql.dll, php_pdo_odbc.dll and php_pdo_sqlite.dll.

To get ZIP-ARCHIVE to work(used in download zip function)

Push notifications installation

Note: For the push notification system to work the server needs to use https, so make sure that is set up and valid.

To set up https, look at the guide on this wiki page: Getting a free ssl certificate and installing it when not having access to port 80

Note: Only install if there is no other push notifications installation on the system already, if an installation already exists follow the guide further below for instructions for that.

  1. To install the push notification subsystem first the following packages needs to be installed. The following commands assume the system is using php version 7.0. If you use another version, change all the 7.0 in the command below to the php version on your system and run the following command:
sudo apt-get install php7.0-curl php7.0-gmp php7.0-mbstring
  1. Install composer in your LenaSYS folder ( https://getcomposer.org/ )

  2. Go into the LenaSYS folder run the following command. This command will download all the packages listed in the 'composer.json' file and download them to the 'vendor/' folder.

php composer.phar install
  1. Now open the 'coursesyspw.php' file created earlier during the initial installation of LenaSYS. The following settings need to be added in the bottom part of the file:
define("PUSH_NOTIFICATIONS_VAPID_PUBLIC_KEY", "Insert your public key here");
define("PUSH_NOTIFICATIONS_VAPID_PRIVATE_KEY", "Insert your private key here");
define("PUSH_NOTIFICATIONS_VAPID_EMAIL", "Insert your email address here");

If you do not have a private and public key already, you can use the tool at /DuggaSys/pushnotifications.php?action=genkeys to generate keys locally for usage. You need to be logged in as an administrator in LenaSys to use the tool. These keys should be shared to every installation on the same server.

Copying a push notifications installation if it was already installed before

If another installation of LenaSys has push notification installed it is much simpler to copy that.

  1. Find another installation of LenaSys with push notifications installed. In the following steps we will assume an installation exists at /[groupname]/[username]/LenaSYS

  2. Copy the folder vendor/ from /[groupname]/[username]/LenaSYS to /[groupname]/[YOURusername]/LenaSYS

  3. Open the file /[groupname]/[username]/coursesyspw.php and locate the rows containing code like this

define("PUSH_NOTIFICATIONS_VAPID_PUBLIC_KEY", "Insert your public key here");
define("PUSH_NOTIFICATIONS_VAPID_PRIVATE_KEY", "Insert your private key here");
define("PUSH_NOTIFICATIONS_VAPID_EMAIL", "Insert your email address here");
  1. Copy that code from that file into /[groupname]/[YOURusername]/LenaSYS/coursesyspw.php