Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation:System] HTTP/2 Changes #438

Merged
merged 20 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions _docs/developer/developing_the_php_site/websocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,22 @@ const ws = new WebSocket('ws://localhost:1511/ws');
ws.onmessage = (data) => console.log(data);
ws.send('ping');
```

### Debugging WebSocket in HTTPS

Note that most browsers could not trust WebSocket traffics with self-
Viyerelu23333 marked this conversation as resolved.
Show resolved Hide resolved
signed certificates. If you are dealing with WebSocket related features,
there are some workarounds:

- Copy the certificates from your VM and trust it on your host system;

- OR, Trust/Ignore the certificates on your browser;

- OR, Downgrade to HTTP/1.1 without TLS using `.setup/dev-upgrade-h2.sh down`.

You could try following to trust/ignore certificates on your browser:

- For Chrome, start Chrome with `--ignore-certificate-errors`.

- For Firefox, trust the certificate when the warning pops up;
And go to `https://localhost:8443/ws` and hit trust again.
55 changes: 39 additions & 16 deletions _docs/developer/getting_started/vm_install_using_vagrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Unix/Linux). The installation process will create a new Virtual
Machine (VM) on your computer and the VM will use the Ubuntu GNU/Linux
operating system.

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

---
Expand All @@ -42,15 +42,15 @@ instructions.
Leaving it enabled will force VirtualBox to use the Hyper-V
backend, which will be slower and can cause instability in the
VM.

**Note:**
This may stop programs like Docker Desktop and WSL 2 from
working. If these programs are essential to your workflow, consider
looking up how to add a separate boot entry with "hypervisorlaunchtype"
set to "off" for use with VirtualBox.

**Note:**
Installing WSL2 may also reconfigure your OS to use Hyper-V or Windows hypervisor
Installing WSL2 may also reconfigure your OS to use Hyper-V or Windows hypervisor
platform and prevent VirtualBox from working correctly. It is recommended to not install
or use WSL2 alongside Virtualbox for now.

Expand Down Expand Up @@ -98,7 +98,7 @@ instructions.

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

**NOTE**
**NOTE**
If using secure boot, vagrant may fail to work with VirtualBox. You will then either need to disable secure boot from
the boot menu/BIOS or follow [these steps](https://era86.github.io/2018/01/24/vagrant-virtualbox-secureboot-in-ubuntu-1604.html)
to self-sign the necessary packages to run vagrant and VirtualBox.
Expand Down Expand Up @@ -141,7 +141,7 @@ instructions.
```
git clone https://github.com/Submitty/Submitty.git
```

**NOTE:** If you are not currently part of the Submitty organization on Github, you may want to
[fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
the repo and use the git url from your fork instead, especially if you are looking to contribute.
Expand Down Expand Up @@ -197,24 +197,43 @@ instructions.
NO_SUBMISSIONS=1 vagrant up
```

On Windows, you will have to first set the environment variable `NO_SUBMISSIONS` to 1
which lasts for the session of that console, then call vagrant up.

On Windows `cmd`, you will have to first set the environment variable
`NO_SUBMISSIONS` to 1 which lasts for the session of that console,
then call vagrant up.

```
SET NO_SUBMISSIONS=1
vagrant up
```

If you want to unset the variable later, you can do
On PowerShell, you will have to set the environment variable in a
different way:

```pwsh
$Env:NO_SUBMISSIONS=1
vagrant up
```

If you want to unset the variable later in `cmd`, you can do
```
SET NO_SUBMISSIONS=
```

Or in PowerShell,
```pwsh
Remove-Item Env:\NO_SUBMISSIONS
```

Similarly, you can check that the variable is set by doing
```
SET NO_SUBMISSIONS
```

Or in PowerShell,
```pwsh
$Env:NO_SUBMISSIONS
```

---

## Using your Submitty Developer VM
Expand All @@ -226,18 +245,22 @@ instructions.
* From a web browser (Chrome, Firefox, IE, etc.) on your host
computer, go to:

<http://localhost:1511/index.php>
<https://localhost:1511/index.php>

(see the VM login & password info below)

* Make sure the HTTPS certificate is trusted by your browser.

For more information, see [WebSocket](/developer/developing_the_php_site/websocket)

* You can test the submission, autograding, and viewing of the
grades details by uploading sample submissions from the Submitty
repository, located in one of these these directories:

For the "tutorial" course:
For the "tutorial" course:
<https://github.com/Submitty/Tutorial/tree/main/examples>

For the "sample" course:
For the "sample" course:
<https://github.com/Submitty/Submitty/tree/master/more_autograding_examples>

2. When the VM is "up", you can connect from your host computer to the
Expand Down Expand Up @@ -267,7 +290,7 @@ instructions.
```

If it asks for password, it should be "vagrant"
and then
and then

```sh
sudo su
Expand Down
52 changes: 52 additions & 0 deletions _docs/sysadmin/installation/version_notes/v22.06.XX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: v22.06.XX > Apache2 HTTP/2 Support
category: System Administrator > Installation Version Notes
redirect_from:
- /system_admin/version_notes/v22.06.XX
---

Release [v22.06.XX](https://github.com/Submitty/Submitty/releases/v22.06.XX)
includes an update to the Apache2 server's module and configuration:

- Module `php7.4`[^PHP] and `mpm_prefork` are disabled;

- Module `mpm_event` and `http2` are enabled;

- TLS is enabled by default in the development environment.

---

Despite the automatic system migration, please follow these steps to
upgrade the Apache2 server *before* updating to this version.

1. If there are load balancers and firewalls in front of the Apache
server of Submitty, please make sure they support HTTP/2 redirections.

2. *(Migrator will also handle this)*

Disable `php7.4`[^PHP] and `mpm_prefork` by `a2dismod php7.4 mpm_prefork`;

3. *(Migrator will also handle this)*

Enable `mpm_event` and `http2` by `a2enmod mpm_event http2`;

4. Activate the TLS encryption for Submitty;

5. Tune the performance for `php-fpm` and `mpm_event` at [^PHP]
```
/etc/php/7.4/fpm/pool.d/submitty.conf
/etc/apache2/mods-enabled/mpm_event.conf
```

6. Final check for Apache2's configuration;
```sh
apachectl -t
```

7. Reload Apache2 to apply changes.

8. Run the update script.

---

[^PHP]: Change the PHP version to the deployed version if needed.
1 change: 1 addition & 0 deletions navtreedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ var NAVTREE =
[ "Update Submitty", "/sysadmin/installation/update", null ],
[ "Version Notes", "/sysadmin/installation/version_notes/index", [
[ "Overview", "/sysadmin/installation/version_notes/index", null],
[ "v22.06.XX", "/sysadmin/installation/version_notes/v22.06.XX", null ],
[ "v22.06.00", "/sysadmin/installation/version_notes/v22.06.00", null ],
[ "v22.05.00", "/sysadmin/installation/version_notes/v22.05.00", null ],
[ "v22.03.00", "/sysadmin/installation/version_notes/v22.03.00", null ],
Expand Down