среда, 9 сентября 2009 г.

lighttpd + php (spawn_fcgi)

Как-то стала надобность собрать на freebsd Lighttpd с поддержкой php.

  1. cd /usr/ports/lang/php5
  2. make config
  3.      ┌─────────────────────────────────
         │                     Options for php5 5.2.10                        │
         │ ┌────────────────────────────────
         │ │[ ] CLI        Build CLI version                                
         │ │[X] CGI        Build CGI version                                
         │ │[ ] APACHE     Build Apache module                              
         │ │[ ] DEBUG      Enable debug                                     
         │ │[ ] SUHOSIN    Enable Suhosin protection system (not for jails) 
         │ │[ ] MULTIBYTE  Enable zend multibyte support                    
         │ │[ ] IPV6       Enable ipv6 support                              
         │ │[ ] MAILHEAD   Enable mail header patch                         
         │ │[ ] REDIRECT   Enable force-cgi-redirect support (CGI only)     
         │ │[ ] DISCARD    Enable discard-path support (CGI only)           
         │ │[X] FASTCGI    Enable fastcgi support (CGI only)                
         │ │[ ] PATHINFO   Enable path-info-check support (CGI only)    
  4. make install clean
  5. cd /usr/ports/www/lighttpd
  6. make config
  7.      │                   Options for lighttpd 1.4.23                      
         │ ┌────────────────────────────────
         │ │       [ ] BZIP2      Enable Bzip2 support                      
         │ │       [ ] CML        Enable Cache Meta Language support        
         │ │       [ ] FAM        Enable fam/gamin support                  
         │ │       [ ] GDBM       Enable gdbm storage support               
         │ │       [ ] IPV6       Enable IPV6 support                       
         │ │       [ ] MAGNET     Enable magnet support                     
         │ │       [ ] MEMCACHE   Enable memory caching support             
         │ │       [ ] MYSQL      Enable MYSQL support                      
         │ │       [ ] OPENLDAP   Enable LDAP support                       
         │ │       [ ] OPENSSL    Enable SSL support                        
         │ │       [X] SPAWNFCGI  Enable spawn-fcgi utility                 
         │ │       [ ] VALGRIND   Enable valgrind support                   
         │ │       [ ] WEBDAV     Enable WebDAV support                    
  8. make install clean
  9. echo ‘lighttpd_enable="YES"’ >> /etc/rc.conf
  10. echo ‘spawn_fcgi_enable="YES"’ >> /etc/rc.conf
  11. echo ‘spawn_fcgi_bindsocket="/var/run/lighttpd/php-fastcgi.socket"’
  12. cd /usr/local/etc/rc.d
  13. ./lighttpd start
  14. ./spawn-fcgi start
  15. Я специально не говорю про необходимость создать пользователя www и группу www а также раздать правильные правы на нудные каталоги – это и так понятно.