Fli
05-26-2013, 09:32 PM
Please follow this manual only if you are sure what you are doing and sure you want to do it.
Hi, you got this 403 error in one directory, or in even subdomains?
I got this too and here is what may be the cause.
Permissions error usually have to do with file permissions.
First, you may rename .htaccess file of your main domain directory from .htaccess to _.htaccess_ and try if site loads. If it loads, it may mean some issue in this .htaccess file. This file is important so it may cause issues if you leave it just renamed. Find the issue in it.
If .htaccess dont solved 403 error, you may have wrong permissions to your www folders structure. For example in my case, i went into Kloxo hosting control panel and in Kloxo: Domains, mydomain, Error Log icon, i found these entries:
[Sun May 26 22:36:20 2013] [error] [client 46.118.***.***] (13)Permission denied: access to / denied (filesystem path '/home/admin/myusername') because search permissions are missing on a component of the path, referer: http://mysitename.com/
So as you can see, when i accessed my site, Apache loged this error message for me and it says that there it denied me to access this folder, therefore i need to check what are the permissions of this folder and change it properly.
Do you have access to your FTP or SSH (command line)?
Access your website files. In my case, they was in /home/admin/public_html , usually they are in /home/username/public_html
So access SSH or FTP or WebFile manager and go to this directory.
Then check permissions you have to the directories. If only one directory returns 403 Error, check only one folder permissions. If it is whole domain and its subdomains, it means you need to check /home/yourusername and /home/yourusername/public_html permissions. How to do it?
FTP easilly go thru directory structure.
SSH (command line):
cd /home
ls -lh
if you see: drwx------ or similar next to the /home/yourusername or /home/yourusername/public_html, it may mean that world (all website visitors) may not have read, execute permissions to these folders and its files. Then try to change permissions of the folder by command: chmod
Example: chmod +x admin (will add execute permission, in my case this helped and within a minute i was able to access my site)
Example2: chmod 755 admin
Example3: chmod 755 public_html
Here is nice calculator of permissions and CHMOD manual: http://ss64.com/bash/chmod.html
This neat command will show numeric permissions of all files/folders in current directory:
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \ *2^(8-i));if(k)printf("%0o ",k);print}'
Hi, you got this 403 error in one directory, or in even subdomains?
I got this too and here is what may be the cause.
Permissions error usually have to do with file permissions.
First, you may rename .htaccess file of your main domain directory from .htaccess to _.htaccess_ and try if site loads. If it loads, it may mean some issue in this .htaccess file. This file is important so it may cause issues if you leave it just renamed. Find the issue in it.
If .htaccess dont solved 403 error, you may have wrong permissions to your www folders structure. For example in my case, i went into Kloxo hosting control panel and in Kloxo: Domains, mydomain, Error Log icon, i found these entries:
[Sun May 26 22:36:20 2013] [error] [client 46.118.***.***] (13)Permission denied: access to / denied (filesystem path '/home/admin/myusername') because search permissions are missing on a component of the path, referer: http://mysitename.com/
So as you can see, when i accessed my site, Apache loged this error message for me and it says that there it denied me to access this folder, therefore i need to check what are the permissions of this folder and change it properly.
Do you have access to your FTP or SSH (command line)?
Access your website files. In my case, they was in /home/admin/public_html , usually they are in /home/username/public_html
So access SSH or FTP or WebFile manager and go to this directory.
Then check permissions you have to the directories. If only one directory returns 403 Error, check only one folder permissions. If it is whole domain and its subdomains, it means you need to check /home/yourusername and /home/yourusername/public_html permissions. How to do it?
FTP easilly go thru directory structure.
SSH (command line):
cd /home
ls -lh
if you see: drwx------ or similar next to the /home/yourusername or /home/yourusername/public_html, it may mean that world (all website visitors) may not have read, execute permissions to these folders and its files. Then try to change permissions of the folder by command: chmod
Example: chmod +x admin (will add execute permission, in my case this helped and within a minute i was able to access my site)
Example2: chmod 755 admin
Example3: chmod 755 public_html
Here is nice calculator of permissions and CHMOD manual: http://ss64.com/bash/chmod.html
This neat command will show numeric permissions of all files/folders in current directory:
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \ *2^(8-i));if(k)printf("%0o ",k);print}'