don't have permission to access /user/view.php

don't have permission to access /user/view.php

by Rein Laaneser -
Number of replies: 8
Hi
I did moodle fresh install.
Everything went well until got error
"You don't have permission to access /user/view.php on this server"

Still i can log in and use site, but not fully. When I would like to clik to
Change the admin user info, password
http://didasko.emkts.ee/user/view.php?id=1
Then I will get a error 403 Forbidden
"You don't have permission to access /user/view.php on this server"

Thre folder/file permissions are as they are after unpacking the moodle.tgz.
Moodledata folder have a owner apache and permission 0777

Any idea?
Average of ratings: -
In reply to Rein Laaneser

Re: don't have permission to access /user/view.php

by Zbigniew Fiedorowicz -
You have to set permission 0777 or 0775 on the user/ subdirectory of your Moodle installation.
In reply to Zbigniew Fiedorowicz

Re: don't have permission to access /user/view.php

by Rein Laaneser -

I did so, even if theese permissions where not needed for regular directories.

But no result, that means same result. Same error 403 Forbidden. "You don't have permission to access /user/view.php on this server."

This is with Apache 2.0.51, MySQL 3.23 in Fedora Core 2 server, with moodle 1.4.3+

-ReinL:

In reply to Rein Laaneser

Re: don't have permission to access /user/view.php

by Zbigniew Fiedorowicz -
It looks like there is some restriction in your Apache httpd.conf file,  forbidding access to your user/ subdirectory.  Ask your system administrator.

Such a restriction could also be due to an .htaccess file in your user/ subdirectory.  It that's the case, just remove the .htaccess file.
In reply to Zbigniew Fiedorowicz

Re: don't have permission to access /user/view.php

by Rein Laaneser -
Did not found any evidence there about "user" subdirectory restrictions in httpd.conf. 
:-|

I' starting to be a bit confused. I did install it again but same result. There is no error until it stops before choosing a admin password. with this error.
After this I can log in with admin admin, and seems that everithing else works.
????

-ReinL:

In reply to Rein Laaneser

Re: don't have permission to access /user/view.php

by Zbigniew Fiedorowicz -
The "You don't have permission to access" error has to be due to either the wrong file system permissions on the directory or to the web server configuration.  Since you have already checked the file system permissions on your user directory, by process of elimination, it has to be due to the web server configuration.

Checking the web server configuration settings is a more complicated business.  Even if there is no explicit mention about the /user directory in httpd.conf, there are various obscure ways in which this might be configured.  For instance the restriction on /user might be configured in some Apache module activated in the web server.  It might even be compiled in the Apache source code in your installation.

You might try the following experiment.  In one of the Moodle directories that you can acccess, say /admin, create a subdirectory /admin/user  and put an empty file something.txt.  Make sure /admin/user and /admin/user/something.txt have the correct file system permissions.  See if you can access something.txt over the web.

If you can access it, then probably the following fix would work.
  1. Create a directory moodle at the top level of your web folder (where your config.php is currently located). Give it 775 permissions
  2. mv all your Moodle files into the moodle directory
  3. Edit your Moodle config.php file to include "/moodle/" in the relevant file paths, $CFG->wwwroot, $CFG->dirroot (and possibly $CFG-dataroot)
  4. You should now be able to access your Moodle installation as http://didasko.emkts.ee/moodle/ including http://didasko.emkts.ee/moodle/user/view.php
The idea would be that whatever restriction on the /user directory is configured somehow in Apache, the restriction would not apply to /moodle/user
In reply to Zbigniew Fiedorowicz

Re: don't have permission to access /user/view.php

by Rein Laaneser -
We did Found a problem, Thank you Zbigniew

in was a AliasMatch for eliminating the tilde  (~/username) for servers users and replacing that with /user/username

Line was
AliasMatch ^/user/([a-zA-Z0-9]+)/?(.*) /www/webuser/$1/html/$2

For now temporaryly we need to change there user to users but, can we do this just for virtualhost, or do we need to change globally for all users.

Is there better way to eliminate tilde (~/username) ?
Probalby is wink

-ReinL:

In reply to Rein Laaneser

Re: don't have permission to access /user/view.php

by Bill Burgos -
Hello Rein,

Sometimes the Forbidden message also refers to the ownership of the directory or file not being correct. How it would be after an upgrade, I don't know.

However, you might double check both the permissions and the ownership of the usr directory and view.php.

Depending on your setup, the ownership could be:

apache, www-data, www, or the username.

In any case, it should match the files and directories in other directories of the Moodle installation.
In reply to Bill Burgos

Re: don't have permission to access /user/view.php

by Rein Laaneser -
I did double check as well

owner: username.groupname
perimissions are
user: rwx
group: r-x
other: r-x

-ReinL: