From ce3ee07ef0ae7dcbdf7fde76857df0e0854e6067 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 29 Mar 2022 14:39:09 +0000 Subject: [PATCH] [PATCH] Sam Therapy: Fix documentation FossilOrigin-Name: c16f8d24cc29da143040ea31ba49c4d72721e3317f2c542106c497b3101a65d7 --- docs/INSTALL.md | 21 +++++++++++---------- docs/sample/treebird.nginx.conf | 26 +++++++++++++------------- docs/sample/treebird.uwsgi.ini | 7 ------- 3 files changed, 24 insertions(+), 30 deletions(-) delete mode 100644 docs/sample/treebird.uwsgi.ini diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 78eab23..6e2f162 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -16,6 +16,7 @@ For the following GNU/Linux distributions, you will need the following libraries - Debian: `libpcre3-dev` - Void: `libpcre2` - libfcgi + - Debian: `libfcgi-dev` - Void: `fcgi fcgi-devel` Create a copy of `config.def.h` at `config.h`, edit the file with your information @@ -23,7 +24,7 @@ Create a copy of `config.def.h` at `config.h`, edit the file with your informati Run `make`. This will also clone mastodont-c, and compile both it and Treebird. If you `git pull` any changes, `make update` should be run after updating, as it ensures -the library is up to date. +that mastodont-c is up to date. ## Installation @@ -36,11 +37,11 @@ If this succeeds (assuming you used default variables), you can now find Treebir - `/usr/local/share/treebird/` - Contains CSS, images, and other meta files - `/usr/local/bin/treebird` - Regular executable CGI file, test it by running it as is, it'll spit HTML out! -### Using NGINX (and uWSGI) +### Using NGINX (and fcgiwrap) -Treebird can be served over nginx by using a CGI server such as uwsgi. +Treebird can be served over nginx by using a FastCGI server such as fcgiwrap. -The example static files will be in `/var/www/treebird/`, with `treebird.cgi` at `/usr/local/bin/treebird`. +The example static files will be in `/usr/local/share/treebird/`, with `treebird.cgi` at `/usr/local/bin/treebird`. After running `make`, Treebird's files will be in the `dist/` directory. _Copy_, ***DO NOT MOVE***, **everything but treebird.cgi** of this folder to your web server. Copy `treebird.cgi` to another directory of your choosing. @@ -49,13 +50,13 @@ An example nginx configuration is available in [treebird.nginx.conf](./sample/tr * Make sure to change `example.com` to your instance's domain. * Make sure to change the `root` to wherever the static files are being stored -#### uWSGI -uWSGI can be installed on debian with just `sudo apt isntall uwsgi`. +#### fcgiwrap +fcgiwrap can be installed on debian with `sudo apt install fcgiwrap`. -An example configuration is available in [treebird.uwsgi.ini](./sample/treebird.uwsgi.ini). This should be copied to `/etc/uwsgi/apps-enabled/treebird.ini` on debian (and potentially other) systems. - -##### Note: the uwsgi configuration file is currently very basic. +The example is using the default configuration included with the `fcgiwrap` package on Debian. ### Using Apache and mod_proxy_fcgi -TODO \ No newline at end of file +TODO + +Example Apache configuration is available in [treebird.apache.conf](./sample/treebird.apache.conf). \ No newline at end of file diff --git a/docs/sample/treebird.nginx.conf b/docs/sample/treebird.nginx.conf index bcf7b74..f2dcbff 100644 --- a/docs/sample/treebird.nginx.conf +++ b/docs/sample/treebird.nginx.conf @@ -1,38 +1,38 @@ server { - root /var/www/treebird; server_name treebird.example.com; location @treebird { - include uwsgi_params; - uwsgi_modifier1 9; - uwsgi_pass unix:///run/uwsgi/treebird.sock; + include fastcgi.conf; #Check your nginx installation for fastcgi.conf or fastcgi_param + fastcgi_param SCRIPT_FILENAME /usr/local/bin/treebird; # change this to the location of your treebird executable + fastcgi_param PATH_INFO $uri; + fastcgi_pass unix:/var/run/fcgiwrap.socket; } location / { - root /var/www/treebird; + root /usr/local/share/treebird; #Change this to the location of the static files try_files $uri @treebird; } - listen [::]:443 ssl; # managed by Certbot - listen 443 ssl; # managed by Certbot - ssl_certificate /etc/letsencrypt/live/treebird.example.com/fullchain.pem; # managed by Certbot - ssl_certificate_key /etc/letsencrypt/live/treebird.example.com/privkey.pem; # managed by Certbot - include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/treebird.example.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/treebird.example.com/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } server { if ($host = treebird.example.com) { return 301 https://$host$request_uri; - } # managed by Certbot + } listen 80; listen [::]:80; server_name treebird.example.com; - return 404; # managed by Certbot + return 404; } \ No newline at end of file diff --git a/docs/sample/treebird.uwsgi.ini b/docs/sample/treebird.uwsgi.ini deleted file mode 100644 index 5c47c69..0000000 --- a/docs/sample/treebird.uwsgi.ini +++ /dev/null @@ -1,7 +0,0 @@ -[uwsgi] -master = true -plugins = cgi -socket = /run/uwsgi/%n.sock -uid = www-data -gid = www-data -cgi = /usr/local/bin/treebird.cgi \ No newline at end of file