DOMjudge is an open-source online judge system that is used in programming contests to evaluate solutions submitted by contestants. In this tutorial, you will learn how to install DOMjudge on Debian latest.
Before you begin, make sure you have the following prerequisites:
Follow the steps below to install DOMjudge on Debian latest:
Update the package repository and upgrade the installed packages:
sudo apt update
sudo apt upgrade
Install the required dependencies:
sudo apt install build-essential apache2 libapache2-mod-php libcurl4-gnutls-dev libxml2-dev libicu-dev libbz2-dev libzip-dev libgmp-dev mariadb-server mariadb-client php php-curl php-intl php-bcmath php-gmp php-xml php-json php-mbstring php-zip
Download the DOMjudge source code:
sudo curl -L https://www.domjudge.org/releases/domjudge-7.3.3.tar.gz -o domjudge-7.3.3.tar.gz
Extract the downloaded archive:
sudo tar xfz domjudge-7.3.3.tar.gz
Navigate to the extracted directory:
cd domjudge-7.3.3
Compile and install DOMjudge:
sudo ./configure --with-baseurl=/{your_domjudge_path} --with-domjudge-user=judge --with-apache-user=www-data --with-db-host=localhost --with-db-user=root --with-db-name=domjudge --with-db-password={your_db_password}
sudo make domserver
sudo make install-domserver
sudo make judgehost
sudo make install-judgehost
Replace {your_domjudge_path}
with the path where DOMjudge will be installed and {your_db_password}
with your MySQL root password.
Create a new virtual host configuration file for Apache2:
sudo nano /etc/apache2/sites-available/domjudge.conf
Add the following content to the file:
<VirtualHost *:80>
ServerName domain.tld
DocumentRoot /{your_domjudge_path}/public/
<Directory /{your_domjudge_path}/public/>
AllowOverride None
Require all granted
Options FollowSymLinks Indexes
</Directory>
ErrorLog /var/log/apache2/domjudge_error.log
CustomLog /var/log/apache2/domjudge_access.log combined
</VirtualHost>
Replace domain.tld
with your domain name and {your_domjudge_path}
with the path where DOMjudge is installed.
Enable the virtual host:
sudo a2ensite domjudge
Reload Apache2:
sudo systemctl reload apache2
Login to MySQL:
sudo mysql -u root -p
Create a new database for DOMjudge:
CREATE DATABASE domjudge;
Create a new MySQL user for DOMjudge:
CREATE USER 'domjudge'@'localhost' IDENTIFIED BY '{your_domjudge_password}';
Replace {your_domjudge_password}
with your desired password for the DOMjudge user.
Grant privileges to the DOMjudge user:
GRANT ALL PRIVILEGES ON domjudge.* TO 'domjudge'@'localhost';
Flush the privileges:
FLUSH PRIVILEGES;
Change to the DOMjudge installation directory:
cd /{your_domjudge_path}
Initialize the DOMjudge database:
sudo bin/dj_setup_database.sh -u root -p {your_db_password}
Replace {your_db_password}
with your MySQL root password.
Create an admin user:
sudo bin/dj_add_user.sh -u admin -p {your_admin_password} -a -f Admin -l User -e admin@domain.tld
Replace {your_admin_password}
with your desired password for the admin user.
Start the DOMjudge daemon:
sudo systemctl start domjudge
Enable the DOMjudge daemon to start on boot:
sudo systemctl enable domjudge
Verify that DOMjudge is running:
sudo systemctl status domjudge
You should see a message indicating that the service is active and running.
Open your web browser and navigate to your domain name or IP address, followed by /judge
.
http://domain.tld/judge
Log in with the admin username and password that you created earlier.
Congratulations! You have successfully installed DOMjudge on Debian latest. You can now use it to run programming contests and evaluate submissions from contestants.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!