How to Install DOMjudge on Debian Latest
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.
Prerequisites
Before you begin, make sure you have the following prerequisites:
- A server running Debian latest.
- A user account with sudo privileges.
- MySQL database server installed and configured.
- Apache2 web server installed and running.
Steps to Install DOMjudge
Follow the steps below to install DOMjudge on Debian latest:
Step 1: Install Required Dependencies
Update the package repository and upgrade the installed packages:
sudo apt update sudo apt upgradeInstall 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
Step 2: Download and Install DOMjudge
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.gzExtract the downloaded archive:
sudo tar xfz domjudge-7.3.3.tar.gzNavigate to the extracted directory:
cd domjudge-7.3.3Compile 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-judgehostReplace
{your_domjudge_path}with the path where DOMjudge will be installed and{your_db_password}with your MySQL root password.
Step 3: Configure Apache2
Create a new virtual host configuration file for Apache2:
sudo nano /etc/apache2/sites-available/domjudge.confAdd 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.tldwith your domain name and{your_domjudge_path}with the path where DOMjudge is installed.Enable the virtual host:
sudo a2ensite domjudgeReload Apache2:
sudo systemctl reload apache2
Step 4: Configure MySQL
Login to MySQL:
sudo mysql -u root -pCreate 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;
Step 5: Initialize DOMjudge Database
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 [email protected]Replace
{your_admin_password}with your desired password for the admin user.
Step 6: Start DOMjudge
Start the DOMjudge daemon:
sudo systemctl start domjudgeEnable the DOMjudge daemon to start on boot:
sudo systemctl enable domjudgeVerify that DOMjudge is running:
sudo systemctl status domjudgeYou should see a message indicating that the service is active and running.
Step 7: Access DOMjudge Web Interface
Open your web browser and navigate to your domain name or IP address, followed by
/judge.http://domain.tld/judgeLog 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.