How to Change the Apache Username with Zend Server Already Installed on Your Machine


Applies To:

[ Zend Server 5 ]
[ Linux ]


Follow the below procedure to change the Apache user when Zend Server has already been installed.

If you have not yet installed Zend Server, configure the Apache (from distro) settings to  your specifications before installing Zend Server.


Linux admin activities for the Apache side

Before running this procedure make sure that you:

  1. Record old user and group information before changing anything.
  2. Modify the Apache user and group.
  3. Make sure the document root and all web resources are owned by the new Apache user/group.
If there are still resources owned by the old Apache user you might get permission errors in Apache and PHP logs, and have a problem running your web applications.

Zend Server modifications

For this article we will be using as example values:

  • New Apache user: momo (1001)
  • New Apache group: momo (1002)
  1. Get the UID and GID by running the following command:
    # id <old Apache username>
    # id <new Apache username>
  2. Stop all Apache and Zend Server processes by running the command:
    # /usr/local/zend/bin/apachectl stop
    # /usr/local/zend/bin/ stop
  3. Make sure no processes are running using the following command:
    # /usr/local/zend/bin/ status
    # ps aux | grep -e zend -e apache -e httpd
  4. Modify /usr/local/zend/etc/conf.d/ZendGlobalDirectives.ini to match new UID/GID:
    ; UID of httpd process
    ; GID of httpd process
  5. Modify /etc/zce.rc to match new Apache username:
  6. Change ownership on all files formerly owned by the old Apache user to the new Apache user.
    # find /usr/local/zend -user apache -exec chown momo {} \;
    # find /usr/local/zend -group apache -exec chgrp momo {} \;
  7. Add the user 'zend' to the new Apache group:
    # usermod -A momo zend
  8. Start Zend Server and Apache:
    # /usr/local/zend/bin/ start


After performing the procedure, everything runs with the new Apache user.

Please verify the changes by checking:

1. That all services are up and running.

2. Execute status.

3. Check the Admin GUI thoroughly.


Excerpt: How to make Zend Server work with a new Apache user.

Original Post Date: 2012-08-07 11:49:50

Alternative Description:

How to make Zend Server work with a new Apache user

Tags: apache,Debian / Ubuntu,RedHat Enterprise Linux / CentOS,server,SUSE Linux Enterprise Server / OpenSUSE,tweak,user,Zend Server 5.x,oldKB