Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
server_deployment.html438 linesDownload Raw Back to html
1
2
3<!DOCTYPE html>
4
5<html lang="en" data-content_root="./">
6  <head>
7    <meta charset="utf-8" />
8    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
9
10    <title>Server Deployment &#8212; pgAdmin 4 8.6 documentation</title>
11    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
12    <link rel="stylesheet" type="text/css" href="_static/style.css?v=d36593c3" />
13    
14    <script src="_static/documentation_options.js?v=d4c83366"></script>
15    <script src="_static/doctools.js?v=9a2dae69"></script>
16    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
17    
18    <script src="_static/sidebar.js"></script>
19    
20    <link rel="index" title="Index" href="genindex.html" />
21    <link rel="search" title="Search" href="search.html" />
22    <link rel="next" title="Container Deployment" href="container_deployment.html" />
23    <link rel="prev" title="Desktop Deployment" href="desktop_deployment.html" /> 
24  </head><body>
25    <div class="related" role="navigation" aria-label="related navigation">
26      <h3>Navigation</h3>
27      <ul>
28        <li class="right" style="margin-right: 10px">
29          <a href="genindex.html" title="General Index"
30             accesskey="I">index</a></li>
31        <li class="right" >
32          <a href="container_deployment.html" title="Container Deployment"
33             accesskey="N">next</a> |</li>
34        <li class="right" >
35          <a href="desktop_deployment.html" title="Desktop Deployment"
36             accesskey="P">previous</a> |</li>
37        <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> &#187;</li>
38          <li class="nav-item nav-item-1"><a href="getting_started.html" >Getting Started</a> &#187;</li>
39          <li class="nav-item nav-item-2"><a href="deployment.html" accesskey="U">Deployment</a> &#187;</li>
40        <li class="nav-item nav-item-this"><a href="">Server Deployment</a></li> 
41      </ul>
42    </div>  
43
44    <div class="document">
45      <div class="documentwrapper">
46        <div class="bodywrapper">
47          <div class="body" role="main">
48            
49  <section id="server-deployment">
50<span id="id1"></span><h1><span class="target" id="index-0"></span>Server Deployment<a class="headerlink" href="#server-deployment" title="Link to this heading">¶</a></h1>
51<p>pgAdmin may be deployed as a web application by configuring the app to run in
52server mode and then deploying it either behind a webserver running as a reverse
53proxy, or using the WSGI interface.</p>
54<p>When deployed in server mode, there are two notable differences for users:</p>
55<ul class="simple">
56<li><p>Users must login before they can use pgAdmin. An initial superuser account
57is created when server mode is initialised, and this user can add additional
58superusers and non-superusers as required.</p></li>
59<li><p>File storage is restricted to a virtual root directory for each individual
60user under the directory configured using the <code class="docutils literal notranslate"><span class="pre">STORAGE_DIR</span></code> configuration
61parameter. Users do not have access to the complete filesystem of the server.</p></li>
62</ul>
63<p>The following instructions demonstrate how pgAdmin may be run as a WSGI
64application under <code class="docutils literal notranslate"><span class="pre">Apache</span> <span class="pre">HTTPD</span></code>, using <code class="docutils literal notranslate"><span class="pre">mod_wsgi</span></code>, standalone using <code class="docutils literal notranslate"><span class="pre">uWSGI</span></code>
65or <code class="docutils literal notranslate"><span class="pre">Gunicorn</span></code>, or under <code class="docutils literal notranslate"><span class="pre">NGINX</span></code> using using <code class="docutils literal notranslate"><span class="pre">uWSGI</span></code> or <code class="docutils literal notranslate"><span class="pre">Gunicorn</span></code>.</p>
66<div class="admonition seealso">
67<p class="admonition-title">See also</p>
68<p>For detailed instructions on building and configuring pgAdmin from
69scratch, please see the README file in the top level directory of the source code.
70For convenience, you can find the latest version of the file
71<a class="reference external" href="https://github.com/pgadmin-org/pgadmin4/blob/master/README.md">here</a>,
72but be aware that this may differ from the version included with the source code
73for a specific version of pgAdmin.</p>
74</div>
75<section id="requirements">
76<h2>Requirements<a class="headerlink" href="#requirements" title="Link to this heading">¶</a></h2>
77<p><strong>Important</strong>: Some components of pgAdmin require the ability to maintain affinity
78between client sessions and a specific database connection (for example, the
79Query Tool in which the user might run a BEGIN command followed by a number of
80DML SQL statements, and then a COMMIT). pgAdmin has been designed with built-in
81connection management to handle this, however it requires that only a single
82Python process is used because it is not easily possible to maintain affinity
83between a client session and one of multiple WSGI worker processes.</p>
84<p>On Windows systems, the Apache HTTP server uses a single process, multi-threaded
85architecture. WSGI applications run in <code class="docutils literal notranslate"><span class="pre">embedded</span></code> mode, which means that only
86a single process will be present on this platform in all cases.</p>
87<p>On Unix systems, the Apache HTTP server typically uses a multi-process, single
88threaded architecture (this is dependent on the <code class="docutils literal notranslate"><span class="pre">MPM</span></code> that is chosen at
89compile time). If <code class="docutils literal notranslate"><span class="pre">embedded</span></code> mode is chosen for the WSGI application, then
90there will be one Python environment for each Apache process, each with it’s own
91connection manager which will lead to loss of connection affinity. Therefore
92one should use <code class="docutils literal notranslate"><span class="pre">mod_wsgi</span></code>’s <code class="docutils literal notranslate"><span class="pre">daemon</span></code> mode, configured to use a single
93process. This will launch a single instance of the WSGI application which is
94utilised by all the Apache worker processes.</p>
95<p>Whilst it is true that this is a potential performance bottleneck, in reality
96pgAdmin is not a web application that’s ever likely to see heavy traffic
97unlike a busy website, so in practice should not be an issue.</p>
98<p>Future versions of pgAdmin may introduce a shared connection manager process to
99overcome this limitation, however that is a significant amount of work for
100little practical gain.</p>
101</section>
102<section id="configuration">
103<h2>Configuration<a class="headerlink" href="#configuration" title="Link to this heading">¶</a></h2>
104<p>In order to configure pgAdmin to run in server mode, it may be necessary to
105configure the Python code to run in multi-user mode, and then to configure the
106web server to find and execute the code.</p>
107<p>See <a class="reference internal" href="config_py.html#config-py"><span class="std std-ref">The config.py File</span></a> for more information on configuration settings.</p>
108<section id="python">
109<h3>Python<a class="headerlink" href="#python" title="Link to this heading">¶</a></h3>
110<p>From pgAdmin 4 v2 onwards, server mode is the default configuration. If running under
111the desktop runtime, this is overridden automatically. There should typically be no
112need to modify the configuration simply to enable server mode to work, however it may
113be desirable to adjust some of the paths used.</p>
114<p>In order to configure the Python code, follow these steps:</p>
115<ol class="arabic">
116<li><p>Create a <code class="docutils literal notranslate"><span class="pre">config_local.py</span></code> file alongside the existing <code class="docutils literal notranslate"><span class="pre">config.py</span></code> file.</p></li>
117<li><p>Edit <code class="docutils literal notranslate"><span class="pre">config_local.py</span></code> and add the following settings. In most cases, the default
118file locations should be appropriate:</p>
119<p><em>NOTE: You must ensure the directories specified are writeable by
120the user that the web server processes will be running as, e.g. apache or www-data.
121You may specify DATA_DIR in order to create all required directories and files
122under DATA_DIR folder.</em></p>
123<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">LOG_FILE</span> <span class="o">=</span> <span class="s1">&#39;/var/log/pgadmin4/pgadmin4.log&#39;</span>
124<span class="n">SQLITE_PATH</span> <span class="o">=</span> <span class="s1">&#39;/var/lib/pgadmin4/pgadmin4.db&#39;</span>
125<span class="n">SESSION_DB_PATH</span> <span class="o">=</span> <span class="s1">&#39;/var/lib/pgadmin4/sessions&#39;</span>
126<span class="n">STORAGE_DIR</span> <span class="o">=</span> <span class="s1">&#39;/var/lib/pgadmin4/storage&#39;</span>
127<span class="n">AZURE_CREDENTIAL_CACHE_DIR</span> <span class="o">=</span> <span class="s1">&#39;/var/lib/pgadmin4/azurecredentialcache&#39;</span>
128<span class="n">KERBEROS_CCACHE_DIR</span> <span class="o">=</span> <span class="s1">&#39;/var/lib/pgadmin4/kerberoscache&#39;</span>
129</pre></div>
130</div>
131</li>
132</ol>
133<ol class="arabic" start="4">
134<li><p>Run the following command to create the configuration database:</p>
135<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># python setup.py setup-db</span>
136</pre></div>
137</div>
138</li>
139<li><p>Change the ownership of the configuration database to the user that the web server
140processes will run as, for example, assuming that the web server runs as user
141www-data in group www-data, and that the SQLite path is <code class="docutils literal notranslate"><span class="pre">/var/lib/pgadmin4/pgadmin4.db</span></code>:</p>
142<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># chown www-data:www-data /var/lib/pgadmin4/pgadmin4.db</span>
143</pre></div>
144</div>
145</li>
146</ol>
147</section>
148</section>
149<section id="hosting">
150<h2>Hosting<a class="headerlink" href="#hosting" title="Link to this heading">¶</a></h2>
151<p>There are many possible ways to host pgAdmin in server mode. Some examples are
152given below:</p>
153<section id="apache-httpd-configuration-windows">
154<h3>Apache HTTPD Configuration (Windows)<a class="headerlink" href="#apache-httpd-configuration-windows" title="Link to this heading">¶</a></h3>
155<p>Once Apache HTTP has been configured to support <code class="docutils literal notranslate"><span class="pre">mod_wsgi</span></code>, the pgAdmin
156application may be configured similarly to the example below:</p>
157<div class="highlight-apache notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;VirtualHost</span><span class="w"> </span><span class="s">*</span><span class="nt">&gt;</span>
158<span class="w">    </span><span class="nb">ServerName</span><span class="w"> </span>pgadmin.example.com
159<span class="w">    </span><span class="nb">WSGIScriptAlias</span><span class="w"> </span>/<span class="w"> </span><span class="s2">&quot;C:\Program Files\pgAdmin4\web\pgAdmin4.wsgi&quot;</span>
160<span class="w">    </span><span class="nt">&lt;Directory</span><span class="w"> </span><span class="s">&quot;C:\Program Files\pgAdmin4\web&quot;</span><span class="nt">&gt;</span>
161<span class="w">            </span><span class="nb">Order</span><span class="w"> </span>deny,allow
162<span class="w">            </span><span class="nb">Allow</span><span class="w"> </span>from<span class="w"> </span><span class="k">all</span>
163<span class="w">    </span><span class="nt">&lt;/Directory&gt;</span>
164<span class="nt">&lt;/VirtualHost&gt;</span>
165</pre></div>
166</div>
167<p>Now open the file <code class="docutils literal notranslate"><span class="pre">C:\Program</span> <span class="pre">Files\pgAdmin4\web\pgAdmin4.wsgi</span></code> with your favorite editor and add the code
168below which will activate Python virtual environment when Apache server runs.</p>
169<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">activate_this</span> <span class="o">=</span> <span class="s1">&#39;C:\Program Files\pgAdmin4</span><span class="se">\v</span><span class="s1">env\Scripts</span><span class="se">\a</span><span class="s1">ctivate_this.py&#39;</span>
170<span class="n">exec</span><span class="p">(</span><span class="nb">open</span><span class="p">(</span><span class="n">activate_this</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
171</pre></div>
172</div>
173<p><strong>Note:</strong> The changes made in <code class="docutils literal notranslate"><span class="pre">pgAdmin4.wsgi</span></code> file will revert when pgAdmin4 is either upgraded or downgraded.</p>
174</section>
175<section id="apache-httpd-configuration-linux-unix">
176<h3>Apache HTTPD Configuration (Linux/Unix)<a class="headerlink" href="#apache-httpd-configuration-linux-unix" title="Link to this heading">¶</a></h3>
177<p>Once Apache HTTP has been configured to support <code class="docutils literal notranslate"><span class="pre">mod_wsgi</span></code>, the pgAdmin
178application may be configured similarly to the example below:</p>
179<div class="highlight-apache notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;VirtualHost</span><span class="w"> </span><span class="s">*</span><span class="nt">&gt;</span>
180<span class="w">    </span><span class="nb">ServerName</span><span class="w"> </span>pgadmin.example.com
181
182<span class="w">    </span><span class="nb">WSGIDaemonProcess</span><span class="w"> </span>pgadmin<span class="w"> </span>processes=1<span class="w"> </span>threads=25<span class="w"> </span>python-home=/path/to/python/virtualenv
183<span class="w">    </span><span class="nb">WSGIScriptAlias</span><span class="w"> </span>/<span class="w"> </span><span class="sx">/opt/pgAdmin4/web/pgAdmin4.wsgi</span>
184
185<span class="w">    </span><span class="nt">&lt;Directory</span><span class="w"> </span><span class="s">/opt/pgAdmin4/web</span><span class="nt">&gt;</span>
186<span class="w">        </span><span class="nb">WSGIProcessGroup</span><span class="w"> </span>pgadmin
187<span class="w">        </span><span class="nb">WSGIApplicationGroup</span><span class="w"> </span>%{GLOBAL}
188<span class="w">        </span><span class="nb">Order</span><span class="w"> </span>deny,allow
189<span class="w">        </span><span class="nb">Allow</span><span class="w"> </span>from<span class="w"> </span><span class="k">all</span>
190<span class="w">    </span><span class="nt">&lt;/Directory&gt;</span>
191<span class="nt">&lt;/VirtualHost&gt;</span>
192</pre></div>
193</div>
194<p><strong>Note:</strong> If you’re using Apache HTTPD 2.4 or later, replace the lines:</p>
195<div class="highlight-apache notranslate"><div class="highlight"><pre><span></span><span class="nb">Order</span><span class="w"> </span>deny,allow
196<span class="nb">Allow</span><span class="w"> </span>from<span class="w"> </span><span class="k">all</span>
197</pre></div>
198</div>
199<p>with:</p>
200<div class="highlight-apache notranslate"><div class="highlight"><pre><span></span><span class="nb">Require</span><span class="w"> </span><span class="k">all</span><span class="w"> </span>granted
201</pre></div>
202</div>
203<p>Adjust as needed to suit your access control requirements.</p>
204</section>
205<section id="standalone-gunicorn-configuration">
206<h3>Standalone Gunicorn Configuration<a class="headerlink" href="#standalone-gunicorn-configuration" title="Link to this heading">¶</a></h3>
207<p>pgAdmin may be hosted by Gunicorn directly simply by running a command such as
208the one shown below. Note that this example assumes pgAdmin was installed using
209the Python Wheel (you may need to adjust the path to suit your installation):</p>
210<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>gunicorn<span class="w">  </span>--bind<span class="w"> </span><span class="m">0</span>.0.0.0:80<span class="w"> </span><span class="se">\</span>
211<span class="w">          </span>--workers<span class="o">=</span><span class="m">1</span><span class="w"> </span><span class="se">\</span>
212<span class="w">          </span>--threads<span class="o">=</span><span class="m">25</span><span class="w"> </span><span class="se">\</span>
213<span class="w">          </span>--chdir<span class="w"> </span>/usr/lib/python3.7/dist-packages/pgadmin4<span class="w"> </span><span class="se">\</span>
214<span class="w">          </span>pgAdmin4:app
215</pre></div>
216</div>
217</section>
218<section id="standalone-uwsgi-configuration">
219<h3>Standalone uWSGI Configuration<a class="headerlink" href="#standalone-uwsgi-configuration" title="Link to this heading">¶</a></h3>
220<p>pgAdmin may be hosted by uWSGI directly simply by running a command such as
221the one shown below. Note that this example assumes pgAdmin was installed using
222the Python Wheel (you may need to adjust the path to suit your installation):</p>
223<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>uwsgi<span class="w"> </span>--http-socket<span class="w"> </span><span class="m">0</span>.0.0.0:80<span class="w"> </span><span class="se">\</span>
224<span class="w">      </span>--processes<span class="w"> </span><span class="m">1</span><span class="w"> </span><span class="se">\</span>
225<span class="w">      </span>--threads<span class="w"> </span><span class="m">25</span><span class="w"> </span><span class="se">\</span>
226<span class="w">      </span>--chdir<span class="w"> </span>/usr/lib/python3.7/dist-packages/pgadmin4/<span class="w"> </span><span class="se">\</span>
227<span class="w">      </span>--mount<span class="w"> </span>/<span class="o">=</span>pgAdmin4:app
228</pre></div>
229</div>
230</section>
231<section id="nginx-configuration-with-gunicorn">
232<h3>NGINX Configuration with Gunicorn<a class="headerlink" href="#nginx-configuration-with-gunicorn" title="Link to this heading">¶</a></h3>
233<p>pgAdmin can be hosted by Gunicorn, with NGINX in front of it. Note that these
234examples assume pgAdmin was installed using the Python Wheel (you may need to
235adjust the path to suit your installation).</p>
236<p>To run with pgAdmin in the root directory of the server, start Gunicorn using a
237command similar to:</p>
238<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>gunicorn<span class="w"> </span>--bind<span class="w"> </span>unix:/tmp/pgadmin4.sock<span class="w"> </span><span class="se">\</span>
239<span class="w">         </span>--workers<span class="o">=</span><span class="m">1</span><span class="w"> </span><span class="se">\</span>
240<span class="w">         </span>--threads<span class="o">=</span><span class="m">25</span><span class="w"> </span><span class="se">\</span>
241<span class="w">         </span>--chdir<span class="w"> </span>/usr/lib/python3.7/dist-packages/pgadmin4<span class="w"> </span><span class="se">\</span>
242<span class="w">         </span>pgAdmin4:app
243</pre></div>
244</div>
245<p>And configure NGINX:</p>
246<div class="highlight-nginx notranslate"><div class="highlight"><pre><span></span><span class="k">location</span><span class="w"> </span><span class="s">/</span><span class="w"> </span><span class="p">{</span>
247<span class="w">    </span><span class="kn">include</span><span class="w"> </span><span class="s">proxy_params</span><span class="p">;</span>
248<span class="w">    </span><span class="kn">proxy_pass</span><span class="w"> </span><span class="s">http://unix:/tmp/pgadmin4.sock</span><span class="p">;</span>
249<span class="p">}</span>
250</pre></div>
251</div>
252<p>Alternatively, pgAdmin can be hosted in a sub-directory (/pgadmin4 in this case)
253on the server. Start Gunicorn as when using the root directory, but configure
254NGINX as follows:</p>
255<div class="highlight-nginx notranslate"><div class="highlight"><pre><span></span><span class="k">location</span><span class="w"> </span><span class="s">/pgadmin4/</span><span class="w"> </span><span class="p">{</span>
256<span class="w">    </span><span class="kn">include</span><span class="w"> </span><span class="s">proxy_params</span><span class="p">;</span>
257<span class="w">    </span><span class="kn">proxy_pass</span><span class="w"> </span><span class="s">http://unix:/tmp/pgadmin4.sock</span><span class="p">;</span>
258<span class="w">    </span><span class="kn">proxy_set_header</span><span class="w"> </span><span class="s">X-Script-Name</span><span class="w"> </span><span class="s">/pgadmin4</span><span class="p">;</span>
259<span class="p">}</span>
260</pre></div>
261</div>
262</section>
263<section id="nginx-configuration-with-uwsgi">
264<h3>NGINX Configuration with uWSGI<a class="headerlink" href="#nginx-configuration-with-uwsgi" title="Link to this heading">¶</a></h3>
265<p>pgAdmin can be hosted by uWSGI, with NGINX in front of it. Note that these
266examples assume pgAdmin was installed using the Python Wheel (you may need to
267adjust the path to suit your installation).</p>
268<p>To run with pgAdmin in the root directory of the server, start uWSGI using a
269command similar to:</p>
270<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>uwsgi<span class="w"> </span>--socket<span class="w"> </span>/tmp/pgadmin4.sock<span class="w"> </span><span class="se">\</span>
271<span class="w">      </span>--processes<span class="w"> </span><span class="m">1</span><span class="w"> </span><span class="se">\</span>
272<span class="w">      </span>--threads<span class="w"> </span><span class="m">25</span><span class="w"> </span><span class="se">\</span>
273<span class="w">      </span>--chdir<span class="w"> </span>/usr/lib/python3.7/dist-packages/pgadmin4/<span class="w"> </span><span class="se">\</span>
274<span class="w">      </span>--manage-script-name<span class="w"> </span><span class="se">\</span>
275<span class="w">      </span>--mount<span class="w"> </span>/<span class="o">=</span>pgAdmin4:app
276</pre></div>
277</div>
278<p>And configure NGINX:</p>
279<div class="highlight-nginx notranslate"><div class="highlight"><pre><span></span><span class="k">location</span><span class="w"> </span><span class="s">/</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kn">try_files</span><span class="w"> </span><span class="nv">$uri</span><span class="w"> </span><span class="s">@pgadmin4</span><span class="p">;</span><span class="w"> </span><span class="p">}</span>
280<span class="k">location</span><span class="w"> </span><span class="s">@pgadmin4</span><span class="w"> </span><span class="p">{</span>
281<span class="w">    </span><span class="kn">include</span><span class="w"> </span><span class="s">uwsgi_params</span><span class="p">;</span>
282<span class="w">    </span><span class="kn">uwsgi_pass</span><span class="w"> </span><span class="s">unix:/tmp/pgadmin4.sock</span><span class="p">;</span>
283<span class="p">}</span>
284</pre></div>
285</div>
286<p>Alternatively, pgAdmin can be hosted in a sub-directory (/pgadmin4 in this case)
287on the server. Start uWSGI, noting that the directory name is specified in the
288<code class="docutils literal notranslate"><span class="pre">mount</span></code> parameter:</p>
289<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>uwsgi<span class="w"> </span>--socket<span class="w"> </span>/tmp/pgadmin4.sock<span class="w"> </span><span class="se">\</span>
290<span class="w">      </span>--processes<span class="w"> </span><span class="m">1</span><span class="w"> </span><span class="se">\</span>
291<span class="w">      </span>--threads<span class="w"> </span><span class="m">25</span><span class="w"> </span><span class="se">\</span>
292<span class="w">      </span>--chdir<span class="w"> </span>/usr/lib/python3.7/dist-packages/pgadmin4/<span class="w"> </span><span class="se">\</span>
293<span class="w">      </span>--manage-script-name<span class="w"> </span><span class="se">\</span>
294<span class="w">      </span>--mount<span class="w"> </span>/pgadmin4<span class="o">=</span>pgAdmin4:app
295</pre></div>
296</div>
297<p>Then, configure NGINX:</p>
298<div class="highlight-nginx notranslate"><div class="highlight"><pre><span></span><span class="k">location</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="s">/pgadmin4</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kn">rewrite</span><span class="w"> </span><span class="s">^</span><span class="w"> </span><span class="s">/pgadmin4/</span><span class="p">;</span><span class="w"> </span><span class="p">}</span>
299<span class="k">location</span><span class="w"> </span><span class="s">/pgadmin4</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="kn">try_files</span><span class="w"> </span><span class="nv">$uri</span><span class="w"> </span><span class="s">@pgadmin4</span><span class="p">;</span><span class="w"> </span><span class="p">}</span>
300<span class="k">location</span><span class="w"> </span><span class="s">@pgadmin4</span><span class="w"> </span><span class="p">{</span>
301<span class="w">  </span><span class="kn">include</span><span class="w"> </span><span class="s">uwsgi_params</span><span class="p">;</span>
302<span class="w">  </span><span class="kn">uwsgi_pass</span><span class="w"> </span><span class="s">unix:/tmp/pgadmin4.sock</span><span class="p">;</span>
303<span class="p">}</span>
304</pre></div>
305</div>
306</section>
307<section id="additional-information">
308<h3>Additional Information<a class="headerlink" href="#additional-information" title="Link to this heading">¶</a></h3>
309<div class="admonition note">
310<p class="admonition-title">Note</p>
311<p>pgAdmin will spawn additional Python processes from time to time, and
312relies on the <em>sys.executable</em> variable in Python to do this. In some cases,
313you may need to override that value to ensure the correct interpreter is
314used, instead of the WSGI host process. For example, uWSGI offers the
315<em>–py-sys-executable</em> command line option to achieve this.</p>
316</div>
317</section>
318</section>
319</section>
320
321
322            <div class="clearer"></div>
323          </div>
324        </div>
325      </div>
326      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
327        <div class="sphinxsidebarwrapper">
328  <div>
329    <h3><a href="index.html">Table of Contents</a></h3>
330    <ul>
331<li><a class="reference internal" href="#">Server Deployment</a><ul>
332<li><a class="reference internal" href="#requirements">Requirements</a></li>
333<li><a class="reference internal" href="#configuration">Configuration</a><ul>
334<li><a class="reference internal" href="#python">Python</a></li>
335</ul>
336</li>
337<li><a class="reference internal" href="#hosting">Hosting</a><ul>
338<li><a class="reference internal" href="#apache-httpd-configuration-windows">Apache HTTPD Configuration (Windows)</a></li>
339<li><a class="reference internal" href="#apache-httpd-configuration-linux-unix">Apache HTTPD Configuration (Linux/Unix)</a></li>
340<li><a class="reference internal" href="#standalone-gunicorn-configuration">Standalone Gunicorn Configuration</a></li>
341<li><a class="reference internal" href="#standalone-uwsgi-configuration">Standalone uWSGI Configuration</a></li>
342<li><a class="reference internal" href="#nginx-configuration-with-gunicorn">NGINX Configuration with Gunicorn</a></li>
343<li><a class="reference internal" href="#nginx-configuration-with-uwsgi">NGINX Configuration with uWSGI</a></li>
344<li><a class="reference internal" href="#additional-information">Additional Information</a></li>
345</ul>
346</li>
347</ul>
348</li>
349</ul>
350
351  </div>
352<h3><a href="index.html">Table of Contents</a></h3>
353<ul class="current">
354<li class="toctree-l1 current"><a class="reference internal" href="getting_started.html">Getting Started</a><ul class="current">
355<li class="toctree-l2 current"><a class="reference internal" href="deployment.html">Deployment</a></li>
356<li class="toctree-l2"><a class="reference internal" href="login.html">Login Page</a></li>
357<li class="toctree-l2"><a class="reference internal" href="mfa.html">Enabling two-factor authentication (2FA)</a></li>
358<li class="toctree-l2"><a class="reference internal" href="user_management.html">User Management Dialog</a></li>
359<li class="toctree-l2"><a class="reference internal" href="change_ownership.html">Change Ownership Dialog</a></li>
360<li class="toctree-l2"><a class="reference internal" href="change_user_password.html">Change User Password Dialog</a></li>
361<li class="toctree-l2"><a class="reference internal" href="restore_locked_user.html">Lock/Restore Account</a></li>
362<li class="toctree-l2"><a class="reference internal" href="ldap.html">Enabling LDAP Authentication</a></li>
363<li class="toctree-l2"><a class="reference internal" href="kerberos.html">Enabling Kerberos Authentication</a></li>
364<li class="toctree-l2"><a class="reference internal" href="oauth2.html">Enabling OAUTH2 Authentication</a></li>
365<li class="toctree-l2"><a class="reference internal" href="webserver.html">Enabling Webserver Authentication</a></li>
366<li class="toctree-l2"><a class="reference internal" href="user_interface.html">User Interface</a></li>
367<li class="toctree-l2"><a class="reference internal" href="menu_bar.html">Menu Bar</a></li>
368<li class="toctree-l2"><a class="reference internal" href="toolbar.html">Toolbar</a></li>
369<li class="toctree-l2"><a class="reference internal" href="tabbed_browser.html">Tabbed Browser</a></li>
370<li class="toctree-l2"><a class="reference internal" href="tree_control.html">Tree Control</a></li>
371<li class="toctree-l2"><a class="reference internal" href="preferences.html">Preferences Dialog</a></li>
372<li class="toctree-l2"><a class="reference internal" href="keyboard_shortcuts.html">Keyboard Shortcuts:</a></li>
373<li class="toctree-l2"><a class="reference internal" href="search_objects.html">Search objects</a></li>
374</ul>
375</li>
376<li class="toctree-l1"><a class="reference internal" href="external_database.html">External database for pgAdmin user settings</a></li>
377<li class="toctree-l1"><a class="reference internal" href="connecting.html">Connecting To A Server</a></li>
378<li class="toctree-l1"><a class="reference internal" href="managing_cluster_objects.html">Managing Cluster Objects</a></li>
379<li class="toctree-l1"><a class="reference internal" href="managing_database_objects.html">Managing Database Objects</a></li>
380<li class="toctree-l1"><a class="reference internal" href="modifying_tables.html">Creating or Modifying a Table</a></li>
381<li class="toctree-l1"><a class="reference internal" href="management_basics.html">Management Basics</a></li>
382<li class="toctree-l1"><a class="reference internal" href="backup_and_restore.html">Backup and Restore</a></li>
383<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
384<li class="toctree-l1"><a class="reference internal" href="processes.html">Processes</a></li>
385<li class="toctree-l1"><a class="reference internal" href="pgagent.html">pgAgent</a></li>
386<li class="toctree-l1"><a class="reference internal" href="contributions.html">pgAdmin Project Contributions</a></li>
387<li class="toctree-l1"><a class="reference internal" href="release_notes.html">Release Notes</a></li>
388<li class="toctree-l1"><a class="reference internal" href="licence.html">Licence</a></li>
389</ul>
390
391<search id="searchbox" style="display: none" role="search">
392  <h3 id="searchlabel">Quick search</h3>
393    <div class="searchformwrapper">
394    <form class="search" action="search.html" method="get">
395      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
396      <input type="submit" value="Go" />
397    </form>
398    </div>
399</search>
400<script>document.getElementById('searchbox').style.display = "block"</script>
401        </div>
402<div id="sidebarbutton" title="Collapse sidebar">
403<span>«</span>
404</div>
405
406      </div>
407      <div class="clearer"></div>
408    </div>
409    <div class="related" role="navigation" aria-label="related navigation">
410      <h3>Navigation</h3>
411      <ul>
412        <li class="right" style="margin-right: 10px">
413          <a href="genindex.html" title="General Index"
414             >index</a></li>
415        <li class="right" >
416          <a href="container_deployment.html" title="Container Deployment"
417             >next</a> |</li>
418        <li class="right" >
419          <a href="desktop_deployment.html" title="Desktop Deployment"
420             >previous</a> |</li>
421        <li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> &#187;</li>
422          <li class="nav-item nav-item-1"><a href="getting_started.html" >Getting Started</a> &#187;</li>
423          <li class="nav-item nav-item-2"><a href="deployment.html" >Deployment</a> &#187;</li>
424        <li class="nav-item nav-item-this"><a href="">Server Deployment</a></li> 
425      </ul>
426    </div>
427    <div class="footer" role="contentinfo">
428        <div class="related" role="navigation" aria-label="related navigation">
429          <ul>
430              <li class="left" style="margin-left: 10px">&#169; Copyright (C) 2013 - 2024, The pgAdmin Development Team.</li>
431            <li class="right" style="margin-right: 10px"><a href="genindex.html" title="General Index" accesskey="I">index</a></li>
432            <li class="right" ><a href="container_deployment.html" title="Container Deployment" accesskey="N">next</a> |</li>
433            <li class="right" ><a href="desktop_deployment.html" title="Desktop Deployment" accesskey="P">previous</a> |</li>
434          </ul>
435        </div>
436    </div>
437  </body>
438</html>
codekingpro/portable-devtools · Team Ai