Suexec Problems

Discussion in 'General' started by mphayesuk, May 3, 2006.

  1. mphayesuk

    mphayesuk New Member

    I am on suse10 64bit and when installing ispconfig used /srv/www I am trying to use the test files all of them work except for the hello_world.pl one. I have set the file to chmod 777 and still no joy, if I turn off the suexec it works.

    any ideas.
     
  2. mphayesuk

    mphayesuk New Member

    Putty

    also a quick note if I try and use putty it attempts to make the connection and then lets me log in, but before I get a command prompt my server closes the connection.

    Any ideas.
     
  3. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Who is the owner and group of that web site? The Perl file must belong to this owner and group with suExec.

    Did you enable Shell access for the web and the user?
     
  4. mphayesuk

    mphayesuk New Member

    1) How do I check who is the owner and group
    2) How would I change it if its wrong

    3) I tried to login as root using putty... I think I need to enable shell access for root at some point or perhaps create a different system user.

    Thanks
     
  5. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Code:
    ls -l /path/to/file
    Code:
    chown owner:group /path/to/file
    Normally root has shell access unless you changed something in /etc/passwd...
     
  6. mphayesuk

    mphayesuk New Member

    So I am not understanding how it is supposed to work, if I create a new site and login and upload perl scripts they are not going to work, so is there something else I am going to have to do.

    Do I need to create owners and groups.

    I am just not understanding this bit... can someone explain it.

    Thanks
     
  7. mphayesuk

    mphayesuk New Member

    Ok when I do ls -l on the .pl file this is what I get

    server1:~ # ls -l /srv/www/web1/cgi-bin/hello_world.pl
    -rwxrwxrwx 1 web1-user1 web1 379 May 3 11:02 /srv/www/web1/cgi-bin/hello_world.pl
    server1:~ #

    Which as far as I can tell is right so what do I try next....

    Thanks
     
  8. mphayesuk

    mphayesuk New Member

    What group members should my groups have i.e. group web1 should be a member of "admispconfig", "web1-user1" should there be any others like "postfix","root","wwwrun" ect...
     
  9. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Is it web1-user1 or web1_user1? Is this user the site admin?
    Can you post the vhost configuration for this web site from Vhosts_ispconfig.conf?
     
  10. mphayesuk

    mphayesuk New Member

    It is web1-user1 I change the prefix. I will post the contents of vhosts shortly.
     
  11. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Linux doesn't like - in usernames. That might be the problem.
     
  12. mphayesuk

    mphayesuk New Member

    ok the "-" > "_" fixed my ftp problem (I Hope), but I am still having a problem with the perl scripts so here is the vhosts file.

    ###################################
    #
    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    NameVirtualHost xxx.xxx.xxx.4:80
    <VirtualHost xxx.xxx.xxx.4:80>
    ServerName localhost
    ServerAdmin root@localhost
    DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.touch-one.co.uk:80
    ######################################
    #
    #
    <VirtualHost xxx.xxx.xxx.4:80>
    SuexecUserGroup web4_user1 web4
    ServerName www.touch-one.co.uk:80
    ServerAdmin webmaster@touch-one.co.uk
    DocumentRoot /srv/www/web4/web
    ServerAlias touch-one.co.uk
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias /cgi-bin/ /srv/www/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/web4/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode On
    php_admin_value open_basedir /srv/www/web4/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /srv/www/web4/phptmp/
    php_admin_value session.save_path /srv/www/web4/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/srv/www/web4/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /srv/www/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web4/user/$1/web/$3
    </VirtualHost>
    #
    #
    #

    Everything looks fine to me. Just to point out that I have two public addresses .4 and .3.

    Thanks
     
  13. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Which SuSE version do you use?
     
  14. mphayesuk

    mphayesuk New Member

    suse10 64bit
     
  15. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    What's the output of
    Code:
    /usr/sbin/suexec2 -V
    ?
     
  16. mphayesuk

    mphayesuk New Member

    OUTPUT -

    server1:~ # /usr/sbin/suexec2 -V
    -D AP_DOC_ROOT="/srv/www"
    -D AP_GID_MIN=96
    -D AP_HTTPD_USER="wwwrun"
    -D AP_LOG_EXEC="/var/log/apache2/suexec.log"
    -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
    -D AP_UID_MIN=96
    -D AP_USERDIR_SUFFIX="public_html"

    To me the userdir is wrong because I dont have a folder called that in any of my clients folders ??????

    Thanks
     
  17. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    The DOC_ROOT /srv/www is ok. What's in /var/log/apache2/suexec.log?
     
  18. mphayesuk

    mphayesuk New Member

    1) I was meaning the public_html userdirsuffix is that right???

    OutPut of File

    [2006-05-03 11:03:24]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:03:24]: file has no execute permission: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:04:18]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:04:18]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:11:40]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:11:40]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:11:44]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:11:44]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:11:45]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:11:45]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:11:46]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:11:46]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:11:47]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:11:47]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 11:14:23]: uid: (10008/web1-user1) gid: (10001/10001) cmd: hello_world.pl
    [2006-05-03 11:14:23]: file is writable by others: (/srv/www/web1/cgi-bin/hello_world.pl)
    [2006-05-03 15:53:54]: uid: (10010/web2-user1) gid: (10002/10002) cmd: hello_world.pl
    [2006-05-03 15:53:54]: file has no execute permission: (/srv/www/web2/cgi-bin/hello_world.pl)
    [2006-05-04 22:55:11]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-04 22:55:11]: file has no execute permission: (/srv/www/web4/cgi-bin/hello_world.pl)
    [2006-05-04 22:55:47]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-04 22:55:47]: file is writable by others: (/srv/www/web4/cgi-bin/hello_world.pl)
    [2006-05-04 22:55:50]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-04 22:55:50]: file is writable by others: (/srv/www/web4/cgi-bin/hello_world.pl)
    [2006-05-04 22:55:52]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-04 22:55:52]: file is writable by others: (/srv/www/web4/cgi-bin/hello_world.pl)
    [2006-05-07 17:13:10]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-07 17:13:10]: file is writable by others: (/srv/www/web4/cgi-bin/hello_world.pl)
    [2006-05-07 17:14:29]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-07 17:14:29]: file is writable by others: (/srv/www/web4/cgi-bin/hello_world.pl)
    [2006-05-07 17:14:33]: uid: (10012/web4_user1) gid: (10004/10004) cmd: hello_world.pl
    [2006-05-07 17:14:33]: file is writable by others: (/srv/www/web4/cgi-bin/hello_world.pl)

    Thanks
     
  19. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    It doesn't matter.



    Try this:
    Code:
    chmod 755 /srv/www/web4/cgi-bin/hello_world.pl
     
  20. mphayesuk

    mphayesuk New Member

    The hello_world.pl stated at 755 and after that didn't work I changed it to 777.

    I think we are starting to run out of things to try........

    Thanks
     

Share This Page