Mercurial > p > roundup > code
comparison doc/installation.txt @ 8559:19670ecbad82
doc: add doc for scgi with althttpd web server.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 08 Apr 2026 19:27:34 -0400 |
| parents | 1976dedb3319 |
| children | 792eb77554fb |
comparison
equal
deleted
inserted
replaced
| 8558:5fbf6451a782 | 8559:19670ecbad82 |
|---|---|
| 714 There are multiple ways to deploy the web interface. If your | 714 There are multiple ways to deploy the web interface. If your |
| 715 tracker will be heavily used and accessible from the internet, we | 715 tracker will be heavily used and accessible from the internet, we |
| 716 suggest using Apache or Nginx in WSGI mode or as a reverse proxy | 716 suggest using Apache or Nginx in WSGI mode or as a reverse proxy |
| 717 to the stand alone web server or WSGI server like Gunicorn. | 717 to the stand alone web server or WSGI server like Gunicorn. |
| 718 | 718 |
| 719 A FastCGI deployment with an alternate web server is suitable for | 719 A FastCGI or SCGI deployment with an alternate web server is suitable |
| 720 lower traffic sites. | 720 for lower traffic sites. |
| 721 | 721 |
| 722 If you already run Zope, Roundup should deploy nicely in that | 722 If you already run Zope, Roundup should deploy nicely in that |
| 723 framework. | 723 framework. |
| 724 | 724 |
| 725 If you are internet accessible, but expect a few users, or are on | 725 If you are internet accessible, but expect a few users, or are on |
| 727 | 727 |
| 728 Using a true HTTP server provide tools including: DOS prevention, | 728 Using a true HTTP server provide tools including: DOS prevention, |
| 729 throttling, web application firewalls etc. that are worth having | 729 throttling, web application firewalls etc. that are worth having |
| 730 in an internet facing application. | 730 in an internet facing application. |
| 731 | 731 |
| 732 If you are running on an internal intranet, you can use the | 732 If you are running on an internal intranet, you can use the stand |
| 733 stand alone server: roundup-server, but even in this environment, | 733 alone server: roundup-server, but even in this environment, using a |
| 734 using a real web server to serve static files and other resources | 734 real web server or proxy (e.g. pound) to serve static files and other |
| 735 will perform better. | 735 resources will perform better. |
| 736 | 736 |
| 737 .. contents:: | 737 .. contents:: |
| 738 :depth: 1 | 738 :depth: 1 |
| 739 :local: | 739 :local: |
| 740 | 740 |
| 1305 configuration files and instructions. | 1305 configuration files and instructions. |
| 1306 | 1306 |
| 1307 .. _can be found in the wayback machine archive: | 1307 .. _can be found in the wayback machine archive: |
| 1308 https://web.archive.org/web/20241010170738/https://flask.palletsprojects.com/en/2.0.x/deploying/fastcgi/ | 1308 https://web.archive.org/web/20241010170738/https://flask.palletsprojects.com/en/2.0.x/deploying/fastcgi/ |
| 1309 .. _flup: https://pypi.org/project/flup/ | 1309 .. _flup: https://pypi.org/project/flup/ |
| 1310 | |
| 1311 SCGI (althttpd, Cherokee, lighttpd) | |
| 1312 --------------- | |
| 1313 | |
| 1314 The `althttpd (written by the author of SQLite) | |
| 1315 <https://sqlite.org/althttpd>`_ web server is a minimal server that | |
| 1316 can run Roundup using SCGI or CGI. | |
| 1317 | |
| 1318 To run Roundup using SCGI, the flup_ package provides a translator | |
| 1319 between SCGI and WSGI. | |
| 1320 | |
| 1321 The following ``roundup-scgi.py`` can be run using Python to start the | |
| 1322 server: | |
| 1323 | |
| 1324 .. code:: python | |
| 1325 | |
| 1326 #!/usr/bin/env python | |
| 1327 # Obtain the WSGI request dispatcher | |
| 1328 from roundup.cgi.wsgi_handler import RequestDispatcher | |
| 1329 from flup.server.scgi import WSGIServer | |
| 1330 | |
| 1331 # Set the path to tracker home. | |
| 1332 tracker_home = '/path/to/tracker/home' | |
| 1333 | |
| 1334 try: | |
| 1335 application = RequestDispatcher(tracker_home) | |
| 1336 except Exception as e: | |
| 1337 print(e) | |
| 1338 sys.exit(1) | |
| 1339 | |
| 1340 ret = WSGIServer(application, | |
| 1341 # the tuple: | |
| 1342 # hostname/ip address as a string (0.0.0.0 bind | |
| 1343 # all ip address) | |
| 1344 # port as an integer | |
| 1345 bindAddress=("0.0.0.0", 8197), | |
| 1346 scriptName="/roundup.scgi/demo").run() | |
| 1347 sys.exit(ret and 42 or 0) | |
| 1348 | |
| 1349 | |
| 1350 Now you have to configure althttpd so it connects to the scgi | |
| 1351 server. To do this, althttpd requires a file with a ``.scgi`` | |
| 1352 extension. Create the file ``roundup.scgi`` and put it in the root of | |
| 1353 your althttpd directory. It should contain: | |
| 1354 | |
| 1355 .. code:: | |
| 1356 | |
| 1357 SCGI hostname 8197 | |
| 1358 | |
| 1359 where hostname is a valid name for the host running the SCGI | |
| 1360 server. You can also put in other directives including a fallback web | |
| 1361 page if the SCGI server is down, or a command to run to restart the | |
| 1362 SCGI server. See the `althttpd.c file | |
| 1363 <https://sqlite.org/althttpd/file?ci=tip&name=althttpd.c&ln=14>`_ on | |
| 1364 the main web site for details. If you have ``althttpd`` or | |
| 1365 ``althttpsd`` installed you can just use the ``--help`` argument. | |
| 1366 | |
| 1367 Assuming you run: | |
| 1368 ``althttpd --root /var/www/htdocs -port 443 --cert certs.pem`` and you | |
| 1369 installed ``/var/www/htdocs/roundup.scgi``, you will be able to access | |
| 1370 your tracker at: ``https://web_hostname/roundup.scgi/``. | |
| 1371 | |
| 1310 | 1372 |
| 1311 WSGI Variations | 1373 WSGI Variations |
| 1312 --------------- | 1374 --------------- |
| 1313 | 1375 |
| 1314 .. index:: triple: web interface; apache; mod_wsgi | 1376 .. index:: triple: web interface; apache; mod_wsgi |
