fastcgi.conf 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #######################################################################
  2. ##
  3. ## FastCGI Module
  4. ## ---------------
  5. ##
  6. ## http://www.lighttpd.net/documentation/fastcgi.html
  7. ##
  8. server.modules += ( "mod_fastcgi" )
  9. fastcgi.server = ( ".php" => ((
  10. "bin-path" => "/bin/php-cgi", ## This is the path where your php-cgi file is located. Change it if needed.
  11. "socket" => "/var/run/php-cgi.socket"
  12. )))
  13. ##
  14. ## PHP Example
  15. ## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
  16. ##
  17. ## The number of php processes you will get can be easily calculated:
  18. ##
  19. ## num-procs = max-procs * ( 1 + PHP_FCGI_CHILDREN )
  20. ##
  21. ## for the php-num-procs example it means you will get 17*5 = 85 php
  22. ## processes. you always should need this high number for your very
  23. ## busy sites. And if you have a lot of RAM. :)
  24. ##
  25. #fastcgi.server = ( ".php" =>
  26. # ( "php-local" =>
  27. # (
  28. # "socket" => socket_dir + "/php-fastcgi-1.socket",
  29. # "bin-path" => server_root + "/cgi-bin/php5",
  30. # "max-procs" => 1,
  31. # "broken-scriptfilename" => "enable",
  32. # )
  33. # ),
  34. # ( "php-tcp" =>
  35. # (
  36. # "host" => "127.0.0.1",
  37. # "port" => 9999,
  38. # "check-local" => "disable",
  39. # "broken-scriptfilename" => "enable",
  40. # )
  41. # ),
  42. #
  43. # ( "php-num-procs" =>
  44. # (
  45. # "socket" => socket_dir + "/php-fastcgi-2.socket",
  46. # "bin-path" => server_root + "/cgi-bin/php5",
  47. # "bin-environment" => (
  48. # "PHP_FCGI_CHILDREN" => "16",
  49. # "PHP_FCGI_MAX_REQUESTS" => "10000",
  50. # ),
  51. # "max-procs" => 5,
  52. # "broken-scriptfilename" => "enable",
  53. # )
  54. # ),
  55. # )
  56. ##
  57. ## Ruby on Rails Example
  58. ##
  59. ## Normally you only run one Rails application on one vhost.
  60. ##
  61. #$HTTP["host"] == "rails1.example.com" {
  62. # server.document-root = server_root + "/rails/someapp/public"
  63. # server.error-handler-404 = "/dispatch.fcgi"
  64. # fastcgi.server = ( ".fcgi" =>
  65. # ("someapp" =>
  66. # ( "socket" => socket_dir + "/someapp-fcgi.socket",
  67. # "bin-path" => server_root + "/rails/someapp/public/dispatch.fcgi",
  68. # "bin-environment" => (
  69. # "RAILS_ENV" => "production",
  70. # "TMP" => home_dir + "/rails/someapp",
  71. # ),
  72. # )
  73. # )
  74. # )
  75. #}
  76. ##
  77. ## Another example with multiple rails applications on one vhost.
  78. ##
  79. ## http://blog.lighttpd.net/articles/2005/11/23/lighttpd-1-4-8-and-multiple-rails-apps
  80. ##
  81. #$HTTP["host"] == "rails2.example.com" {
  82. # $HTTP["url"] =~ "^/someapp1" {
  83. # server.document-root = server_root + "/rails/someapp1/public"
  84. # server.error-handler-404 = "/dispatch.fcgi"
  85. # fastcgi.server = ( ".fcgi" =>
  86. # ("someapp1" =>
  87. # ( "socket" => socket_dir + "/someapp1-fcgi.socket",
  88. # "bin-path" => server_root + "/rails/someapp1/public/dispatch.fcgi",
  89. # "bin-environment" => (
  90. # "RAILS_ENV" => "production",
  91. # "TMP" => home_dir + "/rails/someapp1",
  92. # ),
  93. # "strip-request-uri" => "/someapp1/"
  94. # )
  95. # )
  96. # )
  97. # }
  98. #
  99. # $HTTP["url"] =~ "^/someapp2" {
  100. # server.document-root = server_root + "/rails/someapp2/public"
  101. # server.error-handler-404 = "/dispatch.fcgi"
  102. # fastcgi.server = ( ".fcgi" =>
  103. # ("someapp2" =>
  104. # ( "socket" => socket_dir + "/someapp2-fcgi.socket",
  105. # "bin-path" => server_root + "/rails/someapp2/public/dispatch.fcgi",
  106. # "bin-environment" => (
  107. # "RAILS_ENV" => "production",
  108. # "TMP" => home_dir + "/rails/someapp2",
  109. # ),
  110. # "strip-request-uri" => "/someapp2/"
  111. # )
  112. # )
  113. # )
  114. # }
  115. #}
  116. ## chrooted webserver + external PHP
  117. ##
  118. ## $ spawn-fcgi -f /usr/bin/php-cgi -p 2000 -a 127.0.0.1 -C 8
  119. ##
  120. ## webserver chrooted to /srv/www/
  121. ## php running outside the chroot
  122. #
  123. #fastcgi.server = (
  124. # ".php" => ((
  125. # "host" => "127.0.0.1",
  126. # "port" => "2000",
  127. # "docroot" => "/srv/www/servers/www.example.org/htdocs/"
  128. # )))
  129. #
  130. #server.chroot = "/srv/www"
  131. #server.document-root = "/servers/wwww.example.org/htdocs/"
  132. #
  133. ##
  134. #######################################################################