Results 1 to 14 of 14
  1. #1

    phpsuexec 500 problem

    Getting 500 error on a php page, but I cannot trace why

    Code:
    [email protected] [/home/client/public_html/dikeycizgi]# ls -lh
    total 20K
    drwxr-xr-x   2 client client 4.0K Oct 20 07:47 ./
    drwxr-x---  12 client nobody  4.0K Oct 20 07:35 ../
    -rwxrwxrwx   1 client client   60 Oct 20 07:36 ders_eklendi.php*
    -rwxrwxrwx   1 client client  862 Oct 20 07:36 ders_ekle.php*
    -rw-r--r--   1 client client    8 Oct 20 07:42 index.html
    [email protected] [/home/client/public_html/dikeycizgi]# chmod 755 der*
    [email protected] [/home/client/public_html/dikeycizgi]# ls -lh
    total 20K
    drwxr-xr-x   2 client client 4.0K Oct 20 07:47 ./
    drwxr-x---  12 client nobody  4.0K Oct 20 07:35 ../
    -rwxr-xr-x   1 client client   60 Oct 20 07:36 ders_eklendi.php*
    -rwxr-xr-x   1 client client  862 Oct 20 07:36 ders_ekle.php*
    -rw-r--r--   1 client client    8 Oct 20 07:42 index.html
    [email protected] [/home/client/public_html/dikeycizgi]# cd ..
    [email protected] [/home/client/public_html]# ls -lh
    total 180K
    drwxr-x---  12 client nobody  4.0K Oct 20 07:35 ./
    drwxr-xr-x  10 client client 4.0K Oct 20 13:15 ../
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 cgi-bin/
    -rw-r--r--   1 client client 103K Oct  5 13:01 Const.jpg
    -rw-rw-rw-   1 client client   60 Oct 20 07:32 ders_eklendi.php
    -rwxrwxrwx   1 client client  862 Oct 20 07:32 ders_ekle.php*
    drwxr-xr-x   2 client client 4.0K Oct 20 07:47 dikeycizgi/
    -rw-r--r--   1 client client  357 Oct  4 18:54 .htaccess
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 images/
    -rw-r--r--   1 client client  553 Oct  5 13:01 index.php
    -rw-r--r--   1 client client 2.4K Oct  4 18:54 postinfo.html
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _private/
    drwxr-xr-x   5 client client 4.0K Oct 20 13:12 twturk/
    drwxr-xr-x   4 client client 4.0K Oct  4 18:54 _vti_bin/
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_cnf/
    -rw-r--r--   1 client client 1.8K Oct  4 18:54 _vti_inf.html
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_log/
    drwxr-x---   2 client nobody  4.0K Oct  4 18:54 _vti_pvt/
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_txt/

  2. #2
    Join Date
    Oct 2006
    Posts
    44
    The 5xx series error messages are used for internal server errors, so showing the directories and file premissions doesn't help much (if that was the problem, it would be a 4xx error code).

    Look through the error logs for your web server, and post the error messages if you need help understanding them.

    Edit: Sorry, just noticed you're using phpsuexec. So it might be a file permissions error (I haven't used phpsuexec much, so I don't know), but the only way to really tell what's going on is to look at the error logs.
    Last edited by spryandrew; 10-20-2006 at 03:09 PM.
    Andrew
    Spry VPS Hosting cPanel VPS, Plesk VPS, Webmin VPS, Shared, Domain Registration, Dedicated and Colo
    VPSLink Cheap VPS accounts CentOS, Fedora 4/5/6, RHEL, Gentoo, Debian, Ubuntu -- Dapper/Edgy, Slackware, OpenSUSE, LAMP + Ruby pre-installed available

  3. #3
    Join Date
    Apr 2002
    Posts
    930
    Your PHP scripts need to bet set with permission 644. These appears to be set at 777, 755, 666. They all need to be set at 644 and the directories need to be set at 755.

  4. #4
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,294
    chown -R client:client /home/client/public_html

    -rwxrwxrwx 1 client client 60 Oct 20 07:36 ders_eklendi.php*
    -rwxrwxrwx 1 client client 862 Oct 20 07:36 ders_ekle.php*

    those files, make them chmod 644.. Chmod 777 files WILL NOT WORK.
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

  5. #5
    I ran chown -R client:client /home/client/public_html

    now I get 403

    Code:
    [email protected] [/home/client/public_html]# ls -lh
    total 180K
    drwxr-x---  12 client client 4.0K Oct 20 07:35 ./
    drwxr-xr-x  10 client client 4.0K Oct 20 13:45 ../
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 cgi-bin/
    -rw-r--r--   1 client client 103K Oct  5 13:01 Const.jpg
    -rw-rw-rw-   1 client client   60 Oct 20 07:32 ders_eklendi.php
    -rwxrwxrwx   1 client client  862 Oct 20 07:32 ders_ekle.php*
    drwxr-xr-x   2 client client 4.0K Oct 20 07:47 dikeycizgi/
    -rw-r--r--   1 client client  357 Oct  4 18:54 .htaccess
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 images/
    -rw-r--r--   1 client client  553 Oct  5 13:01 index.php
    -rw-r--r--   1 client client 2.4K Oct  4 18:54 postinfo.html
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _private/
    drwxr-xr-x   5 client client 4.0K Oct 20 13:12 twturk/
    drwxr-xr-x   4 client client 4.0K Oct  4 18:54 _vti_bin/
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_cnf/
    -rw-r--r--   1 client client 1.8K Oct  4 18:54 _vti_inf.html
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_log/
    drwxr-x---   2 client client 4.0K Oct  4 18:54 _vti_pvt/
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_txt/

  6. #6
    Join Date
    Oct 2006
    Posts
    44
    403 is the access forbidden error number. Whatever you changed, the server can't access the files anymore. So you'll have to change it back.

    It also likely means that apache is trying to access the directories as nobody. Try
    chown -R client:nobody /home/client/public_html
    and see what happens.
    Andrew
    Spry VPS Hosting cPanel VPS, Plesk VPS, Webmin VPS, Shared, Domain Registration, Dedicated and Colo
    VPSLink Cheap VPS accounts CentOS, Fedora 4/5/6, RHEL, Gentoo, Debian, Ubuntu -- Dapper/Edgy, Slackware, OpenSUSE, LAMP + Ruby pre-installed available

  7. #7
    I can't do nobody because phpsuexec is enabled

    Code:
    [email protected] [/home/client/public_html]# ls -lh
    total 180K
    drwxr-x---  12 client client 4.0K Oct 20 07:35 ./
    drwxr-xr-x  10 client client 4.0K Oct 20 13:45 ../
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 cgi-bin/
    -rw-r--r--   1 client client 103K Oct  5 13:01 Const.jpg
    -rw-rw-rw-   1 client client   60 Oct 20 07:32 ders_eklendi.php
    -rwxrwxrwx   1 client client  862 Oct 20 07:32 ders_ekle.php*
    drwxr-xr-x   2 client client 4.0K Oct 20 07:47 dikeycizgi/
    -rw-r--r--   1 client client  357 Oct  4 18:54 .htaccess
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 images/
    -rw-r--r--   1 client client  553 Oct  5 13:01 index.php
    -rw-r--r--   1 client client 2.4K Oct  4 18:54 postinfo.html
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _private/
    drwxr-xr-x   5 client client 4.0K Oct 20 13:12 twturk/
    drwxr-xr-x   4 client client 4.0K Oct  4 18:54 _vti_bin/
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_cnf/
    -rw-r--r--   1 client client 1.8K Oct  4 18:54 _vti_inf.html
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_log/
    drwxr-x---   2 client client 4.0K Oct  4 18:54 _vti_pvt/
    drwxr-xr-x   2 client client 4.0K Oct  4 18:54 _vti_txt/
    [email protected] [/home/client/public_html]# cd dik*
    [email protected] [/home/client/public_html/dikeycizgi]# ls -lh
    total 20K
    drwxr-xr-x   2 client client 4.0K Oct 20 07:47 ./
    drwxr-x---  12 client client 4.0K Oct 20 07:35 ../
    -rwxr-xr-x   1 client client   60 Oct 20 07:36 ders_eklendi.php*
    -rwxr-xr-x   1 client client  862 Oct 20 07:36 ders_ekle.php*
    -rw-r--r--   1 client client    8 Oct 20 07:42 index.html

  8. #8
    Logs:

    [Fri Oct 20 14:05:54 2006] [error] [client xxx] File does not exist: /home/client/public_html/twturk/500.shtml
    [Fri Oct 20 14:08:48 2006] [error] [client xxx] Premature end of script headers: /home/client/public_html/twturk/dikeycizgi/ders_ekle.php

  9. #9
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,294
    Quote Originally Posted by spryandrew
    403 is the access forbidden error number. Whatever you changed, the server can't access the files anymore. So you'll have to change it back.

    It also likely means that apache is trying to access the directories as nobody. Try
    chown -R client:nobody /home/client/public_html
    and see what happens.

    it does not need to be client:nobody when running phpsuexec, heneeds to fix the chmod on the public_html directory instead. It needs to be chown client:client
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

  10. #10
    drwxr-x--- 12 client client 4.0K Oct 20 14:26 public_html/

  11. #11
    Join Date
    Apr 2002
    Posts
    930
    Is this a cpanel server?

    The public_html folder needs to have ownership of client:nobody

    Take what Steven said:

    chown -R client:client public_html

    then add to that:

    chown client:nobody public_html

    And just for good measure:

    chmod 750 public_html

  12. #12
    Now I'm back to 500 error

    Code:
    drwxr-xr-x   10 lefteye lefteye 4.0K Oct 20 13:45 ./
    drwx--x--x  825 root    root     20K Oct 20 15:52 ../
    -rw-r--r--    1 lefteye lefteye  304 Oct  4 18:54 .bash_logout
    -rw-r--r--    1 lefteye lefteye  191 Oct  4 18:54 .bash_profile
    -rw-r--r--    1 lefteye lefteye  124 Oct  4 18:54 .bashrc
    -rw-r--r--    1 lefteye lefteye   21 Oct  4 18:54 .contactemail
    drwx------    2 root    root    4.0K Oct  5 07:21 .cpanel-datastore/
    drwxr-xr-x    5 lefteye lefteye 4.0K Oct 20 07:35 etc/
    drwxr-xr-x    5 lefteye lefteye 4.0K Oct  5 08:46 .fantasticodata/
    -rw-------    1 lefteye lefteye   10 Oct  5 23:28 .ftpquota
    -rw-------    1 lefteye lefteye   13 Oct 20 13:45 .lastlogin
    drwxrwx---    8 lefteye mail    4.0K Oct 18 16:08 mail/
    drwxr-xr-x    3 lefteye lefteye 4.0K Jul 17 18:46 public_ftp/
    drwxr-x---   12 lefteye nobody  4.0K Oct 20 14:26 public_html/
    drwxr-xr-x    7 lefteye lefteye 4.0K Oct 19 16:20 tmp/
    drwx------    2 lefteye lefteye 4.0K Oct 16 19:34 .trash/
    lrwxrwxrwx    1 lefteye lefteye   11 Oct  4 18:54 www -> public_html/
    Code:
    total 180K
    drwxr-x---  12 lefteye nobody  4.0K Oct 20 14:26 ./
    drwxr-xr-x  10 lefteye lefteye 4.0K Oct 20 13:45 ../
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct  4 18:54 cgi-bin/
    -rw-r--r--   1 lefteye lefteye 103K Oct  5 13:01 Const.jpg
    -rw-rw-rw-   1 lefteye lefteye   60 Oct 20 07:32 ders_eklendi.php
    -rwxrwxrwx   1 lefteye lefteye  862 Oct 20 07:32 ders_ekle.php*
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct 20 07:47 dikeycizgi/
    -rw-r--r--   1 lefteye lefteye  357 Oct  4 18:54 .htaccess
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct  4 18:54 images/
    -rw-r--r--   1 lefteye lefteye  553 Oct  5 13:01 index.php
    -rw-r--r--   1 lefteye lefteye 2.4K Oct  4 18:54 postinfo.html
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct  4 18:54 _private/
    drwxr-xr-x   5 lefteye lefteye 4.0K Oct 20 13:12 twturk/
    drwxr-xr-x   4 lefteye lefteye 4.0K Oct  4 18:54 _vti_bin/
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct  4 18:54 _vti_cnf/
    -rw-r--r--   1 lefteye lefteye 1.8K Oct  4 18:54 _vti_inf.html
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct  4 18:54 _vti_log/
    drwxr-x---   2 lefteye lefteye 4.0K Oct  4 18:54 _vti_pvt/
    drwxr-xr-x   2 lefteye lefteye 4.0K Oct  4 18:54 _vti_txt/

  13. #13
    Join Date
    Apr 2002
    Posts
    930
    You still have php scripts that are set to 666, 777, and 755.

    Anything that has a .php extension has to be set to 644 (that would look like -rw-r--r--)

    Try this:

    find /home/lefteye/public_html -type f name \*\.php -exec chmod 644 {} \;
    find /home/lefteye/public_html -type d -exec chmod 755 {} \;
    chown -R lefteye:lefteye /home/lefteye/public_html
    chown lefteye:nobody /home/lefteye/public_html
    chmod 750 /home/lefteye/public_html

  14. #14
    Thank you. That worked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •