While trying to browse a website, the error
'403 Forbidden' appears:
You don't have permission to access / on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
The domain's error log contains the following:
(13)Permission denied: /var/www/vhosts/example.com/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://example.com/
Apache does not have a permission to read the vhost folder.
Find the username that is used by the
'apache2'service. This username is defined in the APACHE_RUN_USER variable in
Add that user to the
'psaserv'group. For example, if the Apache user is
www-data, you would add the user in the psaserv group as below:
# usermod -a -G psaserv www-data
- Restart web server
apacheuser to the
# usermod -a -G psaserv apache
Restart web server
service httpd restart
If the above steps do not help, change folder permissions to 775:
# chmod 775 folder_name
Finally, check that the domain has the correct ownership. It should look like:
# ls -ld /var/www/vhosts/example.com drwx--x--- 5 ftp_user psaserv 4096 Aug 30 08:33 /var/www/vhosts/example.com
Note: If your server is running on Proxmox VE, this configuration will not work as expected. Please contact Proxmox support for further assistance.
If the modules like 'mod_suphp' or 'mod_ruid2' are enabled, the same issue may occur.
In case of several domains are affected by the issue, fix ownership for their
# chown .psaserv /var/www/vhosts/*/httpdocs