From 82c2f9a9125a2046a65669870d2d8afd8419c147 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Tue, 14 Apr 2020 20:45:54 -0400 Subject: [PATCH] Removing flup and fastcgi from documentation flup is not supported on Python3, so MediaGoblin doesn't have a supported way to enable FastCGI support. This change removes all references to flup and FastCGI and updates deployment instructions to use simple HTTP forwarding with nginx to access mediagoblin's non-static resources. --- docs/source/siteadmin/configuration.rst | 4 +- docs/source/siteadmin/deploying.rst | 57 +++---------------- .../siteadmin/production-deployments.rst | 6 +- lazystarter.sh | 3 +- paste.ini | 6 -- 5 files changed, 14 insertions(+), 62 deletions(-) diff --git a/docs/source/siteadmin/configuration.rst b/docs/source/siteadmin/configuration.rst index 0cb04002..8962d5fa 100644 --- a/docs/source/siteadmin/configuration.rst +++ b/docs/source/siteadmin/configuration.rst @@ -39,8 +39,8 @@ paste.ini `_). It also sets up some middleware that you can mostly ignore, except to configure sessions... more on that later. If you are adding a different - Python server other than FastCGI / plain HTTP, you might configure - it here. You probably won't need to change this file very much. + Python server other than plain HTTP, you might configure it + here. You probably won't need to change this file very much. There's one more file that you certainly won't change unless you're diff --git a/docs/source/siteadmin/deploying.rst b/docs/source/siteadmin/deploying.rst index 42fe1772..f70ad6ce 100644 --- a/docs/source/siteadmin/deploying.rst +++ b/docs/source/siteadmin/deploying.rst @@ -25,7 +25,7 @@ will take you step-by-step through setting up your own instance of MediaGoblin. Of course, when it comes to setting up web applications like MediaGoblin, there's an almost infinite way to deploy things, so for now, we'll keep it simple with some assumptions. We recommend a setup that combines MediaGoblin + -virtualenv + FastCGI + Nginx on a .deb- or .rpm-based GNU/Linux distro. +virtualenv + Nginx on a .deb- or .rpm-based GNU/Linux distro. Other deployment options (e.g., deploying on FreeBSD, Arch Linux, using Apache, etc.) are possible, though! If you'd prefer a different deployment @@ -264,40 +264,6 @@ This directory will be used to store uploaded media files:: $ mkdir user_dev && chmod 750 user_dev -Assuming you are going to deploy with FastCGI, you should also install -flup:: - - $ ./bin/easy_install flup - -(Note, if you're running Python 2, which you probably are at this -point in MediaGoblin's development, you'll need to run:) - - $ ./bin/easy_install flup==1.0.3.dev-20110405 - -The above provides an in-package install of ``virtualenv``. While this -is counter to the conventional ``virtualenv`` configuration, it is -more reliable and considerably easier to configure and illustrate. If -you're familiar with Python packaging you may consider deploying with -your preferred method. - -.. note:: - - What if you don't want an in-package ``virtualenv``? Maybe you - have your own ``virtualenv``, or you are building a MediaGoblin - package for a distribution. There's no need necessarily for the - virtualenv produced by ``./configure && make`` by default other - than attempting to simplify work for developers and people - deploying by hiding all the virtualenv and bower complexity. - - If you want to install all of MediaGoblin's libraries - independently, that's totally fine! You can pass the flag - ``--without-virtualenv`` which will skip this step. - But you will need to install all those libraries manually and make - sure they are on your ``PYTHONPATH`` yourself! (You can still use - ``python setup.py develop`` to install some of those libraries, - but note that no ``./bin/python`` will be set up for you via this - method, since no virtualenv is set up for you!) - This concludes the initial configuration of the MediaGoblin environment. In the future, when you update your codebase, you should also run:: @@ -377,14 +343,13 @@ exit to return to the root/sudo account.:: .. _webserver-config: -FastCGI and nginx +nginx ~~~~~~~~~~~~~~~~~ This configuration example will use Nginx, however, you may -use any webserver of your choice as long as it supports the FastCGI -protocol. If you do not already have a web server, consider Nginx, as -the configuration files may be more clear than the -alternatives. +use any webserver of your choice. If you do not already have +a web server, consider Nginx, as the configuration files may +be more clear than the alternatives. Create a configuration file at ``/srv/mediagoblin.example.org/nginx.conf`` and create a symbolic link @@ -460,15 +425,9 @@ this ``nginx.conf`` file should be modeled on the following:: alias /srv/mediagoblin.example.org/mediagoblin/user_dev/plugin_static/; } - # Mounting MediaGoblin itself via FastCGI. + # Forward requests to the MediaGoblin app server. location / { - fastcgi_pass 127.0.0.1:26543; - include /etc/nginx/fastcgi_params; - - # our understanding vs Nginx's handling of script_name vs - # path_info don't match :) - fastcgi_param PATH_INFO $fastcgi_script_name; - fastcgi_param SCRIPT_NAME ""; + proxy_pass http://127.0.0.1:6543; } } @@ -502,7 +461,7 @@ example:: cd /srv/mediagoblin.example.org/mediagoblin/ su mediagoblin -s /bin/bash - ./lazyserver.sh --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 + ./lazyserver.sh --server-name=main Visit the site you've set up in your browser by visiting . You should see MediaGoblin! diff --git a/docs/source/siteadmin/production-deployments.rst b/docs/source/siteadmin/production-deployments.rst index 3d11f022..01794cdf 100644 --- a/docs/source/siteadmin/production-deployments.rst +++ b/docs/source/siteadmin/production-deployments.rst @@ -114,7 +114,7 @@ The second file should be named ``mediagoblin-paster.service``: --pid-file=/var/run/mediagoblin/mediagoblin.pid \ --log-file=/var/log/mediagoblin/mediagoblin.log \ --daemon \ - --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 + --server-name=main ExecStop=/srv/mediagoblin.example.org/mediagoblin/bin/paster serve \ --pid-file=/var/run/mediagoblin/mediagoblin.pid \ /srv/mediagoblin.example.org/mediagoblin/paste_local.ini stop @@ -165,7 +165,7 @@ basis for an init script: /srv/mediagoblin.example.org/mediagoblin/bin/paster serve \ /srv/mediagoblin.example.org/mediagoblin/paste.ini \ --pid-file=/var/run/mediagoblin.pid \ - --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 + --server-name=main The above configuration places MediaGoblin in "always eager" mode with Celery, this means that submissions of content will be processed @@ -181,7 +181,7 @@ as the basis for your script: /srv/mediagoblin.example.org/mediagoblin/bin/paster serve \ /srv/mediagoblin.example.org/mediagoblin/paste.ini \ --pid-file=/var/run/mediagoblin.pid \ - --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543 + --server-name=main Members of the MediaGoblin community have provided init scripts for the diff --git a/lazystarter.sh b/lazystarter.sh index b531b068..e0907def 100755 --- a/lazystarter.sh +++ b/lazystarter.sh @@ -38,8 +38,7 @@ if [ "$1" = "-h" ]; then echo "$0 [-h] [-c filename.ini] [ARGS_to_${starter_cmd} ...]" echo "" echo " For example:" - echo " $0 -c fcgi.ini port_number=23371" - echo " or: $0 --server-name=fcgi --log-file=paste.log" + echo " $0 --server-name=main --log-file=paste.log" echo "" echo " The configfile defaults to ${ini_prefix}_local.ini," echo " if that is readable, otherwise ${ini_prefix}.ini." diff --git a/paste.ini b/paste.ini index ce3f01e8..cbc37bba 100644 --- a/paste.ini +++ b/paste.ini @@ -74,12 +74,6 @@ use = egg:waitress#main host = 0.0.0.0 port = 6543 -# Use this if you want to connect via fastcgi -[server:fcgi] -use = egg:flup#fcgi_fork -host = %(fcgi_host)s -port = %(fcgi_port)s - [server:http] use = egg:waitress#main host = %(http_host)s -- 2.25.1