-
Notifications
You must be signed in to change notification settings - Fork 1
Setup FreeCC Domain
The FreeCC domain freecompilercamp.org
is managed on GoDaddy. Assume the IP of server hosting the play-with-compiler server is <aws_ip>
and GitPages is used to host the main classroom website.
We need two domain names
- mydomain.com for the main entry, used by GitPages, as shown at https://github.com/freeCompilerCamp/freecompilercamp.github.io/blob/master/CNAME
- lab.mydomain.com for PWC, the sandbox terminal using dockers, running on an AWS machine with <aws_ip>. It is forwarded to mydomain.com:5010
On the Godaddy website, go to the DNS setting of freecompilercamp.org
. Add new records and values
-
@
, It refers to domainsfreecompilercamp.org
., value set to<github_ip>
, Type A- github IPs have four values. So four entries are needed. 185.199.108.153, 185.199.109.153, 185.199.110.153, 185.199.111.153
-
www
, this is forwww.freecompilercamp.org
, value set tofreecompilercamp.github.io
, Type CNAME, pointing GitPages -
lab
, this is for lab.freecompilercamp.org, used for hosting the PWC engine, value set to<aws_ip>
, Type A -
.lab
, value set to<aws_ip>
Keep the rest sections as default values. Save and wait for one hour or more until the entries take effect.
Essentially we want establish the following forwarding relations
- lab:80 -> lab:5010
The PWD server exposes one special port.
-
<pt1>
: for the PWC sandbox server . We use port 5010 for the container running the PWC sandbox server
When a regular request from port 80 to sandbox is coming, we need first forward that request to the unique port <pt1>
. To do this, add the following code to Apache configuration, which is located at /etc/apache2/sites-available/000-default.conf
.
<VirtualHost *:80>
ServerName lab.freecompilercamp.org
ProxyPass / http://lab.freecompilercamp.org:5010/
</VirtualHost>
So, any access to lab.freecompilercamp.org
will be passed to lab.freecompilercamp.org:5010
.
Restart Apache server to apply the new configuration. Users don't need to handle any special port, they can input the original web address freecompilercamp.org
as usual. The server will automatically forward the requests to proper docker containers.