• hi
    im using dulicator to deploy some wordpress page
    i prepair a virtual machine with centos 7 for hosting this site
    and i prepair everything like lamp and configuring apache and phpmyadmin
    but when i use https://ip address/installer.php dulicator says one requirement is nit ok and fails
    root directory is failed .
    in the details it says :
    path :/var/www/html
    [fail] is writable by php

    i give the root dir every permission that needs
    and i run this command
    chown apache:apache -R /var/www/html
    chmod 777 -R /var/www/html

    i khow that 777 is not good but even by this permission it doesnt work

    sorry about my bad english

Viewing 4 replies - 1 through 4 (of 4 total)
  • Dion

    (@diondesigns)

    The default user/group for Apache is www-data. Unless you changed those values in httpd.conf, you should use the following line to change ownership:

    chown -R www-data: /var/www/html

    Note that the above is correct; the group is optional if it is the same as the specified user.

    There are much better solutions, such as using Apache’s mpm_event with PHP-FPM. That will allow you to run PHP as a non-privileged user that has (S)FTP access, and PHP will run faster and with less memory usage.

    Thread Starter mhtojv

    (@mhtojv)

    Thank you for your reply
    I have checked the list of users and also httpd.conf and there is no such user i mean www-data in users of os and in httpd.conf user was apache.
    I have didnt make change in httpd.conf

    I have run your stated command “chown -R www-data: /var/www/html ” but it gives error “invalid user : www-data

    Dion

    (@diondesigns)

    If that is the case, then I suggest asking your question on stackexchange or serverfault since it doesn’t have anything to do with WordPress. Or hire someone to set up your server correctly.

    I’ll add that it is unusual to have Apache run as the apache user. That is how Apache worked in the old (2.0.x and 2.2.x) days. Modern versions of Apache run by default as the www-data user.

    Hi @mhtojv ,

    The issue you are facing is due to SELinux.

    By default the context set on ‘/var/www/html’ is:

    # ls -ldZ /var/www/html
    drwxrwxrwx. apache apache system_u:object_r:httpd_sys_content_t:s0 /var/www/html/

    You need to change the context for rw:

    #chcon -Rv –type=httpd_sys_rw_content_t /var/www/html/

    If file/directory permissions are fine then it should work.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘path: /var/www/html/ is writableby php’ is closed to new replies.