Setting up a new shared web proxy
Adding
- In ansible seed inventory repo, edit
hosts.ymland add the new host in all places an existing host exists. - Execute
sower --live generate:weborigin --parent hostxxx.mayfirst.orgto generate a new weborigin yaml file. - Follow regular kvm guest setup steps
Note: The next steps have to happen close together. After you run the first step, changes to any web configuration in the control panel will fail until you have completed the remaining steps.
- Run sower playbook with
--secrets --tags redagainstred001 - From the key server, copy all certs and keys to the new server:
mf-cert-distribute --send-to-server <webproxy> --copy-only --all-certsWarning: No output, and it takes a while! You can track progress by counting directories on the webproxy in/etc/ssl/mayfirst - On the control panel UI server, copy out all the ngninx configuratins (without a restart of nginx):
su - red -s /usr/local/share/red/ui/sbin/red-nginx-distribute --all --send-to-server <webproxy> - Manually restart nginx on the new web proxy server.
- Update nftables on all weborigin servers:
sower --live playbook --tags nftables weborigin00[1234567].mayfirst.org
Removing
- On the web proxy, run
mf-web-sites-resolving-hereto ensure no existing web sites are still resolving to this web proxy. - In ansible seed inventory repo, edit
hosts.ymland update them_web_proxy_serversvariable to remove the new host. - Run sower playbook with
--secrets --tags redagainstred001 - Run sower playbook with
--tags keystoreagainst ‘key001` - On the key server, remove from the sqlite file cache (replace “NNN” with the actual number):
sqlite3 /var/lib/mf-cert-distribute/dist.db "DELETE FROM file_sync WHERE name LIKE 'webproxyNNN%'"