From 7a0ea511356b7a649cb91681f77ab8410289ce7a Mon Sep 17 00:00:00 2001 From: Brian Pitts Date: Tue, 25 Mar 2014 21:43:31 -0500 Subject: [PATCH 1/2] Add Fedora examples and change permissions recommendations. --- README.rst | 49 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index 0537391..83033a7 100644 --- a/README.rst +++ b/README.rst @@ -55,8 +55,9 @@ This will install Puppetboard and take care of the dependencies. If you do this Puppetboard will be installed in the so called site-packages or dist-packages of your Python distribution. -The complete path on Debian systems would be: -``/usr/local/lib/python2.X/lib/dist-packages/puppetboard``. +The complete path on Debian and Ubuntu systems would be ``/usr/local/lib/pythonX.Y/lib/dist-packages/puppetboard`` and on Fedora would be ``/usr/lib/pythonX.Y/lib/site-packages/puppetboard`` + +where X and Y are replaced by your major and minor python versions. You will need this path in order to configure your HTTPD and WSGI-capable application server. @@ -201,12 +202,11 @@ First we need to create the necessary directories: .. code-block:: bash $ mkdir -p /var/www/puppetboard - $ chown www-data:www-data /var/www/puppetboard Copy Puppetboard's ``default_settings.py`` to the newly created puppetboard directory and name the file ``settings.py``. This file will be available at the path Puppetboard was installed, for example: -``/usr/local/lib/python2.X/lib/dist-packages/puppetboard/default_settings.py``. +``/usr/local/lib/python2.7/lib/dist-packages/puppetboard/default_settings.py``. Change the settings that need changing to match your environment and delete or comment with a ``#`` the rest of the entries. @@ -226,9 +226,11 @@ puppetboard directory: os.environ['PUPPETBOARD_SETTINGS'] = '/var/www/puppetboard/settings.py' from puppetboard.app import app as application -Make sure this file is owned by the user and group the webserver runs as. +Make sure this file is readable by the user the webserver runs as. -The last thing we need to do is configure Apache: +The last thing we need to do is configure Apache. + +Here is a sample configuration for Debian and Ubuntu: .. code-block:: apache @@ -239,9 +241,9 @@ The last thing we need to do is configure Apache: ErrorLog /var/log/apache2/puppetboard.error.log CustomLog /var/log/apache2/puppetboard.access.log combined - Alias /static /usr/local/lib/python2.X/dist-packages/puppetboard/static + Alias /static /usr/local/lib/python2.7/dist-packages/puppetboard/static - + WSGIProcessGroup puppetboard WSGIApplicationGroup %{GLOBAL} Order deny,allow @@ -249,6 +251,27 @@ The last thing we need to do is configure Apache: +Here is a sample configuration for Fedora: + +.. code-block:: apache + + + ServerName puppetboard.example.tld + WSGIDaemonProcess puppetboard user=apache group=apache threads=5 + WSGIScriptAlias / /var/www/puppetboard/wsgi.py + ErrorLog /var/log/httpd/puppetboard.error.log + CustomLog /var/log/httpd/puppetboard.access.log combined + + Alias /static /usr/lib/python2.7/site-packages/puppetboard/static + + + WSGIProcessGroup puppetboard + WSGIApplicationGroup %{GLOBAL} + Require all granted + + + + Note the directory path, it's the path to where pip installed Puppetboard. We also alias the ``/static`` path so that Apache will serve the static files like the included CSS and Javascript. @@ -269,12 +292,11 @@ First we need to create the necessary directories: .. code-block:: bash $ mkdir -p /var/www/puppetboard/{tmp,public} - $ chown -R www-data:www-data /var/www/puppetboard Copy Puppetboard's ``default_settings.py`` to the newly created puppetboard directory and name the file ``settings.py``. This file will be available at the path Puppetboard was installed, for example: -``/usr/local/lib/python2.X/lib/dist-packages/puppetboard/default_settings.py``. +``/usr/local/lib/python2.7/lib/dist-packages/puppetboard/default_settings.py``. Change the settings that need changing to match your environment and delete or comment with a ``#`` the rest of the entries. @@ -318,7 +340,7 @@ Now the only thing left to do is configure Apache: CustomLog /var/log/apache2/puppetboard.access.log combined RackAutoDetect On - Alias /static /usr/local/lib/python2.X/dist-packages/puppetboard/static + Alias /static /usr/local/lib/python2.7/dist-packages/puppetboard/static Note the ``/static`` alias path, it's the path to where pip installed @@ -340,12 +362,11 @@ First we need to create the necessary directories: .. code-block:: bash $ mkdir -p /var/www/puppetboard - $ chown www-data:www-data /var/www/puppetboard Copy Puppetboard's ``default_settings.py`` to the newly created puppetboard directory and name the file ``settings.py``. This file will be available at the path Puppetboard was installed, for example: -``/usr/local/lib/python2.X/lib/dist-packages/puppetboard/default_settings.py``. +``/usr/local/lib/python2.7/lib/dist-packages/puppetboard/default_settings.py``. Change the settings that need changing to match your environment and delete or comment with a ``#`` the rest of the entries. @@ -390,7 +411,7 @@ The last thing we need to do is configure nginx to proxy the requests: charset utf-8; location /static { - alias /usr/local/lib/python2.X/dist-packages/puppetboard/static; + alias /usr/local/lib/python2.7/dist-packages/puppetboard/static; } location / { From a87a359b571436c3cbb0a463945ee11ecbb0f78d Mon Sep 17 00:00:00 2001 From: Brian Pitts Date: Wed, 26 Mar 2014 10:40:43 -0500 Subject: [PATCH 2/2] Use X.Y as placeholder for python version --- README.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 83033a7..8284cf9 100644 --- a/README.rst +++ b/README.rst @@ -206,7 +206,7 @@ First we need to create the necessary directories: Copy Puppetboard's ``default_settings.py`` to the newly created puppetboard directory and name the file ``settings.py``. This file will be available at the path Puppetboard was installed, for example: -``/usr/local/lib/python2.7/lib/dist-packages/puppetboard/default_settings.py``. +``/usr/local/lib/pythonX.Y/lib/dist-packages/puppetboard/default_settings.py``. Change the settings that need changing to match your environment and delete or comment with a ``#`` the rest of the entries. @@ -241,9 +241,9 @@ Here is a sample configuration for Debian and Ubuntu: ErrorLog /var/log/apache2/puppetboard.error.log CustomLog /var/log/apache2/puppetboard.access.log combined - Alias /static /usr/local/lib/python2.7/dist-packages/puppetboard/static + Alias /static /usr/local/lib/pythonX.Y/dist-packages/puppetboard/static - + WSGIProcessGroup puppetboard WSGIApplicationGroup %{GLOBAL} Order deny,allow @@ -262,9 +262,9 @@ Here is a sample configuration for Fedora: ErrorLog /var/log/httpd/puppetboard.error.log CustomLog /var/log/httpd/puppetboard.access.log combined - Alias /static /usr/lib/python2.7/site-packages/puppetboard/static + Alias /static /usr/lib/pythonX.Y/site-packages/puppetboard/static - + WSGIProcessGroup puppetboard WSGIApplicationGroup %{GLOBAL} Require all granted @@ -272,9 +272,9 @@ Here is a sample configuration for Fedora: -Note the directory path, it's the path to where pip installed Puppetboard. We -also alias the ``/static`` path so that Apache will serve the static files -like the included CSS and Javascript. +Note the directory path, it's the path to where pip installed Puppetboard; X.Y +must be replaced with your python version. We also alias the ``/static`` path +so that Apache will serve the static files like the included CSS and Javascript. Apache + mod_passenger ^^^^^^^^^^^^^^^^^^^^^^ @@ -296,7 +296,7 @@ First we need to create the necessary directories: Copy Puppetboard's ``default_settings.py`` to the newly created puppetboard directory and name the file ``settings.py``. This file will be available at the path Puppetboard was installed, for example: -``/usr/local/lib/python2.7/lib/dist-packages/puppetboard/default_settings.py``. +``/usr/local/lib/pythonX.Y/lib/dist-packages/puppetboard/default_settings.py``. Change the settings that need changing to match your environment and delete or comment with a ``#`` the rest of the entries. @@ -340,7 +340,7 @@ Now the only thing left to do is configure Apache: CustomLog /var/log/apache2/puppetboard.access.log combined RackAutoDetect On - Alias /static /usr/local/lib/python2.7/dist-packages/puppetboard/static + Alias /static /usr/local/lib/pythonX.Y/dist-packages/puppetboard/static Note the ``/static`` alias path, it's the path to where pip installed @@ -366,7 +366,7 @@ First we need to create the necessary directories: Copy Puppetboard's ``default_settings.py`` to the newly created puppetboard directory and name the file ``settings.py``. This file will be available at the path Puppetboard was installed, for example: -``/usr/local/lib/python2.7/lib/dist-packages/puppetboard/default_settings.py``. +``/usr/local/lib/pythonX.Y/lib/dist-packages/puppetboard/default_settings.py``. Change the settings that need changing to match your environment and delete or comment with a ``#`` the rest of the entries. @@ -411,7 +411,7 @@ The last thing we need to do is configure nginx to proxy the requests: charset utf-8; location /static { - alias /usr/local/lib/python2.7/dist-packages/puppetboard/static; + alias /usr/local/lib/pythonX.Y/dist-packages/puppetboard/static; } location / {