WeBWorK Main Forum

Forbidden You don't have permission to access this resource.

Forbidden You don't have permission to access this resource.

by Eric Stroyan -
Number of replies: 20

Whenever I try to create or modify a problem set I am getting the 403 error

Forbidden

You don't have permission to access this resource.


I don't know if this is the result of changing mysqldump to use the  --no-tablespaces option or not.

Any help would be appreciated


In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -
I tried
[sudo] password for wwadmin: cd /opt/webwork/webwork2/

chmod -R g+w DATA ../courses htdocs/tmp htdocs/applets logs tmp /opt/webwork/pg/lib/chromatic
find DATA/ ../courses/ htdocs/tmp logs/ tmp/ -type d -a -exec chmod g+s {} \;
exit

With no change.
In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Michael Gage -

mysqldump shouldn't modify the database itself.

it does look like  a permissions problem.

who owns the files in the courses directory?  I usually make this the webrowser to avoid permission hassles

you should be able to reach the top level of your site without problems (where it lists the problems)

since that doesn't use the database .

You are saying that you only have a problem once you try to edit?



In reply to Michael Gage

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

I am able to create problem sets and add problems, just not edit problems that I had input. That's when the error show up. I am able to remove problems from a set.

In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -
In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

Here is ls -al of the courses

Attachment IMG_4170.jpg
In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -
I tried adding problem sets and problems, removing problems from a number of differently owned courses. All the same result. Could add a set, add problems, delete problems, but not edit a problem. I did not try with any of the library problems, though.
In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Michael Gage -

I suggest


sudo chown -R wwdata courses

This will make all of the files in courses owned by wwdata which is the webserver. (The -R stands for recursive.)

Your chmod fix only changed the permissions on the toplevel  of courses and wwdata needs access to files within courses.


In reply to Michael Gage

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

Thanks. I'll try that. I should know better.


In reply to Michael Gage

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

sudo chown -R wwdata courses gave 'invalid user'

I changed that to sudo chown -R www-data, which ran, restarted apache2 and I still am not able to edit problems

getting

Forbidden message

In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Danny Glin -
A few thoughts:
  • Can you save a new problem in one of these courses?  e.g. if you edit  a Library problem and "save a new version", does that work?
  • Check the permissions on the individual problems.  Though I doubt it, it's possible that the user doesn't have RW permission.
  • Is this running on a Red Hat flavour of linux?  If so, then SElinux could be the culprit.  It has the ability to override file permissions to block files.
In reply to Danny Glin

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

The system is ww2.12/pg2.12 running on Ubuntu 16.04

permissions on individual problems -rw-rw-r-- owner www-data group wwdata

I tried copying a problem, still get error.

I tried writing a problem on another machine and downloading it, error. There is another instructor reporting

"Yes, it's the 403 Forbidden error. It happened in two different spots.


1) When hitting the "next page" button when viewing through problems in the Library Browser
2) When looking at the class editor page, I clicked the button to sort the roster by section"

I'm sorry , but I'm not sure what I should be looking for with browser developer tools and unclear what I should look for in the apache logs.

In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Nathan Wallach -
Maybe check in the browser developer tools exactly what URL is triggering the 403 error, and try to check in the Apache logs if something relevant shows up. It could be that some JavaScript file or something else is the culprit.
In reply to Nathan Wallach

Re: Forbidden You don't have permission to access this resource.

by Michael Gage -
in chrome the browser tools are under View->Developer->Developer tools
on firefox they are under Tools ->Tools->Web developer->toogle tools

one of the tabs will show you some error messages such as 403 errors -- unable to connect
see what the url is for the connection that fails -- is it the same exactly as the url of your server?

You may need to adjust the value of $server_root_url in webwork2/conf/site.conf
In reply to Michael Gage

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

The url was the same as the server (physics.ahsd.org). I did check site.conf. I originally had localhost for $server_root_url. I changed that to physics.ahsd.org. No change still getting 403 error.

In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Michael Gage -

Having it as localhost was probably causing troubles.  Did you restart the server?   That value $server_root_urlgets passed onto the apache server app only when it starts up.

In reply to Michael Gage

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

I just stopped and restarted apache2. I'll restart the server.

In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Michael Gage -
shutting down and restarting apache should be enough. I've never had to restart the computer. Look closely at the error messages in the browser's development tools console tab and try to determine which url the browser is trying to reach when things fail.
In reply to Michael Gage

Re: Forbidden You don't have permission to access this resource.

by Eric Stroyan -

I've attached output from firefox

Attachment Screenshot 2020-09-21 151533_WW_403_error.png
In reply to Eric Stroyan

Re: Forbidden You don't have permission to access this resource.

by Michael Gage -

I’m not sure exactly where the problem is, but I think one of the errors at least arises because you are using http://  instead of https:// for the website.  


The other possibility is that there is a permissions problem somewhere the files/directories   instructor,  pgProblemEditor2   AP_Physics/Tutorial/2/ chain.
When I try to put that address into the browser I get to the login page and I’m blocked, but you should be able to put in a username and password 
and get to that problem and edit it.  See what happens. 

The url $server_root_url in site.conf is probably correct in using http:  (and that seems to be what your site in general is using) but something
is asking for a secure connection back to the server (i.e. https) and doesn’t handle gracefully the fact that your site uses http.  Almost all 
sites now use https for the added security.  The simplest fix would be to add an https (port 443) input to your site.  It’s even possible to 
configure it so that requests addressed to http:… are automatically redirected to https:.  That might fix it and in any case it’s a good thing to catch
up with current practice and use https.