@ -130,11 +130,97 @@ If your service brings down the apache server, please disable your site.
### Alternative backend server or other complex configuration
### Alternative backend server
**Use this configuration if you are using Flask or a custom socket server.**
To configure your static website with a TCP socket backend, clone your website to `/var/www/<myapp>`, as seen above, and your application code to `/opt/<myapp>`. For example, while in the `/var/www` folder, run:
Once you finish all of that, become root on the system, and run the following:
Create a new file called `<myapp>.conf` in this folder.
Inside that, add some content like this:
# Service: myapp
ProxyPass /api http://localhost:99999
ProxyPassReverse /api http://localhost:99999
Here's the explanation of the various parts of the above configuration:
* `VirtualHost *:80`: Listen on port 80 on any IP(v4?) address
* `DocumentRoot "/var/www/myapp"`: Set the document location root to `/vrestore the file from a backup.ar/www/myapp`. Say that you have a file called `index.html` at `/var/www/myapp/index.html`, with the value set here, you will find your `index.html` at `http://myapp.cslabs.clarkson.edu/index.html`
* `ServerName myapp.cslabs.clarkson.edu`: Sets the default server name to listen for when specified by your browser from DNS with the `Host:` HTTP field.
* `ServerAlias myapp.cosi.clarkson.edu`: Additional server names to listen for on the website, if they mach, you will get directed here the same way as with `ServerName`. This field is optional, `ServerName` is not.
* `ProxyPreserveHost on`: Preserve hostname in queries while passing to socket.
* `ProxyPass /api http://loclahost:99999`: Pass the `/api` url (and all below it) to the proxy specified