Skip to content

Commit 1ce25b3

Browse files
committed
Restructure documentation to prefer nginx
This is highly opiniated but we have deployed with nginx for years and most new users will use nginx over apache2 currently (although they might even already use other webservers). Most of our enhancements are added to the nginx config and not always added to the apache2 config also.
1 parent bc86b03 commit 1ce25b3

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ inplace-install-l:
237237
@echo "========== Maintainer Install Completed =========="
238238
@echo ""
239239
@echo "Next:"
240-
@echo " - Configure apache2"
241-
@echo " sudo make inplace-postinstall-apache"
242240
@echo " - Configure nginx"
243241
@echo " sudo make inplace-postinstall-nginx"
242+
@echo " - Configure apache2"
243+
@echo " sudo make inplace-postinstall-apache"
244244
@echo " - Configure judgedaemon"
245245
@echo " sudo make inplace-postinstall-judgedaemon"
246246
@echo " - Set up database"
@@ -263,16 +263,16 @@ inplace-install-l:
263263
@echo " setfacl -R -m u:$(DOMJUDGE_USER):rwx $(CURDIR)/webapp/var"
264264
@echo " And manually make sure the webserver has traversal access to: $(CURDIR)"
265265
@echo " - Configure webserver"
266-
@echo " Apache 2:"
267-
@echo " ln -sf $(CURDIR)/etc/apache.conf /etc/apache2/conf-available/domjudge.conf"
268-
@echo " a2enconf domjudge"
269-
@echo " a2enmod rewrite headers"
270-
@echo " systemctl restart apache2"
271266
@echo " Nginx + PHP-FPM:"
272267
@echo " ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/sites-enabled/"
273268
@echo " ln -sf $(CURDIR)/etc/domjudge-fpm /etc/php/$(PHPVERSION)/fpm/pool.d/domjudge.conf"
274269
@echo " systemctl restart nginx"
275270
@echo " systemctl restart php-fpm"
271+
@echo " Apache 2:"
272+
@echo " ln -sf $(CURDIR)/etc/apache.conf /etc/apache2/conf-available/domjudge.conf"
273+
@echo " a2enconf domjudge"
274+
@echo " a2enmod rewrite headers"
275+
@echo " systemctl restart apache2"
276276
@echo ""
277277
@echo "The admin password for the web interface is in etc/initial_admin_password.secret"
278278

doc/manual/install-domserver.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ For your convenience, the following command will install the necessary
3535
software on the DOMjudge server as mentioned above when using Debian
3636
GNU/Linux, or one of its derivative distributions like Ubuntu::
3737

38-
sudo apt install libcgroup-dev make acl zip unzip pv mariadb-server apache2 \
38+
sudo apt install libcgroup-dev make acl zip unzip pv mariadb-server nginx \
3939
php php-fpm php-gd php-cli php-intl php-mbstring php-mysql \
4040
php-curl php-json php-xml php-zip composer ntp python3-yaml php-bcmath
4141

@@ -46,7 +46,7 @@ Red Hat Enterprise Linux and Rocky Linux (before V9)::
4646
php-gd php-cli php-intl php-mbstring php-mysqlnd php-fpm \
4747
php-xml php-zip composer chronyd python3-pyyaml php-bcmath
4848

49-
`nginx` can be used as an alternate web server.
49+
`apache2` can be used as an alternate web server.
5050

5151
The packages `libcgroup-dev` (`libcgroup-devel` on Fedora) and `make` are
5252
:ref:`judgehost software requirements <judgehost_software>`, but also
@@ -109,24 +109,7 @@ with it. Refer to the documentation of your web server and PHP for
109109
details. In the examples below, replace |phpversion| with the PHP version
110110
you're installing.
111111

112-
To configure the Apache web server for DOMjudge, use the Apache
113-
configuration snippet from ``etc/apache.conf``. It contains
114-
examples for configuring the DOMjudge pages with an alias directive,
115-
or as a virtualhost, optionally with TLS; it also contains PHP and security
116-
settings. Reload the web server for changes to take effect.
117-
118-
.. parsed-literal::
119-
120-
ln -s <DOMSERVER_INSTALL_PATH>/etc/apache.conf /etc/apache2/conf-available/domjudge.conf
121-
ln -s <DOMSERVER_INSTALL_PATH>/etc/domjudge-fpm.conf /etc/php/|phpversion|/fpm/pool.d/domjudge.conf
122-
a2enmod proxy_fcgi setenvif rewrite
123-
a2enconf php\ |phpversion|-fpm domjudge
124-
# Edit the file /etc/apache2/conf-available/domjudge.conf and
125-
# /etc/php/\ |phpversion|/fpm/pool.d/domjudge.conf to your needs
126-
service php\ |phpversion|-fpm reload
127-
service apache2 reload
128-
129-
An nginx webserver configuration snippet is also provided in
112+
To configure the nginx web server for DOMjudge, use the nginx configuration snippet in
130113
``etc/nginx-conf``. You still need ``htpasswd`` from ``apache2-utils``
131114
though. To use this configuration, perform the following steps:
132115

@@ -150,6 +133,23 @@ On Fedora, use the following nginx configuration steps:
150133
systemctl restart php-fpm.service
151134
systemctl restart nginx.service
152135
136+
To configure the Apache web server for DOMjudge, use the Apache
137+
configuration snippet from ``etc/apache.conf``. It contains
138+
examples for configuring the DOMjudge pages with an alias directive,
139+
or as a virtualhost, optionally with TLS; it also contains PHP and security
140+
settings. Reload the web server for changes to take effect.
141+
142+
.. parsed-literal::
143+
144+
ln -s <DOMSERVER_INSTALL_PATH>/etc/apache.conf /etc/apache2/conf-available/domjudge.conf
145+
ln -s <DOMSERVER_INSTALL_PATH>/etc/domjudge-fpm.conf /etc/php/|phpversion|/fpm/pool.d/domjudge.conf
146+
a2enmod proxy_fcgi setenvif rewrite
147+
a2enconf php\ |phpversion|-fpm domjudge
148+
# Edit the file /etc/apache2/conf-available/domjudge.conf and
149+
# /etc/php/\ |phpversion|/fpm/pool.d/domjudge.conf to your needs
150+
service php\ |phpversion|-fpm reload
151+
service apache2 reload
152+
153153
The judgehosts connect to DOMjudge via the DOMjudge API so need
154154
to be able to access at least this part of the web interface.
155155

doc/manual/quick-install.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,29 @@ DOMserver
2121
* Install the MySQL database using e.g.
2222
``bin/dj_setup_database -u root -r install``.
2323

24-
* For Apache: add ``etc/apache.conf`` to your Apache configuration and
24+
* For nginx: add ``etc/nginx-conf`` to your nginx configuration and
2525
add ``etc/domjudge-fpm.conf`` to your PHP FPM pool directory, edit
2626
it to your needs, reload web server
2727

2828
.. parsed-literal::
2929
30-
sudo ln -s <DOMSERVER_INSTALL_PATH>/etc/apache.conf /etc/apache2/conf-available/domjudge.conf
30+
sudo ln -s <DOMSERVER_INSTALL_PATH>/etc/nginx-conf /etc/nginx/sites-enabled/domjudge
3131
sudo ln -s <DOMSERVER_INSTALL_PATH>/etc/domjudge-fpm.conf /etc/php/\ |phpversion|/fpm/pool.d/domjudge.conf
32-
sudo a2enmod proxy_fcgi setenvif rewrite
33-
sudo a2enconf php\ |phpversion|-fpm domjudge
3432
sudo service php\ |phpversion|-fpm reload
35-
sudo service apache2 reload
33+
sudo service nginx reload
3634
37-
* For nginx: add ``etc/nginx-conf`` to your nginx configuration and
35+
* For Apache: add ``etc/apache.conf`` to your Apache configuration and
3836
add ``etc/domjudge-fpm.conf`` to your PHP FPM pool directory, edit
3937
it to your needs, reload web server
4038

4139
.. parsed-literal::
4240
43-
sudo ln -s <DOMSERVER_INSTALL_PATH>/etc/nginx-conf /etc/nginx/sites-enabled/domjudge
41+
sudo ln -s <DOMSERVER_INSTALL_PATH>/etc/apache.conf /etc/apache2/conf-available/domjudge.conf
4442
sudo ln -s <DOMSERVER_INSTALL_PATH>/etc/domjudge-fpm.conf /etc/php/\ |phpversion|/fpm/pool.d/domjudge.conf
43+
sudo a2enmod proxy_fcgi setenvif rewrite
44+
sudo a2enconf php\ |phpversion|-fpm domjudge
4545
sudo service php\ |phpversion|-fpm reload
46-
sudo service nginx reload
46+
sudo service apache2 reload
4747
4848
* Check that the web interface works (/team, /public and /jury).
4949
* Check that the API (/api) works and create credentials for the judgehosts.

0 commit comments

Comments
 (0)