The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Evertime we run /scripts/easyapache

Discussion in 'EasyApache' started by sexy_guy, Jun 8, 2003.

  1. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Why is it that evertime we run /scripts/easyapache/ that we have to go back into httpd.conf and uncomment the following directives?

    LoadModule php4_module libexec/libphp4.so
    AddModule mod_php4.c

    HELLO! Without this php doesnt run properly :rolleyes:

    cPanel.net Support Ticket Number: We have to uncomment php4_module
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    I just ran it, and I didn't have to do that. Does it happen on all your servers?

    cPanel.net Support Ticket Number:
     
  3. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    All of them evertime we run the darn thing. It gets tiring to have to uncomment it. We noticed it when a user complained that he though not all php commands were available to him. After looking at http.conf we noticed it was commented out. So we uncommented it and restart Apache. We also run 4.3.1. Something is up with this!

    cPanel.net Support Ticket Number:
     
  4. Curious Too

    Curious Too Well-Known Member

    Joined:
    Aug 31, 2001
    Messages:
    427
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    I have never had to do this.

    cPanel.net Support Ticket Number:
     
  5. howard

    howard Well-Known Member

    Joined:
    Apr 20, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Have you elected to run phpsuexec when you do buildapache? If so then the buildapache will do this because otherwise apache will use the php module specifed in the httpd.conf and thus you will not get any of the additonal protections afforded by the phpsuexec stuff

    cPanel.net Support Ticket Number:
     
  6. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Ok, so your saying if i elect to use php 4.3.1 and phpsuexec then this has to be commented out? Are you sure about that? Maybe thats why phpsuexec doesnt work on any of our systems after installing it. Can you claify this? Thank you.

    On another note, some of my users custom php scripts are getting 500's if i comment this out.

    LoadModule php4_module libexec/libphp4.so
    AddModule mod_php4.c

    cPanel.net Support Ticket Number:
     
    #6 sexy_guy, Jun 8, 2003
    Last edited: Jun 8, 2003
  7. howard

    howard Well-Known Member

    Joined:
    Apr 20, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    yes thats correct, apache will always prefer using a module rather than calling a external binary (which is what phpsuexec does) as its obviously quicker to use complied in functions rather than calling a external app to do it

    With regards to the error 500 problems, do any of your users uses php_value type stuff in say a .htaccess file? that sort of thing unfortaunely doesn't anymore since the .htacces module can't access any of the php code anymore since its no longer linked into apache via a module or actually compiled into the codebase

    You can check how its being parsed by Apache by looking at the Server API from a phpinfo(); if its says CGI then the phpsuexec patch is working if it says Server module or something like it then its using the apache module obviously

    cPanel.net Support Ticket Number:
     
    #7 howard, Jun 8, 2003
    Last edited: Jun 8, 2003
  8. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Server API is CGI

    Howard his using the following in his .htaccess

    # Local PHP settings
    # bool: php_flag setting_name on|off
    # non-bool: php_value setting_name setting_value

    php_flag register_globals off
    php_flag short_open_tag off
    php_flag display_errors off
    php_flag log_errors on
    php_flag session.use_trans_sid off
    php_value session.name DGSESSID
    php_value session.gc_maxlifetime 600
    php_value session.cache_expire 300
    php_value session.entropy_file /dev/urandom
    php_value session.entropy_length 256
    php_value session.save_path /home/xxx/tmp/sessions
    php_value include_path .:/home/xxx/include
    php_value error_log /home/xxx/tmp/php.error.log
    php_value error_reporting 1

    # Apache settings
    AuthType Basic
    AuthName "xxx"
    AuthUserFile /home/xxxx/xxxx/cgi-bin/passwd
    require valid-user

    Is it possible to add this to httpd.conf, to his site directives? If so how?

    cPanel.net Support Ticket Number:
     
    #8 sexy_guy, Jun 8, 2003
    Last edited: Jun 8, 2003
  9. carlgm

    carlgm Well-Known Member

    Joined:
    Mar 25, 2003
    Messages:
    103
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England, UK
    You can only inforce php values within the httpd.conf file and not .htaccess.

    cPanel.net Support Ticket Number:
     
  10. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    His site not not getting 500 errors before we turned on phpsuexec so this must have been working.

    cPanel.net Support Ticket Number:
     
  11. Faldran

    Faldran Well-Known Member

    Joined:
    May 28, 2002
    Messages:
    136
    Likes Received:
    0
    Trophy Points:
    16
    Yeah, with PHP+SuExec, php values will not work in .htaccess, but you can add them to httpd.conf file...

    cPanel.net Support Ticket Number:
     
  12. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Where do i put the values, exactly where do i put them?

    cPanel.net Support Ticket Number:
     
  13. Woofkitty

    Woofkitty Member

    Joined:
    Jun 7, 2003
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    inside the site's "virtualhost" directive...

    cPanel.net Support Ticket Number:
     
  14. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    All of these?

    php_flag register_globals off
    php_flag short_open_tag off
    php_flag display_errors off
    php_flag log_errors on
    php_flag session.use_trans_sid off
    php_value session.name DGSESSID
    php_value session.gc_maxlifetime 600
    php_value session.cache_expire 300
    php_value session.entropy_file /dev/urandom
    php_value session.entropy_length 256
    php_value session.save_path /home/xxx/tmp/sessions
    php_value include_path .:/home/xxx/include
    php_value error_log /home/xxx/tmp/php.error.log
    php_value error_reporting 1

    Apache wouldnt restart when i did that

    cPanel.net Support Ticket Number:
     
  15. howard

    howard Well-Known Member

    Joined:
    Apr 20, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Unfortunately you can't specify php_ stuff (in a config such as htaccess or httpd.conf) if you want to run phpsuexec properly unless you want to play around with the mod_php module so you get the correct hooks but still run the php script under the domains user id

    I belive apache2 is trying to resolve this but at last look they were having problems getting it to work in a secure workable manner

    cPanel.net Support Ticket Number:
     
  16. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    This problem has been solved. Just copy your php.ini into the user web root and let them modify their own php.ini.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page