Deploy hotcrp on Ubuntu

HotCRP is awesome software for managing review processes, especially for academic conferences. It supports paper submission, review and comment management, rebuttals, and the PC meeting. Its main strengths are flexibility and ease of use in the review process, especially through smart paper search and tagging. It has been widely used in computer science conferences and for internal review processes at several large companies.

HotCRP is the open-source version of the software running on hotcrp.com. If you want to run HotCRP without setting up your own server, use hotcrp.com.

Prerequisites

HotCRP runs on Unix, including Mac OS X. It requires the following software:

  • Nginx, https://nginx.org/ (Or Apache, or another web server that works with PHP)
  • PHP version 7.2 or higher, http://php.net/
    • Including MySQL support, php-fpm, and php-intl
  • MariaDB, https://mariadb.org/
  • Poppler’s version of pdftohtml, https://poppler.freedesktop.org/ (only required for format checking)

You may need to install additional packages, such as php73, php73-fpm, php73-intl, php73-mysqlnd, zip, poppler-utils, and sendmail or postfix.

Preparations

Install nginx:

1
2
sudo apt update
sudo apt install nginx

Install php7.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php7.4

# install extentions
sudo apt-get -y install php7.4-fpm php7.4-mysql php7.4-curl php7.4-json php7.4-mbstring php7.4-xml php7.4-intl

# modify nginx profile to support PHP
sudo vim /etc/nginx/sites-enabled/default
# add index.php in server->index
# uncomment location ~ \.php$ in server block
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}

sudo vim /etc/php/7.4/fpm/pool.d/www.conf

# change listen to localhost 9000
;listen = /run/php/php7.4-fpm.sock
listen = 127.0.0.1:9000

sudo systemctl restart php7.4-fpm

Install MariaDB

1
2
3
4
5
6
7
8
9
10
11
sudo apt update
sudo apt install mariadb-server

sudo mysql_secure_installation

# Set root password? [Y/n] Y
# set password to password
# Remove anonymous users? [Y/n] Y
# Disallow root login remotely? [Y/n] Y
# Remove test database and access to it? [Y/n] Y
# Reload privilege tables now? [Y/n] Y

Install pdftohtml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
wget https://poppler.freedesktop.org/poppler-21.09.0.tar.xz
tar -xvf poppler-21.09.0.tar.xz

# install some dependences
sudo apt-get install libnss3 libnss3-dev
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev
sudo apt install libopenjp2-7-dev -y
sudo apt-get install libgpgme-dev
sudo apt-get install build-essential

# make
cd poppler-21.09.0/
mkdir build
cd build/
sudo cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DTESTDATADIR=$PWD/testfiles \
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
..
sudo make
sudo make install

Installation

1
2
3
4
5
6
7
cd ~
git clone https://github.com/kohler/hotcrp.git
cd hotcrp/
chmod -R 755 *

# create the database for hotCRP
sudo lib/createdb.sh --user root --password password

Nginx: Configure Nginx to redirect accesses to php-fpm and the HotCRP index.php script. This example code would go in a server block, and assumes that php-fpm is listening on port 9000:

1
2
3
4
5
6
location /testconf/ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(/testconf)(/[\s\S]*)$;
fastcgi_param SCRIPT_FILENAME /home/ubuntu/hotcrp/index.php;
include fastcgi_params;
}

mail

1
2
3
4
sudo apt-get update
sudo apt install mailutils

sudo vim /etc/postfix/sasl_passwd

格式如下

[smtp.qq.com]:465 myEmail:password

1
2
# encrypt
sudo postmap /etc/postfix/sasl_passwd

Run hostname, get the server name myserver, the user is username

1
2
3
4
5
6
7
8
9
sudo vim /etc/postfix/generic

www-data@myserver myEmail
username@myserver myEmail
root@myserver myEmail


# encrypt
sudo postmap /etc/postfix/generic

Tell postfix to use smtp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sudo vim /etc/postfix/main.cf

relayhost = [smtp.qq.com]:465

# add at the bottom

# enable SASL authentication
smtp_sasl_auth_enable = yes

# disallow methods that allow anonymous authentication.
smtp_sasl_security_options = noanonymous

# where to find sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

# where to find generic
smtp_generic_maps = hash:/etc/postfix/generic

# Enable STARTTLS encryption
smtp_use_tls = yes

# where to find CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

# Enable tls encryption
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt

Restart postfix

1
sudo systemctl restart postfix
1
2
3
echo "body of your email" | mail -s "This is a Subject" -a "From: myEmail" [email protected]

cat /var/log/mail.log

conf

1
vim ~/hotcrp/conf/options.php

change email sender to the smtp account name,

change email from to the website,

change contactName and contactEmail to what you like