hello
when i enter my website it gives
"Forbidden You don't have permission to access / on this server............"

I checked my /home directory i can only see file name "user" insted of folder with 0000 permission .type "text/x-generic"

I cant even create folder "user" in home. Anyone have idea how can i solve this problem.

how this happen i as i know is
I got Spamd Failed msg from server and tried to solve this problem with the help of http://niyaas.blogspot.com/2008/03/spamd-failed.html

used these comands

rm -rf /home/.cpan
rm -rf /root/.cpan
rm -rf /root/.cpcpan
/scripts/updatenow
/scripts/perlinstaller
/scripts/exim4

/scripts/eximup --force
/etc/init.d/exim restart
/scripts/restartsrv_spamd

after that day i am having problem . I need a good fix for this if anyone can help me

Dani AI

Generated

Based on ’s symptoms (a regular file named user in /home with mode 0000 and inability to create a directory) the immediate problem is almost certainly a broken home-path that prevents Apache from reaching any DocumentRoot under it. Apache must be able to “search” (the execute bit) every directory in the path; if a component is missing, is a plain file, or has no execute/search bit, requests will return 403. was heading in the right direction about traversal bits, but a safer, more surgical repair is preferable to blindly changing everything. (stackoverflow.com)

Quick diagnostics to run as root (do not run recursive fixes until these confirm the situation):

ls -ld /home /home/username
stat -c "%n: %F %a %U %G" /home/username
file /home/username

If the output shows /home/username is a regular file or has mode 0000, move it aside and recreate the directory tree before restoring ownership and perms. cPanel servers typically expect /home and /home/$user to be 0711 (owner root for /home, owner $user for /home/$user). (support.cpanel.net)

Example safe repair sequence (replace username):

mv /home/username /root/home-username.backup
mkdir -p /home/username/public_html
chown username:username /home/username
chmod 0711 /home/username
chown -R username:username /home/username/public_html
chmod 0750 /home/username/public_html
find /home/username/public_html -type f -exec chmod 0644 {} \;
find /home/username/public_html -type d -exec chmod 0755 {} \;

On cPanel systems the public_html group/permission can vary (FileProtect / mod_ruid2 / mod_suexec affect defaults), so use the cPanel guidance when restoring ownership and perms. (support.cpanel.net)

Also verify Apache’s directory access rules and SELinux labels. For Apache 2.4 the directory block must allow access (e.g. Require all granted), and if SELinux is enabled web content must be labeled httpd_sys_content_t (use semanage fcontext + restorecon or chcon to correct). Check the Apache error log for “search permissions are missing” or filesystem permission denied messages. (httpd.apache.org)

Cautions: always back up/move suspicious files before deleting, avoid broad recursive chmod/chown on /home without limiting the target, and check cPanel’s FileProtect/WHM settings if EasyApache runs changed ownerships. If the home was accidentally replaced by a file, restoring a proper directory and ownership almost always clears the 403. (support.cpanel.net)

Recommended Answers

All 2 Replies

Try doing a chmod -R 744 <dir> on the directory. You will need to clean up the perms after you run that command. A directory in *nix needs the +x in order for you to "cd" in to it.

sk@sk:/tmp/x$ ls -al
total 9
drwxr--r-- 2 sk   wheel 1024 Aug 18 03:48 .
drwxrwxrwt 7 root root  8192 Aug 18 03:48 ..
-rwxr--r-- 1 sk   wheel    0 Aug 18 03:48 1
-rwxr--r-- 1 sk   wheel    0 Aug 18 03:48 2
-rwxr--r-- 1 sk   wheel    0 Aug 18 03:48 3
sk@sk:/tmp/x$ chmod 0 *
sk@sk:/tmp/x$ cd ..
sk@sk:/tmp$ chmod 0 x
sk@sk:/tmp$ touch x/abc123
touch: cannot touch `x/abc123': Permission denied
sk@sk:/tmp$ cd x
-bash: cd: x: Permission denied
sk@sk:/tmp$ chmod -R 744 x
sk@sk:/tmp$ touch x/abc123
sk@sk:/tmp$ ls -al x/
total 9
drwxr--r-- 2 sk   wheel 1024 Aug 18 03:50 .
drwxrwxrwt 7 root root  8192 Aug 18 03:48 ..
-rwxr--r-- 1 sk   wheel    0 Aug 18 03:48 1
-rwxr--r-- 1 sk   wheel    0 Aug 18 03:48 2
-rwxr--r-- 1 sk   wheel    0 Aug 18 03:48 3
-rw-r--r-- 1 sk   wheel    0 Aug 18 03:50 abc123

Hi,

The default DocumentRoot path only works fine. If i change the DocumentRoot directory from “/var/www/html” to my own path “/home/test/workspace/”. Then its not working. SELinux is disabled. My folder has the enough permission. I tried in many ways. But no use. Please some one help me in this.

The Error i am getting is, "403 Forbidden You don't have permission to access /index.html on this server.".

I am using the default apache that came with the RHEL 5.3 OS.

Thanks in advance,
Ganga.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.