Use of deprecated frombytes when processing videos causes the task to fail
[mediagoblin.git] / docs / source / siteadmin / deploying.rst
index 814316b1e3736cba4b5bf16864ad0ad95295f559..13429fc44f6a0fe4d961a2d3175ed5778229b332 100644 (file)
@@ -69,14 +69,15 @@ On a DEB-based system (e.g Debian, gNewSense, Trisquel, Ubuntu, and
 derivatives) issue the following command::
 
     sudo apt-get install git-core python python-dev python-lxml \
-        python-imaging python-virtualenv npm nodejs-legacy automake
+        python-imaging python-virtualenv npm nodejs-legacy automake \
+        nginx
 
 On a RPM-based system (e.g. Fedora, RedHat, and derivatives) issue the
 following command::
 
     sudo yum install python-paste-deploy python-paste-script \
         git-core python python-devel python-lxml python-imaging \
-        python-virtualenv npm automake
+        python-virtualenv npm automake nginx
 
 Configure PostgreSQL
 ~~~~~~~~~~~~~~~~~~~~
@@ -98,11 +99,13 @@ These are the packages needed for an RPM-based system::
 
     sudo yum install postgresql postgresql-server python-psycopg2
 
-An rpm-based system also requires that you initialize the PostgresSQL database
-with this command. The following command is not needed on a Debian-based
-platform, however::
+An rpm-based system also requires that you initialize and start the
+PostgresSQL database with a few commands. The following commands are
+not needed on a Debian-based platform, however::
 
     sudo /usr/bin/postgresql-setup initdb
+    sudo systemctl enable postgresql
+    sudo systemctl start postgresql
 
 The installation process will create a new *system* user named ``postgres``,
 which will have privilegies sufficient to manage the database. We will create a
@@ -134,11 +137,6 @@ Type ``exit`` to exit from the 'postgres' user account.::
 
     exit
 
-From here we just need to set the Postgres database to start on boot, and also
-start it up for this particular session.::
-
-    sudo systemctl enable postgresql && sudo systemctl start postgresql
-
 .. caution:: Where is the password?
 
     These steps enable you to authenticate to the database in a password-less
@@ -162,10 +160,25 @@ helps to keep it more secure.
 
 The following command (entered as root or with sudo) will create a
 system account with a username of ``mediagoblin``. You may choose a different
-username if you wish.::
+username if you wish.
+
+If you are using a Debian-based system, enter this command::
+
+    sudo useradd -c "GNU MediaGoblin system account" -d /var/lib/mediagoblin -m -r -g www-data mediagoblin
 
-    sudo useradd -c "GNU MediaGoblin system account" -d /home/mediagoblin -U -m -r mediagoblin
+If you are using an RPM-based system, enter this command::
 
+    sudo useradd -c "GNU MediaGoblin system account" -d /var/lib/mediagoblin -m -r -g nginx mediagoblin
+
+This will create a ``mediagoblin`` user and assign it to a group that is
+associated with the web server. This will ensure that the web server can
+read the media files (images, videos, etc.) that users upload.
+
+We will also create a ``mediagoblin`` group and associate the mediagoblin
+user with that group, as well::
+  
+    sudo groupadd mediagoblin && sudo usermod --append -G mediagoblin mediagoblin
+       
 No password will be assigned to this account, and you will not be able
 to log in as this user. To switch to this account, enter::
 
@@ -188,10 +201,14 @@ Setting up the working directory requires that we first create the directory
 with elevated priviledges, and then assign ownership of the directory
 to the unpriviledged system account.
 
-To do this, enter either of the following commands, changing the defaults
-to suit your particular requirements::
+To do this, enter the following command, changing the defaults to suit your
+particular requirements. On a Debian-based platform you will enter this::
+
+    sudo mkdir -p /srv/mediagoblin.example.org && sudo chown -hR mediagoblin:www-data /srv/mediagoblin.example.org
+
+On an RPM-based distribution, enter this command::
 
-    sudo mkdir -p /srv/mediagoblin.example.org && sudo chown -hR mediagoblin: /srv/mediagoblin.example.org
+    sudo mkdir -p /srv/mediagoblin.example.org && sudo chown -hR mediagoblin:nginx /srv/mediagoblin.example.org
 
 .. note::
 
@@ -352,14 +369,12 @@ one of the following commands.
 On a DEB-based system (e.g Debian, gNewSense, Trisquel, Ubuntu, and
 derivatives) issue the following commands::
 
-    sudo apt-get install nginx
     sudo ln -s /srv/mediagoblin.example.org/nginx.conf /etc/nginx/sites-enabled/
     sudo systemctl enable nginx
 
 On a RPM-based system (e.g. Fedora, RedHat, and derivatives) issue the
 following commands::
 
-    sudo yum install nginx
     sudo ln -s /srv/mediagoblin.example.org/nginx.conf /etc/nginx/conf.d/
     sudo systemctl enable nginx