WeBWorK Main Forum

Course Creation Problem

Course Creation Problem

by Enrique Martinez Roldan -
Number of replies: 11
Hi, I've just installed webwork on Fedora 9, and almost everything is fine, but when I try to create my first course following the instructions, this message appears twice:

  • failed to open /opt/webwork/courses/admin/logs/login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 719
I was looking in the forums for this problem, I've checked the file permitions but I don't know what happen, some body knows how I can fix it??

Thanks
In reply to Enrique Martinez Roldan

Re: Course Creation Problem

by Michael Gage -
Make sure that the webserver has permission to write in the directory

/opt/webwork/courses/admin/logs

(You created the admin course from the command line and probably did it while logged in as yourself or as root. The webserver didn't have write permission on the directory logs and couldn't create the log file login.log)


You could change ownership of the entire admin course so that it is owned by the webserver (the same ownership as the other courses).


-- Mike

In reply to Michael Gage

Re: Course Creation Problem

by Enrique Martinez Roldan -
Hi thanks for your reply, I've checked the permissions on that directories, but now I get this warning:

An error occured while creating the course MyTest:

Can't create the course 'MyTest' becasue the root directory '/opt/webwork/courses/MyTest' could not be created: Permission denied. at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm line 724

The problem is similar to te other one, but I've folowed again the installing intructions and I have the same problem.

What shoul i do?

Enrique
In reply to Enrique Martinez Roldan

Re: Course Creation Problem

by Michael Gage -
Again the webserver needs write permission on the directory
/opt/webwork/courses

so it can create the new directory /opt/webwork/courses/MyTest

take a look at

http://webwork.maa.org/wiki/Installation_Manual_for_2.4_on_Fedora_9#Setting_Permissions

to review the permissions needed on each directory.

--Mike

In reply to Michael Gage

Re: Course Creation Problem

by Enrique Martinez Roldan -
I can't se the problem I've changed all these permissions following the manual, this is my directory now:

drwxrwsrwx 4 apache wwdata 4096 oct 12 12:28 courses
drwxr-xr-x 3 root root 4096 oct 6 02:08 libraries
drwxr-xr-x 3 root root 4096 oct 2 21:10 npl
drwxr-xr-x 6 root root 4096 oct 5 18:29 pg
-rw-r--r-- 1 root root 535162 jul 30 09:43 pg-2.4.5.tar.gz
drwxr-xr-x 13 root root 4096 oct 5 18:29 webwork2
-rw-r--r-- 1 root root 4807393 jul 30 09:44 webwork-2.4.5.tar.gz
-rw-r--r-- 1 root root 17818253 oct 5 18:47 webwork-files.tar.gz

the wwdata group have enrique and apache as members

this is my /opt/webwork/courses directory

drwxrwsr-x 7 root wwdata 4096 oct 12 13:03 admin
-rw-rw-r-- 1 root wwdata 238 oct 6 02:09 adminClasslist.lst
-rw-rw-r-- 1 root wwdata 613 oct 6 02:09 defaultClasslist.lst
drwxrwsr-x 4 root wwdata 4096 oct 6 02:09 modelCourse

this is my /opt/webwork/webwork2

drwxr-xr-x 3 root root 4096 oct 6 02:06 bin
drwxr-xr-x 3 root root 4096 oct 6 02:06 clients
drwxr-xr-x 5 root root 4096 oct 13 00:51 conf
drwxr-xr-x 4 root root 4096 oct 6 02:06 courses.dist
drwxr-xr-x 2 root root 4096 oct 6 02:06 CVS
drwxrwsr-x 4 root wwdata 4096 oct 6 02:06 DATA
drwxr-xr-x 6 root root 4096 oct 6 02:06 doc
drwxr-xr-x 11 root root 4096 oct 6 02:06 htdocs
drwxr-xr-x 8 root root 4096 oct 6 02:06 lib
-rw-r--r-- 1 root root 1529 ago 25 2007 LICENSE
drwxrwsr-x 3 root wwdata 4096 oct 6 02:06 logs
-rw-r--r-- 1 root root 523 jun 24 18:09 README
drwxrwsr-x 3 root wwdata 4096 oct 6 02:06 tmp

I can't see the error, everything was good before those error messages.

Help me :(

-Enrique
In reply to Enrique Martinez Roldan

Re: Course Creation Problem

by Michael Gage -
this is my /opt/webwork/courses directory

In the directory

/opt/webwork

type

ls -ld courses

to show the permissions for the courses directory.

I suspect that you'll find that the /opt/webwork/courses directory
doesn't have write permission for the group wwdata.

chmod 775 courses

should fix the permissions so that the webserver can create subdirectories
in /opt/webwork/courses

Hope this helps.

-- Mike

In reply to Michael Gage

Re: Course Creation Problem

by Andras Balogh -
This is strange.
I get these messages only after upgrading to apache2 from apache1.
  • failed to open /opt/webwork/courses/math1340_balogh/logs/login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 688.
  • failed to open /opt/webwork/courses/math1340_balogh/logs/login.log for writing: Permission denied at /opt/webwork/webwork2/lib/WeBWorK/Utils.pm line 688.
No problem when I go back to apache 1. (fedora6)

I did reset and checked the permissions several times:

-rw-rw-r-- 1 apache wwdata 1131278 Oct 21 01:12 login.log
drwxrwsr-x 2 apache wwdata 4096 Jan 15 2007 logs
drwxrwsr-x 7 apache wwdata 4096 Jan 15 2007 math1450_balogh
drwxrwsr-x 76 root wwdata 4096 Oct 20 10:03 courses


It does not help setting in httpd.conf
User apache
Group wwdata



Andras

In reply to Andras Balogh

Re: Course Creation Problem

by Arnold Pizer -
Hi Andras,

I have only done a new install of apache2, not an upgrade from apache1. Is it possible that with an upgrade, apache2 is running as a user other than apache?

Run the command "ps -aux" and see what user the /usr/sbin/httpd processes are running under.

Arnie
In reply to Arnold Pizer

Re: Course Creation Problem

by Andras Balogh -
Arnie,

It looks like they are running under the same user

apache1
root 31271 0.5 0.3 12012 6916 ? Ss 00:24 0:00 /usr/local/apache/bin/httpd
apache 31272 0.0 0.2 12012 5824 ? S 00:24 0:00 /usr/local/apache/bin/httpd
apache 31273 0.0 0.2 12012 5824 ? S 00:24 0:00 /usr/local/apache/bin/httpd
...

apache2
root 31246 2.0 0.6 28340 13496 ? Ss 00:23 0:00 /usr/sbin/httpd -k graceful
apache 31247 1.5 0.8 36128 18000 ? S 00:23 0:00 /usr/sbin/httpd -k graceful
apache 31248 3.1 0.9 37176 19204 ? S 00:23 0:00 /usr/sbin/httpd -k graceful
...


Andras
In reply to Andras Balogh

Re: Course Creation Problem

by Andras Balogh -
Arnie,

Is SELinux is enabled for you?
My problem was with SELinux.
Maybe it is not a problem anymore in fc9, but I am still running fc6.

On Fedora 6 with SELinux enabled the following security context modification
makes the problem go away (files get write permission through httpd)

sudo chcon -R -t httpd_sys_script_rw_t /opt/webwork/webwork2/logs
and from the /opt/webwork/courses directory
sudo chcon -R -t httpd_sys_script_rw_t */logs
sudo chcon -R -t httpd_sys_script_rw_t */scoring

I wonder if upgrading to fc9 will help.

Andras
In reply to Andras Balogh

Re: Course Creation Problem

by Andras Balogh -

After several more "chcon -R -t httpd_sys_script_rw_t" did not fix all the warnings I just discovered in the webwork-fedora installation manual:

>> Under SELinux select Disabled, click Forward and then click Yes to confirm


I did not read this part before since it was not a fresh installation.

Andras
In reply to Andras Balogh

Re: Course Creation Problem SOLVED!!!

by Enrique Martinez Roldan -
Michael, Andras thankyou soooo much!!! the problem was solved after viewing the last reply, where Andras mentioned Selinux, then I verified and solve my problem; sorry, surely I missed this step while I was configurating my webwork that now is working.

Thanks Thanks smile