WeBWorK Problems

Course Admin. error after db acct password change

Course Admin. error after db acct password change

by Frank Cavadi -
Number of replies: 7
Having had to change my webwork database's password in MySQL after installing WeBWorK 2.12, I get this error after clicking Course Administration:
(account has been edited/changed in error message below)

error instantiating DB driver WeBWorK::DB::Driver::SQL for table set_user: DBI connect('webwork:localhost','WWDB_ACCT',...) failed: Access denied for user 'WWDB_ACCT'@'localhost' (using password: YES) at /opt/webwork/webwork2/lib/WeBWorK/DB/Driver/SQL.pm line 65. at /opt/webwork/webwork2/lib/WeBWorK.pm line 315.

Do I need to change it elsewhere?

In reply to Frank Cavadi

Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Frank Cavadi -
I found what I needed to do in site.conf file. However, logging in as the
administrator (1st time as this is a new install), I get the following error:

I wonder if I need to change User & Group in the httpd.conf file
to that of the webwork admininstrator account I defined at install?

Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

Archived Courses

WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

Warning messages

  • failed to open /opt/webwork/courses/admin/logs/login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 783.
  • failed to open /opt/webwork/courses/admin/logs/login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 783.

Request information

Time Mon Apr 24 22:06:22 2017
Method POST
URI /webwork2/admin/




In reply to Frank Cavadi

Re: Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Michael Gage -
The server didn't have permissions to write to the logfile login.log.
When you created the course you probably used sudo or your own login
so the admin course files are owned by you or by root and not by the server.

The easiest thing to do this is to change the directory courses/admin and
its subdirectories
to be owned by the server (wwhttpd in my case) .

sudo chown -R wwhttpd admin

Incidentally this "error" is just a warning. Nothing was recorded in that log file but everything else worked.
In reply to Michael Gage

Re: Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Frank Cavadi -
But, under /opt the webwork directory and most directories below it are owned by the webwork admin account and/or group I defined when prompted by the installer shell script. That account does not yet have sudo rights, yet, as far as I recall.

I don't see a wwhttpd (user) or admin (group) under RHEL7.3

Should it then be?
sudo chown -R apache:apache /opt/webwork


In reply to Frank Cavadi

Re: Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Frank Cavadi -
Since I am running Apache2.4 on RHEL7.3, I tried:
chown -R apache:apache /opt/webwork

I still received the "Permission denied" error after logging
into my adminstrator account on our WeBWorK site.

Could it be SELinux permissions thing? SELinux is running.

In reply to Frank Cavadi

Re: Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Michael Gage -
maybe -- but it's just as likely that you didn't set the password for the user "admin" to what you expected.

You can reset passwords from the command line using webwork2/bin/wwsh:
http://webwork.maa.org/wiki/WeBWorK_shell_-_wwsh and the script webwork2/bin/addadmin.


SELinux can cause many troubles if the permissions are not set exactly right. I don't have much experience with that -- I just turn it off. There are mixed opinions as to whether or not it is useful.


In reply to Frank Cavadi

Re: Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Frank Cavadi -
I did not have to chown -R the /opt/webwork/... path.
Instead I had to do an SElinux command on it.

All is well as in no more permission denied errors on the /opt/webwork
path.

In reply to Frank Cavadi

Re: Warning -- there may be something wrong with this question. Please inform your instructor including the warning messages below.

by Michael Gage -
you want to change the directory webwork/courses/admin to be owned by the server. (The "user" that runs apache on my system is called wwhttpd -- it may be called apache on yours. )

You want the ownership of (most) of the webwork/webwork2 subdirectories to be something that administrators can change but which cannot be changed directly from the server (that would be a security risk). There are several exceptions. The server should be able to write to some of the webwork2 subdirectories (e.g. webwork2/log, webwork2/DATA, webwork2/html/tmp and perhaps a couple of others listed in the installation instructions.

You want the webwork2/courses directory (and it's subdirectories) to be writable by the server -- so that it can create courses. The easiest way to do this is to make webwork2/courses owned by the server.

The installation instructions (at least for 2.12) did not mention that the permissions for the admin course should be changed so that it is owned by the server. After the admin course is set up all of the other courses are created from the web via the server --- and are therefore automatically owned by the server. Alternatively after you set up the admin course, then you could use
chown -R serverName courses to change all of the directories under
webwork2/courses to be owned by the server.

Hope this helps.