socketd_example.conf 1.2 KB

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