socketd_exampleconf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. cat <<EOF
  3. listen 0.0.0.0:16969 512; //backlog=512
  4. //default thread count is NCPU
  5. //threads 2;
  6. //bindings sections embedded in vhost sections are processed
  7. //before bindings in the global scope
  8. ipcbuffersize 16777216;
  9. vhost vh1 {
  10. bindings {
  11. {
  12. listen 0.0.0.0:16969;
  13. httphost localhost:16969; //only match requests going to hostname "localhost"
  14. }
  15. }
  16. //the second exec is a shell command telling the shell to not fork, but execve() directly
  17. exec exec '$(pwd)'/socketd_cppsp -m /dir_list.cppsm -r '$(pwd)'/www -c -fPIC -c -I'$(pwd)'/include -c -Ofast -c -march=native -c '$(pwd)'/cpoll.o -c '$(pwd)'/cppsp.o -f;
  18. shell 1;
  19. preload 0; //socketd_cppsp is a native socketd application; no need to preload socketd_proxy
  20. //at runtime, the # of processes will be rounded up to the nearest multiple
  21. //of the # of socketd threads, so the actual processes started will be NCPU
  22. processes 1;
  23. }
  24. vhost vh2 {
  25. bindings {
  26. //adjust your /etc/hosts to test this
  27. {httphost host1:16969;}
  28. }
  29. exec exec lighttpd -D -f /path/to/lighttpd.conf;
  30. shell 1;
  31. preload 1; //preload socketd_proxy.so to run an unmodified http server under socketd
  32. }
  33. EOF