installation-uwsgi.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .. _searx uwsgi:
  2. =====
  3. uwsgi
  4. =====
  5. Create the configuration file ``/etc/uwsgi/apps-available/searx.ini`` with this
  6. content:
  7. .. code:: ini
  8. [uwsgi]
  9. # uWSGI core
  10. # ----------
  11. #
  12. # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
  13. # Who will run the code
  14. uid = searx
  15. gid = searx
  16. # chdir to specified directory before apps loading
  17. chdir = /usr/local/searx/searx-src/searx
  18. # disable logging for privacy
  19. disable-logging = true
  20. # The right granted on the created socket
  21. chmod-socket = 666
  22. # Plugin to use and interpretor config
  23. single-interpreter = true
  24. # enable master process
  25. master = true
  26. # load apps in each worker instead of the master
  27. lazy-apps = true
  28. # load uWSGI plugins
  29. plugin = python3,http
  30. # By default the Python plugin does not initialize the GIL. This means your
  31. # app-generated threads will not run. If you need threads, remember to enable
  32. # them with enable-threads. Running uWSGI in multithreading mode (with the
  33. # threads options) will automatically enable threading support. This *strange*
  34. # default behaviour is for performance reasons.
  35. enable-threads = true
  36. # plugin: python
  37. # --------------
  38. #
  39. # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
  40. # load a WSGI module
  41. module = searx.webapp
  42. # set PYTHONHOME/virtualenv
  43. virtualenv = /usr/local/searx/searx-pyenv
  44. # add directory (or glob) to pythonpath
  45. pythonpath = /usr/local/searx/searx-src
  46. # plugin http
  47. # -----------
  48. #
  49. # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http
  50. # Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
  51. http = 127.0.0.1:8888
  52. Activate the uwsgi application and restart:
  53. .. code:: sh
  54. cd /etc/uwsgi/apps-enabled
  55. ln -s ../apps-available/searx.ini
  56. /etc/init.d/uwsgi restart