negativefour consists of the following services
www
- negativefour.com or www.negativefour.comserve
- serve.negativefour.comThis is a standard express application using the pug templating engine. This is the frontend that users are expected to interact with.
It is run by a systemd service called negativefour.com
and has the
following configuration:
[Unit]
Description=The negativefour website
[Service]
User=admin
Group=admin
WorkingDirectory=/home/admin/negativefour/www
ExecStart=npm start
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
www runs on port 2999. In order to deliver traffic to it we use
apache2 as a reverse proxy via the following configuration in
/etc/apache2/sites-avaliable/negativefour.com.conf
:
<VirtualHost *:80>
ServerAdmin zekemedley@gmail.com
ProxyPreserveHost On
ProxyRequests Off
ServerName www.negativefour.com
ServerAlias negativefour.com
ProxyPass / http://localhost:2999/
ProxyPassReverse / http://localhost:2999/
</VirtualHost>
In addition to the apache2 reverse proxy we also proxy traffic to this endpoint through Cloudflare hence the lack of a SSL config.
This is an api with no frontend which processes requests to deploy and
undeploy webpages. Webpages deployed by this endpoint are deployed to
<NAME>.negativefour.app
.
The systemd and apache configs for this service are as follows:
/etc/systemd/system/serve.negativefour.com.service
[Unit]
Description=The negativefour deployment managment endpoint
[Service]
User=root
Group=root
WorkingDirectory=/home/admin/negativefour/serve
ExecStart=node app.js
Restart=always
RestartSec=1
[Install]
WantedBy=multi-user.target
/etc/apache2/sites-available/serve.negativefour.com.conf
<VirtualHost *:80>
ServerAdmin zekemedley@gmail.com
ProxyPreserveHost On
ProxyRequests Off
ServerName serve.negativefour.com
ProxyPass / http://localhost:2998/
ProxyPassReverse / http://localhost:2998/
</VirtualHost>