installation-apache.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. _installation apache:
  2. ===================
  3. Install with apache
  4. ===================
  5. .. sidebar:: public HTTP servers
  6. On public searx instances use an application firewall (:ref:`filtron
  7. <filtron.sh>`).
  8. .. contents:: Contents
  9. :depth: 2
  10. :local:
  11. :backlinks: entry
  12. Add wsgi mod
  13. ============
  14. .. tabs::
  15. .. group-tab:: Ubuntu / debian
  16. .. code:: sh
  17. sudo -H apt-get install libapache2-mod-uwsgi
  18. sudo -H a2enmod uwsgi
  19. Add this configuration in the file ``/etc/apache2/apache2.conf``. To limit
  20. acces to your intranet replace ``Allow from all`` directive and replace
  21. ``192.168.0.0/16`` with your subnet IP/class.
  22. .. _inranet apache site:
  23. Note that if your instance of searx is not at the root, you should change
  24. ``<Location />`` by the location of your instance, like ``<Location /searx>``:
  25. .. code:: apache
  26. # CustomLog /dev/null combined
  27. <IfModule mod_uwsgi.c>
  28. <Location />
  29. Options FollowSymLinks Indexes
  30. SetHandler uwsgi-handler
  31. uWSGISocket /run/uwsgi/app/searx/socket
  32. Order deny,allow
  33. Deny from all
  34. # Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
  35. Allow from all
  36. </Location>
  37. </IfModule>
  38. Enable apache mod_uwsgi and restart apache:
  39. .. tabs::
  40. .. group-tab:: Ubuntu / debian
  41. .. code:: sh
  42. a2enmod uwsgi
  43. sudo -H systemctl restart apache2
  44. disable logs
  45. ============
  46. For better privacy you can disable Apache logs. Go back to
  47. ``/etc/apache2/apache2.conf`` :ref:`[example] <inranet apache site>` and above
  48. ``<Location />`` activate directive:
  49. .. code:: apache
  50. CustomLog /dev/null combined
  51. Restart apache:
  52. .. tabs::
  53. .. group-tab:: Ubuntu / debian
  54. .. code:: sh
  55. sudo -H systemctl restart apache2
  56. .. warning::
  57. You can only disable logs for the whole (virtual) server not for a specific
  58. path.