Skip to content

Commit bd5f74f

Browse files
Viyerelu23333prestoncarman04vmatsibekkercjreed121
authored
[Documentation:System] HTTP/2 Changes (#438)
Related Submitty/Submitty#7940 --------- Co-authored-by: Preston Carman <[email protected]> Co-authored-by: Viane Matsibekker <[email protected]> Co-authored-by: Chris Reed <[email protected]> Co-authored-by: Barb Cutler <Barb Cutler>
1 parent e18f63f commit bd5f74f

File tree

5 files changed

+166
-17
lines changed

5 files changed

+166
-17
lines changed

_docs/developer/developing_the_php_site/websocket.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,22 @@ const ws = new WebSocket('ws://localhost:1511/ws');
8888
ws.onmessage = (data) => console.log(data);
8989
ws.send('ping');
9090
```
91+
92+
### Debugging WebSocket in HTTPS
93+
94+
Note that most browsers do not trust WebSocket traffics with self-
95+
signed certificates. If you are dealing with WebSocket related features,
96+
there are some workarounds:
97+
98+
- Copy the certificates from your VM and trust it on your host system;
99+
100+
- OR, Trust/Ignore the certificates on your browser;
101+
102+
- OR, Downgrade to HTTP/1.1 without TLS using `bash /usr/local/submitty/GIT_CHECKOUT/Submitty/.setup/dev-upgrade-h2.sh down`.
103+
104+
You could try following to trust/ignore certificates on your browser:
105+
106+
- For Chrome, start Chrome with `--ignore-certificate-errors`.
107+
108+
- For Firefox, trust the certificate when the warning pops up;
109+
And go to `https://localhost:8443/ws` and hit trust again.

_docs/developer/getting_started/vm_install_using_vagrant.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Unix/Linux). The installation process will create a new Virtual
1414
Machine (VM) on your computer and the VM will use the Ubuntu GNU/Linux
1515
operating system.
1616

17-
__Note:__ We only officially support and test development using VirtualBox.
18-
The instructions below are for VirtualBox. While alternatively using
19-
VMWare should work, we have not tested this, and do not provide these
17+
__Note:__ We only officially support and test development using VirtualBox.
18+
The instructions below are for VirtualBox. While alternatively using
19+
VMWare should work, we have not tested this, and do not provide these
2020
instructions.
2121

2222
---
@@ -50,15 +50,15 @@ If you using an Intel-based Mac, you will follow the instructions below._
5050
Leaving it enabled will force VirtualBox to use the Hyper-V
5151
backend, which will be slower and can cause instability in the
5252
VM.
53-
53+
5454
**Note:**
5555
This may stop programs like Docker Desktop and WSL 2 from
5656
working. If these programs are essential to your workflow, consider
5757
looking up how to add a separate boot entry with "hypervisorlaunchtype"
5858
set to "off" for use with VirtualBox.
59-
59+
6060
**Note:**
61-
Installing WSL2 may also reconfigure your OS to use Hyper-V or Windows hypervisor
61+
Installing WSL2 may also reconfigure your OS to use Hyper-V or Windows hypervisor
6262
platform and prevent VirtualBox from working correctly. It is recommended to not install
6363
or use WSL2 alongside Virtualbox for now.
6464

@@ -106,7 +106,7 @@ If you using an Intel-based Mac, you will follow the instructions below._
106106

107107
4. Be sure to choose **Hardware Virtualization** in the **System -> Acceleration** settings of the virtual machine you are using.
108108

109-
**NOTE**
109+
**NOTE**
110110
If using secure boot, vagrant may fail to work with VirtualBox. You will then either need to disable secure boot from
111111
the boot menu/BIOS or follow [these steps](https://era86.github.io/2018/01/24/vagrant-virtualbox-secureboot-in-ubuntu-1604.html)
112112
to self-sign the necessary packages to run vagrant and VirtualBox.
@@ -153,7 +153,7 @@ Below are quick steps to get everything installed and running.
153153
```
154154
git clone https://github.com/Submitty/Submitty.git
155155
```
156-
156+
157157
**NOTE:** If you are not currently part of the Submitty organization on Github, you may want to
158158
[fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
159159
the repo and use the git url from your fork instead, especially if you are looking to contribute.
@@ -211,24 +211,42 @@ Below are quick steps to get everything installed and running.
211211
NO_SUBMISSIONS=1 vagrant up
212212
```
213213
214-
On Windows, you will have to first set the environment variable `NO_SUBMISSIONS` to 1
215-
which lasts for the session of that console, then call vagrant up.
216-
214+
On Windows `cmd`, you will have to first set the environment variable
215+
`NO_SUBMISSIONS` to 1 which lasts for the session of that console,
216+
then call vagrant up.
217+
217218
```
218219
SET NO_SUBMISSIONS=1
219220
vagrant up
220221
```
221222
222-
If you want to unset the variable later, you can do
223+
On PowerShell, you will have to set the environment variable differently:
224+
225+
```pwsh
226+
$Env:NO_SUBMISSIONS=1
227+
vagrant up
228+
```
229+
230+
If you want to unset the variable later in `cmd`, you can do
223231
```
224232
SET NO_SUBMISSIONS=
225233
```
226234

235+
Or in PowerShell,
236+
```pwsh
237+
Remove-Item Env:\NO_SUBMISSIONS
238+
```
239+
227240
Similarly, you can check that the variable is set by doing
228241
```
229242
SET NO_SUBMISSIONS
230243
```
231244

245+
246+
Or in PowerShell,
247+
```pwsh
248+
$Env:NO_SUBMISSIONS
249+
```
232250
8. When the install has completed, you should see the message:
233251
```
234252
#####################################################################
@@ -279,10 +297,10 @@ Below are quick steps to get everything installed and running.
279297
grades details by uploading sample submissions from the Submitty
280298
repository, located in one of these these directories:
281299

282-
For the "tutorial" course:
300+
For the "tutorial" course:
283301
<https://github.com/Submitty/Tutorial/tree/main/examples>
284302

285-
For the "sample" course:
303+
For the "sample" course:
286304
<https://github.com/Submitty/Submitty/tree/master/more_autograding_examples>
287305

288306
2. When the VM is "up", you can connect from your host computer to the
@@ -312,7 +330,7 @@ Below are quick steps to get everything installed and running.
312330
```
313331

314332
If it asks for password, it should be "vagrant"
315-
and then
333+
and then
316334

317335
```sh
318336
sudo su
@@ -354,7 +372,7 @@ Below are quick steps to get everything installed and running.
354372

355373

356374
1. When you take a break from Submitty development work, you can
357-
suspend the Submitty VM to to save resources (CPU and battery) on
375+
suspend the Submitty VM to save resources (CPU and battery) on
358376
your host machine.
359377

360378
```
@@ -444,3 +462,20 @@ Below are quick steps to get everything installed and running.
444462
This has been tested with Blink for iOS and Termius for iOS (also available on Android, untested).
445463
446464
6. Navigate to `localhost:1511` on the remote device.
465+
466+
---
467+
468+
## Developing in HTTPS
469+
470+
For *developers* who need to upgrade to HTTP/2 in their development environments,
471+
please follow the step below:
472+
473+
- Run `bash /usr/local/submitty/GIT_CHECKOUT/Submitty/.setup/dev-upgrade-h2.sh up`.
474+
475+
After a successful execution, please use `https://` instead of `http://`.
476+
477+
- To downgrade to HTTP/1.1, run `bash /usr/local/submitty/GIT_CHECKOUT/Submitty/.setup/dev-upgrade-h2.sh down`.
478+
479+
The script should automatically handle the upgrading and issuing a self-signed
480+
certificate. If your browser complains about the security, please head to
481+
[WebSocket](/developer/developing_the_php_site/websocket).

_docs/sysadmin/installation/system_customization.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ Refer to [this](/student/communication/markdown) to learn more about markdown.
359359

360360

361361

362+
## Changing the multi-processing module of Apache2, Enabling HTTP2
363+
364+
Please refer to [this sysadmin action](/sysadmin/installation/version_notes/v23.12.02) page.
365+
366+
362367
## Preferred Name Change Logging
363368

364369
In the interests of diversity, Submitty provides for users to set a preferred name should it be different from their legal name. This feature can be abused, so changes to a user's preferred name is recorded into Postgresql's log for review. To make it easier to locate these logged messages, a sysadmin tools script, `pnc_compile.pl`, is provided to fetch the preferred name change logs from Postgresql and compile them into a human readable report.
@@ -381,4 +386,5 @@ In the interests of diversity, Submitty provides for users to set a preferred na
381386
* Postgresql's log is typically owned by `root`, so it is mandatory to run the script as `root`.
382387
* Be sure to set execute permission on the script.
383388
* The script will parse Postgresql's log *by the current day's datestamp*, so it is intended that the script is run once per day.
384-
* Alternatively, if you wish to schedule the crontab for overnight after 12AM, you can set the `-y` or `--yesterday` argument so the script will intentionally parse Postgresql's log by the *previous* day's datestamp. e.g. `/path/to/pnc_compile.pl -y`
389+
* Alternatively, if you wish to schedule the crontab for overnight after 12AM, you can set the `-y` or `--yesterday` argument so the script will intentionally parse Postgresql's log by the *previous* day's datestamp. e.g. `/path/to/pnc_compile.pl -y`
390+
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
title: v23.12.02 > Apache2 HTTP/2 Support
3+
category: System Administrator > Installation Version Notes
4+
redirect_from:
5+
- /system_admin/version_notes/v23.12.02
6+
---
7+
8+
Release [v23.12.02](https://github.com/Submitty/Submitty/releases/v23.12.02)
9+
includes an update to the Apache2 server's module and configuration to
10+
disable `php8.1` and `mpm_prefork` and enable `mpm_event` and `http2`.
11+
Note: Submitty uses `php8.1-fpm` NOT `php8.1`.
12+
13+
14+
1. If you have load balancers and firewalls in front of the Apache
15+
server for Submitty, please make sure they support HTTP/2
16+
redirections.
17+
18+
2. Disable `php8.1` and `mpm_prefork`:
19+
20+
```
21+
a2dismod php8.1 mpm_prefork
22+
```
23+
24+
3. Enable `mpm_event` and `http2`:
25+
26+
```
27+
a2enmod mpm_event http2
28+
```
29+
30+
4. If you are not already using TLS/SSL HTTPS encryption for Submitty,
31+
we strongly recommend enabling it. See
32+
[System Administrator Installation Instructions](https://submitty.org/sysadmin/installation/index).
33+
34+
5. Review your current performance tuning for `php-fpm`.
35+
```
36+
/etc/php/8.1/fpm/pool.d/submitty.conf
37+
```
38+
You will probably not need to change these settings.
39+
40+
6. With the switch from `mpm_prefork` to `mpm_event`, you will probably want to take any customization from this file:
41+
```
42+
/etc/apache2/mods-available/mpm_prefork.conf
43+
```
44+
45+
And adapt it to this file:
46+
```
47+
/etc/apache2/mods-available/mpm_event.conf
48+
```
49+
50+
6. Final check for Apache2's configuration;
51+
```sh
52+
apachectl -t
53+
```
54+
55+
7. Reload Apache2 to apply changes.
56+
57+
```
58+
sudo systemctl restart apache2.service
59+
sudo systemctl restart php8.1-fpm
60+
```
61+
62+
8. Run the update script.
63+
64+
```
65+
sudo /usr/local/submitty/.setup/INSTALL_SUBMITTY.sh
66+
```
67+
68+
---
69+
70+
NOTE: If you need to downgrade from HTTP/2 back to HTTP/1.1 and re-enable `mpm_prefork`,
71+
please follow the steps below:
72+
73+
1. Disable `http2` and `mpm_event`:
74+
75+
```
76+
a2dismod http2 mpm_event
77+
```
78+
79+
2. Enable `mpm_prefork`:
80+
81+
```
82+
a2enmod mpm_prefork
83+
```
84+
85+
3. Alternatively, if the PHP does not use a `fpm` server, consider enabling
86+
`php8.1` by `a2enmod php8.1`.
87+
88+

navtreedata.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ var NAVTREE =
145145
[ "Update Submitty", "/sysadmin/installation/update_submitty", null ],
146146
[ "Version Notes", "/sysadmin/installation/version_notes/index", [
147147
[ "Overview", "/sysadmin/installation/version_notes/index", null],
148+
[ "v23.12.02", "/sysadmin/installation/version_notes/v23.12.02", null ],
148149
[ "v23.07.00", "/sysadmin/installation/version_notes/v23.07.00", null ],
149150
[ "v23.03.01", "/sysadmin/installation/version_notes/v23.03.01", null ],
150151
[ "v22.06.00", "/sysadmin/installation/version_notes/v22.06.00", null ],

0 commit comments

Comments
 (0)