GATE is an e-assessment system specifically designed to support programming education.
This system is able to help with the process of exercise management and assessment for large programming classes at university level. The implemented system can be configured to allow for self-assessments of students and can check solutions submitted by studens for plagiarism.
Please read the whole procedure in advance to executing it.
- Install Java (17 is recommended, 21 also works)
- On *nix (such as Debian) use the
openjdk-17-jre-headlesspackage - On Windows you can use Liberica OpenJDK 17
- On *nix (such as Debian) use the
- Install Apache Tomcat 10.1 (e.g., on Debian-based systems use the
tomcat10package)- After installation Tomcat usually listens on locahost:8080
- For development it is recommended to download the binary archive and integrate Tomcat into the used IDE, e.g. into Eclipse.
- Install MariaDB
- For a development machine on Windows XAMPP is recommended which comes with phpMyAdmin a nice administration interface for MariaDB
- For development Eclipse (IDE for Enterprise Java Developers) >= 2022-09 is recommended
- It may be necessary to build GATE once using the Maven compile goal to ensure that all required dependencies are available locally (in particular, hibernate-jpamodelgen).
- For production use, it is recommended to run Apache Tomcat behind Apache httpd, connecting Tomcat using mod_proxy_ajp, terminate SSL/TLS in httpd and probably use Shibboleth for Single-Sign on.
- Configure the VHost with mod_proxy_ajp:
ProxyPreserveHost On ProxyStatus On ProxyPass / ajp://localhost:8009/ secret=SECRET- Make sure Tomcat is not accessible directly (e.g., ports 8080, 8009, 8443); e.g. make port
8009listen on::1only and comment all otherConnectors inserver.xml. - Clustering is possible (needs in
Server/Engine[@jvmRoute]to be configured inserver.xmlasjvm1orjvm2):<Proxy "balancer://mycluster"> BalancerMember ajp://srv1:8009 secret=SECRET route=jvm1 BalancerMember ajp://srv2:8009 secret=SECRET route=jvm2 ProxySet lbmethod=byrequests stickysession=JSESSIONID </Proxy> ProxyPass "/" "balancer://mycluster/"
- Make sure Tomcat is not accessible directly (e.g., ports 8080, 8009, 8443); e.g. make port
- How to configure Shibboleth:
- Install shibd and configure it (cf. https://www.switch.ch/aai/guides/sp/installation-2.5/), make sure the
ApplicationDefaultconfiguration inshibboleth2.xmlcontainsattributePrefix="AJP_"(cf. https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPJavaInstall; please also make sure theAJPconnector in Tomcatserver.xmldoes not block the Shibboleth request attributes, e.g. by settingallowedRequestAttributesPattern=".*"or more restrictive"^(Shib-.*|givenName|eppn|sn|mail|persistent-id)$"), has a large enough proxys packet size (packetSize="65536"), andeppnis set for theREMOTE_USERinshibboleth2.xml(should matchuserAttribute, see below); also make sure/Shibboleth.sso/Logoutcan be used for logout (cf.src/main/java/de/tuclausthal/submissioninterface/servlets/controller/Logout.java) - Enable Shibboleth protection for the
Overviewservlet:ProxyPass /Shibboleth.sso/ ! ProxyPass /Shibboleth/ ! ProxyPass /shibboleth-sp/ ! <Location /gate/servlets/Overview> AuthType shibboleth ShibRequireSession On require valid-user </Location> ProxyIOBufferSize 65536 - For debugging: Please not that the Shibboleth attributes passed to Tomcat don't show up when iterating over the request variables. They need to be explicitly named (e.g.,
uidorShib-Identity-Provider).
- Install shibd and configure it (cf. https://www.switch.ch/aai/guides/sp/installation-2.5/), make sure the
- Configure the VHost with mod_proxy_ajp:
- For building the whole package you need maven (also often available as a package on *nix systems)
- For running the cron task regularly with the predefined script
submissiondir/runtests.shyou need thelockfiletool (usually part of theprocmailpackage on *nix systems) - For using Docker-based tests you need to install Docker
- Decide what user and password to use (for production use a dedicated user is recommended)
- Create a new database
- Import
mysql.sql
src/main/resources/hibernate.cfg.xmlfor the database configuration- Set the database name, username and password here
src/main/webapp/WEB-INF/web.xmlfor Tomcat and GATE specific configurations- Adjust the
datapathhere, please make sure that this is accessible by Tomcat (should be read-only), use e.g./srv/gate/orc:\gatehere. Create subdirectories namedlecturesandlogsthat are writable for the tomcat user where the user data and logs are stored.- On *nix the system Tomcat runs as the user
tomcat, so make sure that the user has appropriate permissions, also on Debian-based systems, Tomcat might be sandboxed by systemd. Create a file/etc/systemd/system/tomcat10.service.d/gate.confcontaining:(afterwards, issue[Service] ReadWritePaths=/srv/gate/lectures/systemctl daemon-reloadandsystemctl restart tomcat)
- On *nix the system Tomcat runs as the user
- For development:
- Adjust
logintode.tuclausthal.submissioninterface.authfilter.authentication.login.impl.Form - Adjust
verifytode.tuclausthal.submissioninterface.authfilter.authentication.verify.impl.FakeVerifyto disable any authentication
- Adjust
- For production use:
- Check the other configuration options, especially the mail related ones
- For LDAP authentication set
logintode.tuclausthal.submissioninterface.authfilter.authentication.login.impl.Formandverifytode.tuclausthal.submissioninterface.authfilter.authentication.verify.impl.LDAPVerify, configure LDAP related settings for theAuthenticationFilter(PROVIDER_URL,SECURITY_AUTHENTICATION,SECURITY_PRINCIPAL,matrikelNumberAttribute(optional), anduserAttribute), please also look atsrc/main/java/de/tuclausthal/submissioninterface/authfilter/authentication/verify/impl/LDAPVerify.javawhether special adjustments are needed (e.g. first and last name generation) - For Shibboleth set
logintode.tuclausthal.submissioninterface.authfilter.authentication.login.impl.Shibbolethandverifytode.tuclausthal.submissioninterface.authfilter.authentication.verify.impl.ShibbolethVerify, configure Shibboleth related settings for theAuthenticationFilter(userAttributeand (optional)matrikelNumberAttribute); required fields from the Identity-Provider aresn,givenName,mail, and the configureduserAttribute(usuallyeppn).
- Adjust the
submissiondir/runtests.shfor adjusting the pathssrc/main/webapp/WEB-INF/studiengaenge.txtfor updating the list of study programs that are used for auto completion for the users of GATE
- Clone the repository
- Adjust the config files
- Run
mvn clean verify - The built
.warfile can then be found in thetargetdirectory
Alternatively you can also use GitLab CI/CD functionality and download the built .war file.
- Prepare the
datapathin which the submissions will be stored (see the "Configuration files" section above)- Copy
submissiondir/*andSecurityManager/NoExitSecurityManager.jarto that folder - If you want to use the JPlag plagiarism system, compile JPlag 2.12 into a single .jar (using the maven goal
assembly:assemblyinside thejplagdirectory and copy the final.jar(from the target folder) asjplag.jarinto the root of thedatapath - No files directly inside the data directory should be writable by the tomcat user.
- Copy
- On Windows: Make sure the
JAVA_HOMEenvironment variable is set and points to the JDK directory (e.g.C:\Program Files\BellSoft\LibericaJDK-17\) - Prepare Tomcat
- If you want to have the user names on the Tomcat access log, you can use
%{username}r(as a replacement for%u) for configuring theAccessLogValvepattern, cf. https://tomcat.apache.org/tomcat-10.1-doc/config/valve.html#Access_Log_Valve - Rename the built
.warfile to e.g.gate, because the name is then used to build the URL under which GATE will be accessible using Tomcat - Copy the
.warfile to thewebappsfolder of Tomcat (usually inC:\Program Files\Apache Tomcat 10.1\webappsor/var/lib/tomcat10/webapps/) - New versions of GATE can be easily deployed by just overriding the
.warfile in thewebappsfolder
- If you want to have the user names on the Tomcat access log, you can use
- Create first user with superuser permissions: Execute
util.CreateFirstUserwith parameters:loginname emailaddress firtsname lastname. Alternatively, you can also manually insert a new row into theuserstable. - Set up the cron task that performs regular tasks such as automatically start the plagiarism check in background
- You can use the shipped script
submissiondir/runtests.shwhich should be indatapathand configure/etc/crontab:*/10 * * * * tomcat /srv/submissioninterface/runtests.sh - Please make sure that you receive mails for the tomcat user in order to get errors of the cron task runner
- You can use the shipped script
- Restart Tomcat
- For using Docker-based tests
- Build the local
safe-dockerimage, based onsafe-docker/Dockerfile(e.g.,docker build --tag safe-docker .in thesafe-dockerfolder of this repository). So far, the image is only prepared for supporting Haskell, you might want to extend it according to your needs. - Copy
safe-docker/safe-dockerto/usr/local/bin/safe-dockerand make sure it is owned byroot:rootand has the permissions700, you might want to check the parameters passed todocker. Requires the packageslibipc-run-perlandlibdata-guid-perl packageson Debian-based systems. - On Debian-based systems you might need to lift some systemd restrictions by creating the file
/etc/systemd/system/tomcat10.service.d/gate-safe-docker.confcontaining:[Service] NoNewPrivileges=false PrivateTmp=no ReadWritePaths=/tmp/ - Set up
sudoby insertingtomcat ALL= NOPASSWD: /usr/local/bin/safe-dockerin/etc/sudoers.d/gate-safe-docker
- Build the local
Now GATE can be access using e.g. http://localhost:8080/GATE/ depending on your concrete local setup. It is recommended to run the self-test to check whether everything looks ok: http://localhost:8080/GATE/servlets/SelfTest