What is the Apache Log File chmod Value?
The Apache log file chmod value setting in WHM controls the file permissions applied to log files in the /etc/apache2/domlogs/ directory. This directory contains Apache domain access logs for every cPanel account on the server. By default, these log files are set to 0640, which allows the file owner (root) and the Apache group to read the file, while all other users have no access.
Steps to Change the Apache Log File chmod Value
- Log in to WHM as the root user.
- Navigate to Home » Server Configuration » Tweak Settings.
- In the search box at the top, type
chmodto quickly locate the option. - Under the Stats and Logs tab, find Apache log file chmod value.
- Enter the desired chmod value in the text box. The default is
0640. - Click Save at the bottom of the page.
Understanding chmod Values
- 0640 (default): Owner can read/write, group can read, others have no access.
- 0644: Owner can read/write, group and others can read. Use this if you need scripts or tools running as non-root users to access domain logs.
- 0600: Owner can read/write only. Most restrictive — no group or other access.
- Always use a 4-digit octal value (e.g.,
0644not644).
Important Notes
- This setting affects all domain log files in
/etc/apache2/domlogs/, including existing files. - Changing permissions to something more open (like
0644) may allow cPanel users to read other domains' log files, which could be a privacy concern on shared servers. - For more information about file permissions, refer to the
man chmodcommand in your server's terminal.
Troubleshooting
- Can't find the option: Use the Tweak Settings search bar and type
chmod. The setting is under the Stats and Logs tab. - Permissions didn't change for existing files: You may need to manually update existing log files with the command
chmod -R 0644 /etc/apache2/domlogs/*from the root SSH terminal. - Scripts can't read logs: Ensure the chmod value grants read permission to the appropriate group (e.g.,
0644allows world-readable access).
For official documentation, see the cPanel Tweak Settings guide.