Migration between Redhat and Debian (if Apache users are different)

Refers to:

  • Plesk 12.5 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Created:

2016-11-16 12:39:39 UTC

Modified:

2016-12-21 18:54:40 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Migration between Redhat and Debian (if Apache users are different)

Symptoms

Source server runs Debian or Ubuntu, the destination runs RedHat, CentOS or CloudLinux, or conversely.Permission problems on websites after Plesk migration/transfer are appeared.

Cause

If Apache user name from the source server does not exist on the destination server, the data created by Apache modules such as PHP or Python have numeric ownership instead of Apache user.This is because rsync cannot assign correct ownership.

Resolution

Apache user name from source server should be created on destination server with ID of destination Apache user.



Destination : Ubuntu or Debian
Source : RedHat, CentOS or CloudLinux

  1. Get " www-data " GID:

    # id -g www-data
    33
  2. Create " apache " group with this GID:

    # groupadd apache -og 33
  3. Get " www-data " UID:

    # id -u www-data
    33
  4. Create " apache " user with this UID:

    # useradd apache -u 33 -c www-data -og www-data -G www-data,psaserv,psasb -d /var/www -s /sbin/nologin
  5. Check the result:

    # id apache
    uid=33(www-data) gid=33(www-data) groups=33(www-data),1003(psaserv),2523(psasb)



Destination : RedHat, CentOS or CloudLinux
Source : Ubuntu or Debian

  1. Get " apache " GID:

    # id -g apache
    48
  2. Create " www-data " group with this GID:

    # groupadd www-data -og 48
  3. Get " apache " UID:

    # id -u apache
    48
  4. Create " www-data " user with this UID:

    # useradd www-data -u 48 -c apache -og apache -G apache,psaserv,psasb -d /var/www -s /sbin/nologin
  5. Check the result:

    # id www-data
    uid=48(apache) gid=48(apache) groups=48(apache),504(psaserv),506(psasb)

The same method can be applied to SuSE, but default apache user:group is wwwrun:www. Also User name and user ID can be different from default values, so this migration issue can occur even if OS is the same on both servers.

Have more questions? Submit a request
Please sign in to leave a comment.