[Solved] problem with php

Discussion in 'Install/Configuration' started by mihanwebhost, Mar 13, 2011.

  1. mihanwebhost

    mihanwebhost New Member

    hello
    i have problem with perl script today
    i dont have any change to server configration but in litespeed mode my perl programs cant run
    i dont have any problem with apache and only have this problem with litespeed
  2. webizen

    webizen New Member

    check error log (e.g. /usr/local/lsws/logs/error.log or /usr/local/apache/logs/error_log) for details of the problem.
  3. mihanwebhost

    mihanwebhost New Member

    when i switch my web server to litespeed users cant upload files from php script , ...
    i have this problem only on one of my servers


    and this is litespeed error log :


    2011-03-13 21:49:07.622 [NOTICE] [PID: 19742]: start cgid: 19745, /usr/local/lsws/bin/httpd
    2011-03-13 21:49:07.622 [WARN] [config:server:listener] No listener is available for normal virtual host!
    2011-03-13 21:49:07.622 [NOTICE] The maximum number of file descriptor limit is set to 6000.
    2011-03-13 21:49:07.622 [NOTICE] [config:server:epsr:lsphp5]'Process Limit' probably is too low, adjust the limit to: 310.
    2011-03-13 21:49:07.622 [NOTICE] [config:server:epsr:lsphp4]'Process Limit' probably is too low, adjust the limit to: 310.
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/includes/pre_main_global.conf
    2011-03-13 21:49:07.624 [WARN] /usr/local/apache/conf/includes/pre_main_global.conf:3: Directive 'suPHP_ConfigPath' is not allowed in current context.
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/includes/pre_main_2.conf
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/php.conf
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/mod_bandwidth.conf
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/includes/errordocument.conf
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/modsec2.conf
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/modsec2.user.conf
    2011-03-13 21:49:07.624 [INFO] Processing config file: /usr/local/apache/conf/modsec2.whitelist.conf
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.624 [ERROR] [config] rewrite: unknown server variable while parsing: RESPONSE_BODY
    2011-03-13 21:49:07.643 [INFO] Processing config file: /usr/local/apache/conf/includes/pre_virtualhost_global.conf
    2011-03-13 21:49:07.643 [INFO] Processing config file: /usr/local/apache/conf/includes/pre_virtualhost_global.conf
    2011-03-13 21:49:07.643 [INFO] Processing config file: /usr/local/apache/conf/includes/pre_virtualhost_2.conf
    2011-03-13 21:49:07.643 [INFO] Processing config file: /usr/local/apache/conf/includes
  4. webizen

    webizen New Member

    what lsws version are you running?

    The logs captured looks like when litespeed was first started. you need to capture the log entries around the time when upload script failed. That should give us details of the error.
  5. mihanwebhost

    mihanwebhost New Member

    Current Version: 4.0.20

    i see below error in litespeed log
    when i upload a file

    ERROR [[HTAccess]] rewrite: unknown server variable while parsing: ^multipart/form-data;)"
  6. mihanwebhost

    mihanwebhost New Member

    when i switch web server to litespeed
    users cant upload files with php scripts
    for example wordpress have below error :

    File upload stopped by extension.
  7. webizen

    webizen New Member

  8. mihanwebhost

    mihanwebhost New Member

    after install 4.1RC5 my problem not fixed and i cant switch to apache now error :
    i killed all litespeed process but cant switch to apache

    LSWS Stopped.
    [OK] litespeed: pid=26110.
    Apache is not up within 30 secs, try again by force kill litespeed.
    [OK] litespeed: pid=26513.
    Apache is still not up.

    Failed to switch to Apache! Please either start LiteSpeed or manually switch to Apache!

    Apache is not started may be caused by configuration error. To manually check this problem, please ssh to your server and check:

    Try stop LiteSpeed if lshttpd still running:
    killall -9 lshttpd

    remove the lsws wrapper if the original one is found:

    restore Apache httpd if /usr/local/apache/bin/httpd_ls_bak exists.
    mv -f /usr/local/apache/bin/httpd_ls_bak /usr/local/apache/bin/httpd

    restore cPanel restart httpd script if /scripts/restartsrv_httpd_ls_bak exists.
    mv -f /scripts/restartsrv_httpd_ls_bak /scripts/restartsrv_httpd

    run the restart command manually: /scripts/restartsrv_httpd and check the error.
    Last edited: Mar 13, 2011
  9. mihanwebhost

    mihanwebhost New Member

    /usr/local/apache/bin/httpd_ls_bak': No such file or directory
    Last edited: Mar 14, 2011
  10. webizen

    webizen New Member

    please pm the server temporary root access.
  11. webizen

    webizen New Member

    File upload is ok once commented out this line in /usr/local/lib/php.ini
  12. mihanwebhost

    mihanwebhost New Member

    thanks :x

    i have one problem i cant switch to apache to compile my php from easy apache
    /usr/local/apache/bin/httpd
    and i replaced it with httpd file
    but my problem not fixed
  13. webizen

    webizen New Member

    Further checking reveals that Apache could not start because mod_auth_passthrough.so file was in the wrong folder /usr/local/apache/modules/modules! Most likely it was messed up when you copied files around.

    It is OK now. You can switch between Apache and LiteSpeed.
    Last edited: Mar 14, 2011
  14. webizen

    webizen New Member

    Update:

    The file /etc/cxs/cxscgi.sh is empty (all lines are commented out) except for the first line "#!/bin/sh"

    According to suhosin document (http://www.hardened-php.net/suhosin/configuration.html#suhosin.upload.verification_script), it needs something like "echo 1" as its first line to allow upload.
    Added that line ("echo 1") to the script and uncommented the line in /usr/local/lib/php.ini. file upload is working.
    So the cause of "File upload stopped by extension" error is /etc/cxs/cxscgi.sh script not having "1" as first line in standard output (no output in this case).
    Last edited: Mar 14, 2011
  15. Rezaa

    Rezaa New Member

    Hello,

    I'm using CXS for scanning uploaded files and prevent users from uploading malicious files to the server.
    But recently my server load is growing up and sometimes becomes too high (more than 20 or even 30) due to high traffics on apache.
    My server manager suggesting me to get litespeed. But as CXS official website says, litespeed does not support some mod_security rules that needed by CXS, So it seems CXS will not work with litespeed.

    But I see this guy is using CXS along with Litespeed! Isn't it ?
    Does it make any problem?
    Does CXS really works along with Litespeed?

    Please correct me if I'm wrong. I seriously need the power of both CXS and Litespeed on my server (one for security and another one for speed)
  16. webizen

    webizen New Member

    if your upload is handled via php, cxs should work with litespeed via suhosin hook (see cxs install.txt for how to enable suhosin hook).
  17. Rezaa

    Rezaa New Member

    What about FTP uploads?
  18. webizen

    webizen New Member

Share This Page