0

Trying to view a javascript file (via http) on my server I get the following error:

Forbidden

You don't have permission to access /jquery-1.8.2.js on this server.
Apache/2.2.22 (Fedora) Server at 192.168.1.3 Port 80

I have given all users access to the file like this:

sudo chmod -R 777 /var/www/html/jquery-1.8.2.js

I have even gone as far as changing the user & group properties in the httpd.conf file.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
kdavis8
  • 121
  • 1
  • 1
  • 6
  • How did you configure Apache? – Michael Hampton Oct 22 '12 at 21:47
  • my configuration has the default root directory of /var/www/html/ all i did was change the config from user apache group apache to user user group user note: user is a user on my server – kdavis8 Oct 22 '12 at 21:54
  • OK, now change it back. – Michael Hampton Oct 22 '12 at 21:55
  • OK, i just switched it back to user apache, group apache – kdavis8 Oct 22 '12 at 21:56
  • I solved my problem, somehow creating a new empty file, copying the contents from jquery-1.8.2.js into the new document. renaming the empty document with the same name as jquery file and deleting the jquery file worked. – kdavis8 Oct 22 '12 at 23:50
  • Does the uid under which httpd is running have read and execute permission for the containing directory? Is /var/www/html the correct path for your document root? Is it possible that your Apache configuration tells the server to look elsewhere? – Michael McNally Oct 22 '12 at 21:38
  • if by uid you mean user then yes, the user has 777 permissions my document root is /var/www/html im not sure if apache configuration tells the server to look elswhere, but the file is in the root directory – kdavis8 Oct 22 '12 at 21:50

1 Answers1

0

Have you checked the apache error log?

Unless changed, the general default on the apache configuration is to only allow access to the sub-directories htdocs (your document root) and cgi-bin. Access to all other directories is inhibited for security reasons. You'll have to add an additional permission block for this and any other directories you might need to access.

mdpc
  • 11,856
  • 28
  • 53
  • 67
  • i have not checked the logs but i am only trying to access a javascript file in the document root directory. so its giving me a 403 forbidden permission error, theres something going on with the apache daemons user permissions i think – kdavis8 Oct 22 '12 at 21:58