zoukankan      html  css  js  c++  java
  • lighttpd + php 移植配置

    • buildroot 内添加 lighttpd 和php 等相关选项

        // make menuconfig
        Target packages  --->
            Interpreter languages and scripting  --->
                [*] perl
                [*] php
                [*]   CGI interface
                [*]   FPM interface
                    Extensions  --->
                        [*] Readline
                        [*] Session
                        [*] zlib
                        [*] JSON
                        [*] FTP
                        [*] sockets
                        [*] Posix
                        [*] libxml
    
        Networking applications  --->
            [*] lighttpd
            [*]   openssl support
            [*]   zlib support
            [*]   bzip2 support
            [*]   pcre support
            [*]   webdav support        
    
    • 进入生成的文件系统配置 lighttpd + php

        //  vim etc/lighttpd/lighttpd.conf
        var.log_root    = "/usr/share/lighttpd/log"            // log 日志存放点
        var.server_root = "/usr/share/lighttpd/www"
        var.state_dir   = "/usr/share/lighttpd/run"
        var.home_dir    = "/usr/share/lighttpd/lib/lighttpd"
        var.conf_dir    = "/etc/lighttpd"
    
        var.cache_dir   = "/usr/share/lighttpd/cache/lighttpd"
    
        var.socket_dir  = home_dir + "/sockets"       // /usr/share/lighttpd/lib/lighttpd/sockets
    
        server.use-ipv6 = "disable"
        
        server.document-root = server_root + "/webpages"
    
        server.event-handler = "linux-sysepoll"
        
        server.network-backend = "writev"
        
        server.upload-dirs = ( "/usr/share/lighttpd/upload" )
    
        //  vim etc/lighttpd/modules.conf
        server.modules = ( 
       "mod_access",
       "mod_alias",
        #  "mod_auth",
        #  "mod_authn_file",
        #  "mod_evasive",
        #  "mod_redirect",
        #  "mod_rewrite",
        #  "mod_setenv",
        #  "mod_usertrack",
        #  "mod_compress",
        )
    
        include "conf.d/compress.conf"
        
        include "conf.d/fastcgi.conf"
    
        // vim etc/lighttpd/conf.d/fastcgi.conf
        server.modules += ( "mod_fastcgi" )
    
        ##
        ## PHP Example
        ## For PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini.
        ##
        ## The number of php processes you will get can be easily calculated:
        ##
        ## num-procs = max-procs * ( 1 + PHP_FCGI_CHILDREN )
        ##
        ## for the php-num-procs example it means you will get 17*5 = 85 php
        ## processes. you always should need this high number for your very
        ## busy sites. And if you have a lot of RAM. :)
        ##
        fastcgi.server = ( 
                    ".php" =>
                        ( "php-local" =>
                           (   
                        "socket" => socket_dir + "/php-fastcgi-1.socket",
                                "bin-path" => "/usr/bin/php-cgi",
                                "max-procs" => 1,
                        "broken-scriptfilename" => "enable",
                           )   
                        )   
                    ) 
    
        // vim etc/lighttpd/conf.d/compress.conf 
        server.modules += ( "mod_compress" )
    
        ##
        ## where should the compressed files be cached?
        ## see the base config for the declaration of the variable.
        ##
        ## This directory should be changed per vhost otherwise you can
        ## run into trouble with overlapping filenames
        ##
        compress.cache-dir         = cache_dir + "/compress"
    
        ##
        ## FileTypes to compress.
        ## 
        compress.filetype          = ("text/plain", "text/html")
    
        // vim etc/php.ini
        cgi.fix_pathinfo=1
    
    • 创建相关目录

        mkdir -p /usr/share/lighttpd
        cd /usr/share/lighttpd
        mkdir  cache   lib     log     run     upload  www
        mkdir  -p  cache/lighttpd/
        mkdir  -p  lib/lighttpd/sockets/
        mkdir  -p  www/webpages
        touch  www/webpages/index.php
    
    • 给 usr/share/lighttpd/www/webpages/index.php 添加内容

       //    vim usr/share/lighttpd/www/webpages/index.php
       <?php
                echo phpinfo();
        ?>  
    
  • 相关阅读:
    mysql常见的hint
    SQL优化:一篇文章说清楚Oracle Hint的正确使用姿势
    Oracle中常见的Hint(一)
    oracle中hint 详解
    Oracle hint 详解
    neo4j简单学习
    Maven的pom.xml文件结构之基本配置parent和继承结构
    使用TASM编译COFF格式和连接
    使用双引擎,让kbmmw 的客户端访问更方便(既给浏览器做服务,也给桌面程序做服务)
    成大事者不纠结(碰到难办的事情的时候,要就事论事,专注当下,放下过去,不忧未来,也不要记仇。防范之举要节制。是做事情的其中一种策略,而且还要分场合)
  • 原文地址:https://www.cnblogs.com/chenfulin5/p/7568901.html
Copyright © 2011-2022 走看看