• Hi,

    Needed clarification on the following:

    In order to install, run and update WordPress, themes and plugins should ownership be assigned to john:john or john:www-data or www-data:www-data while considering security issues?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    They should be assigned to whatever user the PHP process is using. If you’re using defaults, that’s probably apache:apache or www-data:www-data. It would be best to configure php-fpm to use a separate pool for each website you host and assign a different system user to each.

    Thread Starter eddyferns

    (@eddyferns)

    If to use php-fpm will it have any issue with the .htaccess file or special configuration that needs to be done?

    And, when creating a separate pool for php-fpm, should the data group ‘www-data’ remain the same?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Apache reads .htacess, so php-fpm is not an issue there. I use abc:abc for my sites, allowing no access to the default wwww user.

    Thread Starter eddyferns

    (@eddyferns)

    Should abc:abc be sudo user and group with root privileges?

    Have found an interesting articles from the same source about php-fpm. Please confirm if possible whether the tutorials is reliable for implementing separate php-fpm pools on the same server?

    https://www.cloudbooklet.com/how-to-install-php-fpm-with-apache-on-ubuntu-18-04-google-cloud

    https://www.cloudbooklet.com/how-to-setup-sftp-chroot-jail-on-linux-google-cloud

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    This is not really a WordPress question. I suggest you take it to an Ubuntu support forum or mailing list.

    Dion

    (@diondesigns)

    This isn’t the appropriate place to discuss the setup of FPM pools, but your other question is important.

    You should NEVER allow PHP or Apache to run as a user with sudo/root access! That opens the door to an attacker being able to take over your entire server. They should run as a non-privileged user, and preferably as different users. PHP-FPM (or any other FastCGI solution) allows Apache and PHP to run as different users.

    You didn’t ask, but the filesystem should be owned by the user that runs PHP. Apache should never be given write access to the filesystem unless special precautions are taken.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Installing WordPress on LAMP stack’ is closed to new replies.