Resolved httpd version 2 POST size limited at 2K

今天花了一天的時間在重新挑戰我的wordpress 上傳檔案的問題,經過反覆測試發現問題並不是出在php-5.x.x本身的設定,而是卡在apache httpd v2的POST功能有2K大小的限制,因為這個原因導至我在Wordpress上貼的文章或上傳的檔案大小只是超過2K就無法上傳。

解決辦法就是換掉httpd 改用lighttpd-1.4.37,記錄一下修改的部份
1. INSTALL
    * ./configure & make install

2. Startup script
    * cd lighttpd-1.4.37/doc/initscripts/
    * cp sysconfig.lighttpd /etc/sysconfig/lighttpd
    * cp rc.lighttpd.redhat /etc/init.d/lighttpd -> edit 
     

lighttpd="/usr/local/sbin/lighttpd"

3. mkdir /etc/lighttpd
4. cd lighttpd-1.4.37/doc/config
    * cp lighttpd.conf  /etc/lighttpd/
    * cp modules.conf  /etc/lighttpd/
    * cp -r conf.d /etc/lighttpd
    * edit /etc/lighttpd/lighttpd.conf

server.use-ipv6 = "disable"
server.username  = "apache"
server.groupname = "apache"
server.document-root = "/var/www/html/"
server.event-handler = "poll"

 

5. cd /etc/lighttpd/conf.d
   * rm fastcfg.conf and new one as below
     

fastcgi.server += ( ".php" =>
                    ("localhost" => 
                       (
                       "bin-path" => "/usr/bin/php-cgi",
                       "max-procs" => 5,
                       "host" => "127.0.0.1",
                       "broken-scriptfilename" => "enable",
                     ))
                )

6. mkdir /var/log/lighttpd/
   * touch /var/log/lighttpd/error.log
   * touch  /var/log/lighttpd/access.log
   * chown -R apache:apache /var/log/lighttpd/

7. start lighttpd service
   * /etc/init.d/lighttpd start
   * chkconfig -add lighttpd
   * chkconfig –level 345 lighttpd on