README-main 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. $OpenBSD: README-main,v 1.7 2015/09/10 13:00:10 sthen Exp $
  2. +-----------------------------------------------------------------------
  3. | Running ${FULLPKGNAME} on OpenBSD
  4. +-----------------------------------------------------------------------
  5. General configuration
  6. =====================
  7. The sample configuration in ${SYSCONFDIR}/squid.conf is a simple version
  8. with only the most essential options. By default, only RAM-based cache is
  9. used, un-comment the cache_dir line to enable a persistent disk cache
  10. ("swap"); this is normally kept in ${LOCALSTATEDIR}/cache and must be
  11. initialized with "squid -z" before starting the daemon. If you need to
  12. place it elsewhere, create the directory and make sure it is owned and
  13. writable by user _squid, group _squid.
  14. Logs are stored in ${LOCALSTATEDIR}/logs; access logs on a busy cache will
  15. grow rapidly so rotate them as necessary (use "squid -k rotate").
  16. See ${TRUEPREFIX}/share/examples/squid/squid.conf.documented for a complete
  17. annotated file, similar to the standard squid.conf in previous versions
  18. of Squid, however in many cases the defaults will suffice.
  19. The HTML error pages can be easily themed by editing the style-sheet in
  20. ${SYSCONFDIR}/errorpage.css.
  21. System resource limits
  22. ======================
  23. The default system resource limits for file-descriptors are insufficient
  24. for a moderately busy proxy. It may also be necessary to increase the
  25. memory limits. You can add a service-specific class to /etc/login.conf:
  26. squid:\
  27. :datasize=1500M:\
  28. :openfiles=4096:\
  29. :tc=daemon:
  30. When started by rc.d(8) (i.e. via pkg_scripts in rc.conf.local or from
  31. "${RCDIR}/squid start") the appropriately-named login class is used
  32. automatically.
  33. If you are using /etc/login.conf.db (not usually recommended) then be
  34. sure to rebuild it.
  35. There is also a kernel limit on the number of open file descriptors,
  36. sysctl kern.maxfiles. In some circumstances you may also need to raise
  37. this; if this is required, pay particular attention to testing and
  38. monitoring your system.
  39. Interception Proxying with PF
  40. =============================
  41. To configure an interception (a.k.a. "transparent") proxy, Squid should
  42. be configured in ${SYSCONFDIR}/squid.conf to bind to a specific address,
  43. for example:
  44. http_port 127.0.0.1:3127 intercept
  45. On the machine running Squid, add a firewall rule similar to this:
  46. pass in quick log inet proto tcp to port 80 divert-to 127.0.0.1 port 3127
  47. If the machine running Squid is already acting as a router/firewall
  48. for your client machines, there is no other special configuration.
  49. However if Squid is running on a separate machine, the router must be
  50. configured to pass HTTP traffic to Squid. You can use a rule like this
  51. on the router:
  52. pass in quick from 10.77.3.5
  53. pass in quick inet proto tcp to port 80 route-to (vr2 10.77.3.5)
  54. (this example assumes Squid is running on 10.77.3.5 reachable over
  55. the vr2 interface).
  56. If the proxy server is running on the same subnet as the clients, the
  57. return traffic from the proxy will go directly back to them without
  58. ever hitting the firewall, which means the states will never get updated
  59. and may fill-up your pflog(4) with blocked attempts. To circumvent this
  60. the "no state" option needs to be specified for the route-to rule:
  61. pass in quick inet proto tcp to port 80 route-to (vr2 10.77.3.5) no state