From 2f90138d1170a46415a22f85df9c399381dda0ab Mon Sep 17 00:00:00 2001 From: lijunbo Date: Fri, 22 Dec 2017 11:21:46 +0800 Subject: [PATCH] Add mod_wsgi configuration samples Extend docs on running manila API with a web server (Apache, NGINX) Add samples for mod_wsgi Partially-implements: blueprint wsgi-web-servers-support Change-Id: Ic756466e65ffd8b5fc6b8e8fb3eef4b8535b46d6 (cherry picked from commit c1912b70f69bc59c1aaf047a556868d0e27e3518) (cherry picked from commit eac41910c041cca3583e1e94a9dfbaf7e3229fdd) (cherry picked from commit 3d2820c35400debd4bb759fbc3e5ca4dfb948b0f) --- doc/source/contributor/apache-httpd.rst | 40 +++++++++++++++++++++++++ doc/source/contributor/index.rst | 1 - httpd/mod_wsgi-manila.conf | 16 ++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 httpd/mod_wsgi-manila.conf diff --git a/doc/source/contributor/apache-httpd.rst b/doc/source/contributor/apache-httpd.rst index 29f22a9e04..7d67244474 100644 --- a/doc/source/contributor/apache-httpd.rst +++ b/doc/source/contributor/apache-httpd.rst @@ -76,4 +76,44 @@ And start the manila server using uwsgi:: In the sample configs port 51999 is used, this is a randomly selected number. +Installing the API via mod_wsgi +------------------------------- + +The httpd/ directory contains sample files for configuring HTTPD to run manila +API via mod_wsgi. To use sample configs, simply copy `httpd/mod_wsgi-manila.conf` to the +appropiate location for your apache server. + +On RHEL/CentOS/Fedora it is:: + + /etc/httpd/conf.d/mod_wsgi-manila.conf + +On SLES/OpenSUSE it is:: + + /etc/apache2/vhosts.d/mod_wsgi-manila.conf + +On Debian/Ubuntu it is:: + + /etc/apache2/sites-available/mod_wsgi-manila.conf + +On Ubuntu/Debian systems enable the site using the a2ensite tool:: + + sudo a2ensite /etc/apache2/sites-available/mod_wsgi-manila.conf + +This is not required on RHEL/CentOS/Fedora systems. + +Start or restart HTTPD/Apache2 to pick up the new configuration. + +.. NOTE:: + + manila's primary configuration file (etc/manila.conf) and the PasteDeploy + configuration file (etc/manila-paste.ini) must be readable to httpd in one + of the default locations described in Configuring Manila. + +Access Control +-------------- + +If you are running with Linux kernel security module enabled (for example +SELinux or AppArmor), make sure that the configuration file has the +appropriate context to access the linked file. + .. _community goals for Pike: https://governance.openstack.org/tc/goals/pike/deploy-api-in-wsgi.html#control-plane-api-endpoints-deployment-via-wsgi diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst index fa18d3b09f..2356a91f07 100644 --- a/doc/source/contributor/index.rst +++ b/doc/source/contributor/index.rst @@ -39,7 +39,6 @@ Programming HowTos and Tutorials user_messages ganesha - Background Concepts for manila ------------------------------ .. toctree:: diff --git a/httpd/mod_wsgi-manila.conf b/httpd/mod_wsgi-manila.conf new file mode 100644 index 0000000000..739048e41f --- /dev/null +++ b/httpd/mod_wsgi-manila.conf @@ -0,0 +1,16 @@ +Listen 8786 +LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)" manila_combined + + + WSGIDaemonProcess osapi_share processes=2 threads=1 user=manila display-name=%{GROUP} + WSGIProcessGroup osapi_share + WSGIScriptAlias / /var/www/cgi-bin/manila/osapi_share + WSGIApplicationGroup %{GLOBAL} + WSGIPassAuthorization On + = 2.4> + ErrorLogFormat "%{cu}t %M" + + ErrorLog /var/log/apache2/manila_error.log + CustomLog /var/log/apache2/manila.log manila_combined + +