This commit is contained in:
Ben Sturmfels 2020-04-16 11:39:40 +10:00
commit 09c659785f
No known key found for this signature in database
GPG Key ID: 023C05E2C9C068F0
5 changed files with 14 additions and 62 deletions

View File

@ -39,8 +39,8 @@ paste.ini
<http://pythonpaste.org/script/>`_). It also sets up some <http://pythonpaste.org/script/>`_). It also sets up some
middleware that you can mostly ignore, except to configure middleware that you can mostly ignore, except to configure
sessions... more on that later. If you are adding a different sessions... more on that later. If you are adding a different
Python server other than FastCGI / plain HTTP, you might configure Python server other than Waitress / plain HTTP, you might configure it
it here. You probably won't need to change this file very much. 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 There's one more file that you certainly won't change unless you're

View File

@ -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, 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 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 + simple with some assumptions. We recommend a setup that combines MediaGoblin +
virtualenv + FastCGI + Nginx on a .deb- or .rpm-based GNU/Linux distro. virtualenv + Waitress + Nginx on a .deb- or .rpm-based GNU/Linux distro.
Other deployment options (e.g., deploying on FreeBSD, Arch Linux, using Other deployment options (e.g., deploying on FreeBSD, Arch Linux, using
Apache, etc.) are possible, though! If you'd prefer a different deployment 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 $ 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 This concludes the initial configuration of the MediaGoblin
environment. In the future, when you update your environment. In the future, when you update your
codebase, you should also run:: codebase, you should also run::
@ -377,14 +343,13 @@ exit to return to the root/sudo account.::
.. _webserver-config: .. _webserver-config:
FastCGI and nginx Waitress and nginx
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
This configuration example will use Nginx, however, you may This configuration example will use Nginx, however, you may
use any webserver of your choice as long as it supports the FastCGI use any webserver of your choice. If you do not already have
protocol. If you do not already have a web server, consider Nginx, as a web server, consider Nginx, as the configuration files may
the configuration files may be more clear than the be more clear than the alternatives.
alternatives.
Create a configuration file at Create a configuration file at
``/srv/mediagoblin.example.org/nginx.conf`` and create a symbolic link ``/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/; alias /srv/mediagoblin.example.org/mediagoblin/user_dev/plugin_static/;
} }
# Mounting MediaGoblin itself via FastCGI. # Forward requests to the MediaGoblin app server.
location / { location / {
fastcgi_pass 127.0.0.1:26543; proxy_pass http://127.0.0.1:6543;
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 "";
} }
} }
@ -502,7 +461,7 @@ example::
cd /srv/mediagoblin.example.org/mediagoblin/ cd /srv/mediagoblin.example.org/mediagoblin/
su mediagoblin -s /bin/bash 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 Visit the site you've set up in your browser by visiting
<http://mediagoblin.example.org>. You should see MediaGoblin! <http://mediagoblin.example.org>. You should see MediaGoblin!

View File

@ -114,7 +114,7 @@ The second file should be named ``mediagoblin-paster.service``:
--pid-file=/var/run/mediagoblin/mediagoblin.pid \ --pid-file=/var/run/mediagoblin/mediagoblin.pid \
--log-file=/var/log/mediagoblin/mediagoblin.log \ --log-file=/var/log/mediagoblin/mediagoblin.log \
--daemon \ --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 \ ExecStop=/srv/mediagoblin.example.org/mediagoblin/bin/paster serve \
--pid-file=/var/run/mediagoblin/mediagoblin.pid \ --pid-file=/var/run/mediagoblin/mediagoblin.pid \
/srv/mediagoblin.example.org/mediagoblin/paste_local.ini stop /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/bin/paster serve \
/srv/mediagoblin.example.org/mediagoblin/paste.ini \ /srv/mediagoblin.example.org/mediagoblin/paste.ini \
--pid-file=/var/run/mediagoblin.pid \ --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 The above configuration places MediaGoblin in "always eager" mode
with Celery, this means that submissions of content will be processed 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/bin/paster serve \
/srv/mediagoblin.example.org/mediagoblin/paste.ini \ /srv/mediagoblin.example.org/mediagoblin/paste.ini \
--pid-file=/var/run/mediagoblin.pid \ --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 Members of the MediaGoblin community have provided init scripts for the

View File

@ -38,8 +38,7 @@ if [ "$1" = "-h" ]; then
echo "$0 [-h] [-c filename.ini] [ARGS_to_${starter_cmd} ...]" echo "$0 [-h] [-c filename.ini] [ARGS_to_${starter_cmd} ...]"
echo "" echo ""
echo " For example:" echo " For example:"
echo " $0 -c fcgi.ini port_number=23371" echo " $0 --server-name=main --log-file=paste.log"
echo " or: $0 --server-name=fcgi --log-file=paste.log"
echo "" echo ""
echo " The configfile defaults to ${ini_prefix}_local.ini," echo " The configfile defaults to ${ini_prefix}_local.ini,"
echo " if that is readable, otherwise ${ini_prefix}.ini." echo " if that is readable, otherwise ${ini_prefix}.ini."

View File

@ -74,12 +74,6 @@ use = egg:waitress#main
host = 0.0.0.0 host = 0.0.0.0
port = 6543 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] [server:http]
use = egg:waitress#main use = egg:waitress#main
host = %(http_host)s host = %(http_host)s