From 249f5da2693a12777c19289995b76a5778970c75 Mon Sep 17 00:00:00 2001 From: warrows Date: Wed, 10 May 2023 12:28:50 +0200 Subject: [PATCH] Doc : Add apache2 basic configuration to documentation Signed-off-by: warrows --- README.md | 15 +++++++++++++-- calckey.apache.conf | 13 +++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 calckey.apache.conf diff --git a/README.md b/README.md index d8fd284679..902bd5feeb 100644 --- a/README.md +++ b/README.md @@ -138,13 +138,24 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" For migrating from Misskey v13, Misskey v12, and Foundkey, read [this document](https://codeberg.org/calckey/calckey/src/branch/develop/docs/migrate.md). -## 🍀 NGINX +## Web proxy + +Choose between NGINX or Apache (we recommend NGINX) + +### 🍀 NGINX - Run `sudo cp ./calckey.nginx.conf /etc/nginx/sites-available/ && cd /etc/nginx/sites-available/` - Edit `calckey.nginx.conf` to reflect your instance properly - Run `sudo cp ./calckey.nginx.conf ../sites-enabled/` - Run `sudo nginx -t` to validate that the config is valid, then restart the NGINX service. +### Apache 2 + +- Run `sudo cp ./calckey.apache.conf /etc/apache2/sites-available/ && cd /etc/apache2/sites-available/` +- Edit `calckey.apache.conf` to reflect your instance properly +- Run `sudo a2ensite calckey.apache` to enable the site +- Run `sudo service apache2 restart` to reload apache2 configuration + ## 🚀 Build and launch! @@ -164,7 +175,7 @@ pm2 start "NODE_ENV=production pnpm run start" --name Calckey - When editing the config file, please don't fill out the settings at the bottom. They're designed *only* for managed hosting, not self hosting. Those settings are much better off being set in Calckey's control panel. - Port 3000 (used in the default config) might be already used on your server for something else. To find an open port for Calckey, run `for p in {3000..4000}; do ss -tlnH | tr -s ' ' | cut -d" " -sf4 | grep -q "${p}$" || echo "${p}"; done | head -n 1`. Replace 3000 with the minimum port and 4000 with the maximum port if you need it. -- I'd recommend you use a S3 Bucket/CDN for Object Storage, especially if you use Docker. +- I'd recommend you use a S3 Bucket/CDN for Object Storage, especially if you use Docker. - I'd ***strongly*** recommend against using CloudFlare, but if you do, make sure to turn code minification off. - For push notifications, run `npx web-push generate-vapid-keys`, then put the public and private keys into Control Panel > General > ServiceWorker. - For translations, make a [DeepL](https://deepl.com) account and generate an API key, then put it into Control Panel > General > DeepL Translation. diff --git a/calckey.apache.conf b/calckey.apache.conf new file mode 100644 index 0000000000..b0c69d51df --- /dev/null +++ b/calckey.apache.conf @@ -0,0 +1,13 @@ +# Replace example.tld with your domain + + + ServerName example.tld + # For WebSocket + ProxyPass "/streaming" "ws://127.0.0.1:3000/streaming/" + # Proxy to Node + ProxyPass "/" "http://127.0.0.1:3000/" + ProxyPassReverse "/" "http://127.0.0.1:3000/" + ProxyPreserveHost On + # For files proxy + AllowEncodedSlashes On + \ No newline at end of file