Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    Member
    Join Date
    Mar 2004
    Location
    Croatia
    Posts
    21

    Arrow My experience with Apache 2.2, fcgi...

    Hello,


    Yesterday I successfully upgraded Apache from 1.3 to 2.2

    I have manage to build apache with new modules like : new mod_security, mod_bandwith, uniqueid, suphp (replacement for phpsuexec), etc.

    Problems on what I encountered are :

    1. php_flags on users .htaccess - my users can't use php_flags anymore, instead they can place they're own php.ini in public_html (correct me if I'm wrong) and use they're custom php settings. If your users use php_flags it will result Internal server error.

    2. suphp and fcgi - If you are using suphp or fcgi and your users use files chmoded to 777 or 666, you must change files to 644 and folders to 755 or else you will get Internal server error. I have manage to write few lines which will automatically chmod folders and files :

    Files :
    Code:
    REMOVED by MODS as this may break your server, see next post.
    Folders :
    Code:
    find /home/*/public_html -type d -exec chmod 755 {} \;
    3. Mod_security 2 - With apache2 you can add new mod_security module, and you need new rulset since they are changed from version 1. You can find ruleset in attachment. I found this ruleset here on forum, but I can't find link anymore , so I'm posting it here in my post.

    I had to do those stuff and everything is ok for now. I will replay if I encounter any other problem.

    Please post you experience.
    Attached Files

  2. #2
    Member manokiss's Avatar
    Join Date
    Mar 2002
    Posts
    536

    Default

    hi, thanx to share your experience we havent upgraded yet....let me say that running the command:

    find /home/*/public_html -type f -exec chmod 644 {} \;

    you could skrew up perl scripts, that command will change chmod to any file no matter if is a php or not, you coudl use:

    find /home/*/public_html -name '*.php' -o -name '*.php[34]' -o -name '*.phtml'| xargs chmod -v 644


    About each user php.ini, did you test it? With php suexec is the way that is running but i did read in many other posts that peple upgraded to suphp lost this ability, could you confirm please?

    Also do you run more than php version together?

    Thanx!

  3. #3
    Member
    Join Date
    Mar 2004
    Location
    Croatia
    Posts
    21

    Default

    find /home/*/public_html -name '*.php' -o -name '*.php[34]' -o -name '*.phtml'| xargs chmod -v 644
    Tnx.

    About each user php.ini, did you test it? With php suexec is the way that is running but i did read in many other posts that peple upgraded to suphp lost this ability, could you confirm please?
    I will try this. I'm setting permissions at this moment

    Also do you run more than php version together?
    I don't use php4 for almost a year now, and I have around 900 domains per server.

  4. #4
    Member
    Join Date
    Mar 2004
    Location
    Croatia
    Posts
    21

    Default

    I just encounter one problem. In WHM under "Configure PHP and SuExec" I changed my PHP 5 Handler to fcgi, and now I can't access to hostname/~username for domains that are not pointed to server.

    In my error_log I have this :

    [Sat Oct 13 09:36:47 2007] [notice] mod_fcgid: call /home/username/public_html/index.php with wrapper /usr/local/cpanel/cgi-sys/php5
    [Sat Oct 13 09:36:47 2007] [info] mod_fcgid: server /home/username/public_html/index.php(7871) started
    suexec policy violation: see suexec log for more details
    [Sat Oct 13 09:36:47 2007] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
    [Sat Oct 13 09:36:47 2007] [error] [client 78.0.10.65] Premature end of script headers:
    In suexec log I don't have detailed information about this problem. I would appreciate some help
    Last edited by 1ONE; 10-13-2007 at 02:54 AM.

  5. #5
    Member manokiss's Avatar
    Join Date
    Mar 2002
    Posts
    536

    Default

    Did you open a ticket?, i highly recommend it.

  6. #6
    Member
    Join Date
    May 2003
    Location
    Hokkaido, JAPAN
    Posts
    91

    Default How did you fix php flag problem?

    1. php_flags on users .htaccess - my users can't use php_flags anymore, instead they can place they're own php.ini in public_html (correct me if I'm wrong) and use they're custom php settings. If your users use php_flags it will result Internal server error.
    How did you fix the php_flag problem for .htaccess?

    I have same problem and would like to know how you did it?

    Thanks.

    asiams

  7. #7
    Member manokiss's Avatar
    Join Date
    Mar 2002
    Posts
    536

    Default

    You should not use php flags in .htaccess in a suexec php....instead use the php.ini file with the php variables on it.

  8. #8
    Member InterServed's Avatar
    Join Date
    Jul 2007
    Posts
    172
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Note that php_flag does not work with Apache 2. Neither does on / off — you must use 0 (off) or 1 (on).

    For example enable register_globals on (apache2) / .htaccess :
    php_value register_globals 1

  9. #9
    Member manokiss's Avatar
    Join Date
    Mar 2002
    Posts
    536

    Default

    Quote Originally Posted by InterServed View Post
    Note that php_flag does not work with Apache 2. Neither does on / off — you must use 0 (off) or 1 (on).

    For example enable register_globals on (apache2) / .htaccess :
    php_value register_globals 1
    Only if you are running php as a apache module, that do not work in suexec.

  10. #10
    Member
    Join Date
    Mar 2006
    Location
    Brno, Czech Republic
    Posts
    510

    Default

    how about mod_evasive? any ideas if there is anything similar for apache 2.2 ?
    Not everything that is counted counts and not everything that counts can be counted

  11. #11
    Member
    Join Date
    May 2003
    Location
    Hokkaido, JAPAN
    Posts
    91

    Default Where can I find php.ini file for each customer?

    You should not use php flags in .htaccess in a suexec php....instead use the php.ini file with the php variables on it.
    Reply With Quote
    Can a customer access to php.ini file from Cpanel?

    If not .htaccess, is this feature safe?

    Where can I find all of the php config features for Apache 2.2?

    Thanks.

    asiams

  12. #12
    cPanel Staff
    Join Date
    Mar 2007
    Posts
    113

    Default

    Quote Originally Posted by 1ONE View Post
    I just encounter one problem. In WHM under "Configure PHP and SuExec" I changed my PHP 5 Handler to fcgi, and now I can't access to hostname/~username for domains that are not pointed to server.
    The CGI and FCGI configurations aren't going to work with ~userdir requests without disabling Suexec in the WHM interface and moving the suexec binary away from /usr/local/apache/bin/suexec.

    The FastCGI setup is just a simple baseline configuration that needs to be tweaked for the needs of the server. The CGI setup is intended as a fallback when the other preferrable setups (DSO or SuPHP) aren't options.

  13. #13
    Member
    Join Date
    Mar 2004
    Location
    Croatia
    Posts
    21

    Default

    Tnx!

    I'm now using DSO, and I have php_flags in .htaccess!

    If you are using suphp then you have to place php.ini in your public_html. This php.ini must ONLY contains lines that you need example :

    register_globals on
    some_other_value off
    some_other_value2 12M

    user php.ini should not contain "all php.ini" file !

    I'm satisfied with DSO, but I can't see what my users are doing Is there any fix for this in DSO mode?

  14. #14
    Member
    Join Date
    Apr 2004
    Posts
    10

    Default

    Quote Originally Posted by jdlightsey View Post
    The CGI and FCGI configurations aren't going to work with ~userdir requests without disabling Suexec in the WHM interface and moving the suexec binary away from /usr/local/apache/bin/suexec.

    The FastCGI setup is just a simple baseline configuration that needs to be tweaked for the needs of the server. The CGI setup is intended as a fallback when the other preferrable setups (DSO or SuPHP) aren't options.
    We have PHP compiled as a FastCGI with phpsuexec and suexec enabled, but Apache is v1.3.3.9... and the hostname/~username works... thus, how come it won't work in the new Apache 2 version, did something else change?

  15. #15
    Member PPNSteve's Avatar
    Join Date
    Mar 2003
    Location
    Somewhere in Ilex Forest
    Posts
    309
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by 1ONE View Post
    Hello,

    ...

    3. Mod_security 2 - With apache2 you can add new mod_security module, and you need new rulset since they are changed from version 1. You can find ruleset in attachment. I found this ruleset here on forum, but I can't find link anymore , so I'm posting it here in my post.

    I had to do those stuff and everything is ok for now. I will replay if I encounter any other problem.

    Please post you experience.
    OK tried that mod_security rule set you posted, and apache wouldn't restart.. not sure why (or which rule was crashing it.)

    Anyone else have a WORKABLE and good 2.0 ruleset for a production cPanel box?
    Steve H.
    --------------
    1-GB.NET
    Domain Names

Similar Threads & Tags
Similar threads

  1. Replies: 10
    Last Post: 12-11-2010, 05:43 PM
  2. PHP5 + Apache using fcgi working, phpinfo problem
    By momon in forum Optimization
    Replies: 3
    Last Post: 07-05-2010, 09:14 AM
  3. FCGI + mpm_worker
    By petteyg359 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-23-2009, 09:33 PM
  4. Apache 2.2, FCGI and mod_userdir
    By WebJIVE in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-12-2008, 08:34 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube