file owner is apache

Discussion in 'ISPConfig 3 Priority Support' started by medo, Nov 28, 2017.

  1. medo

    medo Member

    Hi there,
    I have a problem with an ispconfig under centos 6, using apache 22 and php56 with php-fpm.
    Files created with php are created with user/group of the client, webxx/clientx, no problem, but some files are created with apache:apache and are not usable/deletable by the web user, so this is a problem.
    What is wrong with my installation ?
    Thanks.
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    First I'd have to know which files are owned by apache. Are these temporary files or really files just like the others that are created as web user?
     
  3. medo

    medo Member

    well, seems that I was wrong, all files generated by php scripts are Apache owned. Only files uploaded via ftp are using webx:clientx owner:group.

    php-fpm pool is using webx:clientx , so I don't understand why files are created this way.
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Are you sure that the web is not set to modphp? Please check the vhost file of the web for the php section.
     
  5. medo

    medo Member

    Hi,
    Here is vhost file :

    <IfModule mod_fastcgi.c>
    <Directory /var/www/clients/client1/web51/cgi-bin>
    Order allow,deny
    Allow from all
    </Directory>
    <Directory /var/www/recette.lyria.shifteo.com/web>
    <FilesMatch "\.php[345]?$">
    SetHandler php5-fcgi
    </FilesMatch>
    </Directory>
    <Directory /var/www/clients/client1/web51/web>
    <FilesMatch "\.php[345]?$">
    SetHandler php5-fcgi
    </FilesMatch>
    </Directory>
    Action php5-fcgi /php5-fcgi virtual
    Alias /php5-fcgi /var/www/clients/client1/web51/cgi-bin/php5-fcgi-*-443-XXX FastCgiExternalServer /var/www/clients/client1/web51/cgi-bin/php5-fcgi-*-443-XXX -idle-timeout 300 -host 127.0.0.1:9060 -pass-header Authorization -pass-header Content-Type
    </IfModule>
    php fpm process is running :
    UID PID PPID C STIME TTY TIME CMD
    web51 30194 30193 0 Nov28 ? 00:00:00 php-fpm: pool web51
    web51 30195 30193 0 Nov28 ? 00:00:00 php-fpm: pool web51

    here is sample from php-fpm web51.conf :

    [web51]

    listen = 127.0.0.1:9060
    listen.allowed_clients = 127.0.0.1

    user = web51
    group = client1

    pm = static
    pm.max_children = 2
    pm.max_requests = 0

    chdir = /

    env[HOSTNAME] = $HOSTNAME
    env[TMP] = /var/www/clients/client1/web51/tmp
    env[TMPDIR] = /var/www/clients/client1/web51/tmp
    env[TEMP] = /var/www/clients/client1/web51/tmp
    env[PATH] = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

    php_admin_value[open_basedir] = /var/www/clients/client1/web51/web:/var/www/clients/client1/web51/private:/var/www/clients/client1/web51/tmp:/var/www/XXX/web:/srv/www/XXX/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
    php_admin_value[session.save_path] = /var/www/clients/client1/web51/tmp
    php_admin_value[upload_tmp_dir] = /var/www/clients/client1/web51/tmp
    php_admin_value[sendmail_path] = "/usr/sbin/sendmail -t -i -f webmaster@XXX"

    thanks for your help.
     
  6. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Just to make sure: Have you tried restarting apache whether it uses this vhost file? You might check "apachectl -S" to see if the domain you call really uses this vhost file and no other one.
     
  7. medo

    medo Member

    Apparently, apache does no detect mod_fastcgi.c , so ignores this section of the vhost file due to "<IfModule mod_fastcgi.c>" directive. Please guide me to a centos 6/apache/php-fpm perfect server setup ?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

  9. medo

    medo Member

    No, Apache won't start. Fastcgiexternalserver is not recognized.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then probably mod_fastcgi is not installed on your server. Install it with:

    yum install mod_fastcgi
     
  11. medo

    medo Member

  12. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Post
    apachectl -M
     
  13. medo

    medo Member

    [Mon Dec 04 15:19:06 2017] [warn] NameVirtualHost *:443 has no VirtualHosts
    [Mon Dec 04 15:19:06 2017] [warn] NameVirtualHost *:80 has no VirtualHosts
    Loaded Modules:
    core_module (static)
    mpm_prefork_module (static)
    http_module (static)
    so_module (static)
    auth_basic_module (shared)
    authn_file_module (shared)
    authn_alias_module (shared)
    authn_anon_module (shared)
    authn_dbm_module (shared)
    authn_default_module (shared)
    authz_host_module (shared)
    authz_user_module (shared)
    authz_owner_module (shared)
    authz_groupfile_module (shared)
    authz_dbm_module (shared)
    authz_default_module (shared)
    ldap_module (shared)
    authnz_ldap_module (shared)
    include_module (shared)
    log_config_module (shared)
    logio_module (shared)
    env_module (shared)
    ext_filter_module (shared)
    mime_magic_module (shared)
    expires_module (shared)
    deflate_module (shared)
    headers_module (shared)
    usertrack_module (shared)
    setenvif_module (shared)
    mime_module (shared)
    status_module (shared)
    autoindex_module (shared)
    info_module (shared)
    vhost_alias_module (shared)
    negotiation_module (shared)
    dir_module (shared)
    actions_module (shared)
    speling_module (shared)
    userdir_module (shared)
    alias_module (shared)
    substitute_module (shared)
    rewrite_module (shared)
    proxy_module (shared)
    proxy_balancer_module (shared)
    proxy_ftp_module (shared)
    proxy_http_module (shared)
    proxy_ajp_module (shared)
    proxy_connect_module (shared)
    cache_module (shared)
    suexec_module (shared)
    disk_cache_module (shared)
    cgi_module (shared)
    version_module (shared)
    fcgid_module (shared)
    proxy_fcgi_module (shared)
    python_module (shared)
    ssl_module (shared)
    suphp_module (shared)
    Syntax OK
     
  14. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Are you using custom config files and have recently updated your apache, so the naming of the modules might have changed?
     
  15. medo

    medo Member

    No, no custom files and apache is from official centos repo.
     
  16. medo

    medo Member

    I am really stuck with this, I have installed suphp to be able to have file owner to clientX, and it works. But when I switch back to php-fpm, PHP source code is displayed, any other idea ?
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    have you tried php-fcgi instead of php-fpm? And the suexec checkbox must be enabled in the website.
     

Share This Page