SuPHP and ISPconfig

Discussion in 'Installation/Configuration' started by planet_fox, Nov 12, 2006.

Thread Status:
Not open for further replies.
  1. planet_fox

    planet_fox Member HowtoForge Supporter

    I have howto up suphp run and i have some questions

    questions 1

    I have apache2-mpm install already. must I install for suphp apache2-worker ?
    The problem I have lots of websites on this server.

    questions 2

    what must i wride in vhostsconfig in /etc/apache2/Vhosts/chosts_ispconfig,
    my root directory for user is under /home/websites/ is it a problem ?

    question 3

    Code:
    # Vhost: www.myhost.de:80
    ######################################
    #
    #
    <VirtualHost 878.155.7.886:80>
    <Directory /home/times/www.ed-talk.de/web/>
    Options +Includes +FollowSymlinks -Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
    <Files ~ '^.ht'>
    Deny from all
    </Files>
    </Directory>
    SuexecUserGroup web4_ftp web4
    ServerName myhost.de:80
    ServerAdmin [email protected]
    DocumentRoot /home/times/web4/web
    ServerAlias myhost.de.de www.myhost.de
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm def$
    ScriptAlias  /cgi-bin/ /home/times/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/times/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 Off
    Alias /error/ "/home/times/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 ^/~([^/]+)(/(.*))? /home/times/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/times/web4/user/$1/web/$3
    </VirtualHost>
    and this tags musst in this vhost on which line ?

    suPHP_Engine on
    suPHP_UserGroup web4_ftp web4
    AddHandler x-httpd-php .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-php

    This is my /etc/suphp.conf

    Code:
    [global]
    ;Path to logfile
    logfile=/var/log/suphp.log
    
    ;Loglevel
    loglevel=info
    
    ;User Apache is running as
    webserver_user=www-data
    
    ;Path all scripts have to be in
    docroot=/
    
    ;Path to chroot() to before executing script
    ;chroot=/mychroot
    
    ; Security options
    allow_file_group_writeable=false
    allow_file_others_writeable=false
    allow_directory_group_writeable=false
    allow_directory_others_writeable=false
    
    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=true
    
    ;Send minor error messages to browser
    errors_to_browser=false
    
    ;PATH environment variable
    env_path=/bin:/usr/bin
    
    ;Umask to set, specify in octal notation
    umask=0077
    
    ; Minimum UID
    min_uid=100
    
    ; Minimum GID
    min_gid=100
    
    
    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php
    x-httpd-php=php:/usr/bin/php4-cgi
    x-httpd-php5=php:/usr/bin/php5-cgi
    
    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self
    
    Thanks for help

    I have set in /home/admispconfig/ispconfig/lib/config.inc.php

    $go_info["server"]["apache2_php"] = 'both'; to suphp
     
    Last edited: Nov 12, 2006
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) I gueess you will have to install apache2-worker
    2) NEVER edit the file Vhost_ispconfig.conf manually.
    3) Set $go_info["server"]["apache2_php"] = 'suphp';, you dont have to configure anything else when SuPHP is installed on your system properly.
     
  3. planet_fox

    planet_fox Member HowtoForge Supporter

    hm ok i must only install apache2-worker and set

    $go_info["server"]["apache2_php"] = 'suphp';

    suphp howto i have try from howtoforge.

    Whats then in the enable order
    with the apache2-worker can`t run php as mod is ? is this right ?

    ok in vhost do anything and remove apache2-mpm and install apache2-worker.
     
  4. planet_fox

    planet_fox Member HowtoForge Supporter

    when I do install apache2-mpm-worker . say apache2 this
     
  5. planet_fox

    planet_fox Member HowtoForge Supporter

    When I do all webs php support delete ser start .
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Please set this value in the config.inc.php:

    $go_info["server"]["apache2_php"] = 'suphp';

    and then change a website in ISPConfig, so ISPConfig will start to rewrite your Vhost_ispconfig.conf
     
  7. planet_fox

    planet_fox Member HowtoForge Supporter

    I have already.

    When i do change 1 websites ispconfig change vhost config and do all websites remove phpflags in the vhosts and then i can start apache2 and the problem with phpflags is over. Thats right ?
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Yes, that's right.
     
  9. planet_fox

    planet_fox Member HowtoForge Supporter

    I have do what you say and I have see ispconfig makes the configs for
    Vhost with suphp self and when ido after restart apache says me that

    suPHP_AddHandler not allowed here in /etc/apüache2/vhosts/....
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

  11. planet_fox

    planet_fox Member HowtoForge Supporter

    Code:
    ./configure --prefix=/usr --sysconfdir=/etc --with-apache-user=www-data --with-setid-mode=paranoid --with-apxs=/usr/bin/apxs2
    make
    make install
    Questions must I change this for apache2

    --with-apache-user=www-data
    to
    --with-apache2-user=www-data
     
  12. falko

    falko Super Moderator Howtoforge Staff

    I don't think so, but you can run
    Code:
    ./configure --help
    to find out about it.
     
  13. planet_fox

    planet_fox Member HowtoForge Supporter

    no I menan musat I change this for Apache2 or is the same for apache and apache2. I use apache2

    --with-apache-user=www-data
    to
    --with-apache2-user=www-data
     
  14. edony44

    edony44 New Member

    but no directive

    i've installed suphp
    all work if i put the vhost directive in ispconfig
    suphp_engine on ...

    but not if i don't put them ...
    Is it ok ?
    I was thinking that ispconfig auto-add these line !
     
    Last edited: Nov 14, 2006
  15. planet_fox

    planet_fox Member HowtoForge Supporter

    ok I have this Problem all sites with php error 500

    and this is in the logfiles from /var/logs/suphp

    Code:
    [Wed Nov 15 01:00:20 2006] [info] Executing "/home/times/web9/web/coppermine/thumbnails.php" as UID 10003, GID 10009
    [Wed Nov 15 01:00:28 2006] [info] Executing "/home/times/web9/web/index.php" as UID 10003, GID 10009
    [Wed Nov 15 01:01:40 2006] [warn] Directory "/home/times/web40/web" is writeable by others
    [Wed Nov 15 01:01:41 2006] [warn] Directory "/home/times/web40/web" is writeable by others
    [Wed Nov 15 01:01:42 2006] [warn] Directory "/home/times/web40/web" is writeable by others
    [Wed Nov 15 01:01:52 2006] [warn] Directory "/home/times/web40/web" is writeable by others
    [Wed Nov 15 01:02:22 2006] [warn] File "/home/times/web40/web/news/index.php" is writeable by others
    [Wed Nov 15 01:02:32 2006] [warn] Directory "/home/times/web40/web/forum" is writeable by others
    [Wed Nov 15 01:02:42 2006] [info] Executing "/home/times/web9/web/coppermine/thumbnails.php" as UID 10003, GID 10009
    [Wed Nov 15 01:02:42 2006] [info] Executing "/home/times/web67/web/index.php" as UID 10100, GID 10067
    
    and in /var/apache2/error.log

    Code:
    [Wed Nov 15 00:56:53 2006] [error] [client 62.245.160.105] File does not exist: /var/www/sharedip/apache2-default
    [Wed Nov 15 00:58:30 2006] [notice] caught SIGTERM, shutting down
    [Wed Nov 15 00:58:31 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
    [Wed Nov 15 00:58:32 2006] [notice] Apache configured -- resuming normal operations
    [Wed Nov 15 01:12:24 2006] [notice] caught SIGTERM, shutting down
    [Wed Nov 15 01:12:25 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
    [Wed Nov 15 01:12:26 2006] [notice] Apache configured -- resuming normal operations
    [Wed Nov 15 01:13:15 2006] [notice] caught SIGTERM, shutting down
    [Wed Nov 15 01:13:16 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
    [Wed Nov 15 01:13:17 2006] [notice] Apache configured -- resuming normal operations
    
    php4 -v

    Code:
    php4 -v
    PHP 4.4.4-0.dotdeb.1 (cli) (built: Aug 21 2006 16:07:30)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    
    php4-cgi -v
    Code:
    PHP 4.4.4-0.dotdeb.1 (cgi-fcgi) (built: Aug 21 2006 16:05:04)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

    suphp -v
    Code:
    suPHP version 0.6.1
    (c) 2002-2005 Sebastian Marsching
    
    suPHP has to be called by mod_suphp to work.
    a Vhost

    Code:
    ######################################
    # Vhost: www.myhost.de:80
    ######################################
    #
    #
    <VirtualHost 88.191.7.886:80>
    SuexecUserGroup web1_ftp web1
    ServerName www.myhost.de:80
    ServerAdmin [email protected]
    DocumentRoot /home/times/web1/web
    ServerAlias myhost.de
    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/ /home/times/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/times/web1/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    suPHP_Engine on
    suPHP_UserGroup web1_ftp web1
    AddHandler x-httpd-php .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-php
    Alias /error/ "/home/times/web1/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 ^/~([^/]+)(/(.*))? /home/times/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/times/web1/user/$1/web/$3
    </VirtualHost>
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig adds these lines automatically if you enabled it in the config.inc.php file. You will have to modify one website afterwards so the Vhost_ispconfig.conf file is rewritten.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    PlanetFox:

    Please post the output of:

    ls -la /home/times/web67/web/index.php
     
  18. planet_fox

    planet_fox Member HowtoForge Supporter

    Yes I have understand, suphp is enabled in isp config.inc.php


    ls -la /home/times/web67/web/index.php say me that

    -rw-rw-r-- 1 web67_ftp web67 4745 Nov 9 19:03 /home/times/web67/web/index.php
     
  19. edony44

    edony44 New Member

    Ok i've solve my problem !!
    i have to change group write permission in suphp or change mask !
    Thanks
     
  20. falko

    falko Super Moderator Howtoforge Staff

    As I said before, you can run
    Code:
    ./configure --help
    to find out about all configuration options, also if it's --with-apache-user or --with-apache2-user.
     
Thread Status:
Not open for further replies.

Share This Page