The Apache log file chmod value setting controls the file permissions applied to Apache log files (such as access logs and error logs) generated on the server. This setting determines which users and groups can read or modify these log files.

Important: This setting has been removed from WHM starting with cPanel version 110 and later. Modern versions of cPanel manage Apache log file permissions automatically through EasyApache 4 and the FileProtect system. If you are running an older version (108 or earlier), follow the steps below.

Step 1: Log in to WHM

Open your browser and navigate to https://your-server-ip:2087. Enter your root credentials to log in.

Step 2: Open Tweak Settings

Navigate to Home » Server Configuration » Tweak Settings. You can also type Tweak Settings in the WHM search bar.

Step 3: Locate the Setting

Click on the Logging tab. Look for the Apache log file chmod value setting. You can use the filter/search box at the top of the settings page to find it quickly.

Step 4: Set the Permission Value

Enter a valid Unix file permission value in octal format (e.g., 0640 or 0644):

  • 0640 (default) — The file owner (typically root) can read and write. The group can read. No one else has access. This is the most secure option.
  • 0644 — The file owner can read and write. Everyone else can read. Use this if other services or scripts need to access the logs.
  • 0600 — Only the file owner can read and write. Use this for maximum security.

Step 5: Save

Click Save at the bottom of the page to apply the change. New log files will be created with the updated permissions. Existing log files will keep their current permissions until they are rotated.

Important Notes

  • On cPanel version 110 and later, this setting is no longer available. Log permissions are managed automatically.
  • This setting uses octal notation. Always prefix the value with a 0 (e.g., 0640, not 640).
  • Changing this setting affects newly created log files. Existing logs will retain their current permissions until log rotation occurs.
  • The default value of 0640 is recommended for most servers as it balances security with accessibility.
  • Do not set permissions to 0777 or 0666 as this would allow any user on the server to modify log files, which is a security risk.

Troubleshooting

  • Cannot find the setting: If you are on cPanel version 110 or later, this setting has been removed. Log file permissions are handled automatically by the system.
  • Need to change log permissions on a current version: You can modify log permissions directly via SSH using chmod on the files in /usr/local/apache/logs/ and the per-domain logs in /var/log/apache2/ or /etc/apache2/logs/.
  • Logs not updating after change: Wait for the next log rotation cycle, or restart Apache with systemctl restart httpd (or apache2 depending on your system).

For more information, see the official cPanel documentation: Tweak Settings.

Was this answer helpful? 0 Users Found This Useful (0 Votes)