Applies To:
[ Zend Server on Linux ]
Overview
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.
Instructions
Linux admin activities for the Apache side
Before running this procedure make sure that you:
- Record old user and group information before changing anything.
- Modify the Apache user and group.
- 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)
- Get the UID and GID by running the following command:
- Stop all Apache and Zend Server processes by running the command:
- Make sure no processes are running using the following command:
- Modify /usr/local/zend/etc/conf.d/ZendGlobalDirectives.ini to match new UID/GID:
- Modify /etc/zce.rc to match new Apache username:
- Change ownership on all files formerly owned by the old Apache user to the new Apache user.
- Add the user 'zend' to the new Apache group:
- Start Zend Server and Apache:
Result
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 zendctl.sh status.
3. Check the Admin GUI thoroughly.