"NetworkError: 403 Forbidden in new moodle 2.9.1 installation

"NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Imran Akhtar -
Number of replies: 10

Hi,

With my new installation of moodle 2.9.1, I am not able to use site administration option (seems disabled links) and some other options are also not working during course & quiz creation.

I have tested it on Chrome, I.E. and Firefox, having same problems on all browsers. Firefox web console show error;  

"NetworkError: 403 Forbidden - http://infomed.memon.jp/elearning/theme/yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js&rollup/1436378260/mcore-min.js"

and 

ReferenceError: YUI is not defined.

I have attached screen shot of console.

I have gone through other discussions on this forum and FAQs but didn't found solution to this problem.

Same installation is working perfectly on localhost.

May I request help for some solution/tips.

Thanks 

Imran

Attachment Moodle Error.jpg
Average of ratings: -
In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You need to look at that in the web server error log to see why it generated the 403 error.

Anyway, it's almost certainly your web server configuration that's causing the issue.

In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Usman Asar -
Picture of Plugin developers Picture of Testers

looks like you've been playing with permissions on the server and allocated wrong permissions to wrong folder as I can see your root directory listings, means you haven't still secured your root directory to be displayed.

Have a look into your htaccess file and see whats there.

In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Imran Akhtar -

I am new  to moodle. I have installed moodle 2.9.1 in a directory under document root e.g mydomain.com/elearning, during installation I set moodledata location in root directory (outside of elearning forder).

Now I cannot see moodledata folder with filezilla (FTP tool).

Site administration links are not working and I can see error "ReferenceError: YUI is not defined" in web console of FireFox.

moodledata is located at '/usr/www/users/karachi/moodledata'

Can location of moodledata be the cause of this error?

Can I move/change the location of moodledata folder from moodle itself?


In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Did you move the moodledata folder?  In which case, you need to update your config.php file in the moodle folder to point to the new location.  You also need to check permissions on your folders and make sure that they are correct.

In reply to Emma Richardson

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Imran Akhtar -

Hi Emma,

Thanks for your reply.

I have not move moodledata, it is on it's original location as it was configured during installation /usr/www/users/karachi/moodledata.

I cannot see the folder in filzilla.

Permissions are set to 755.

Root permissions are inherited (xxx) and that are set by server admin (of remote server).

In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

When you install, Moodle will ask for the location but it will not actually create the folder.  If you cannot see the folder, then maybe it isn't there?  Did you actually create it?  Can you see it from anywhere?

In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Ken Task -
Picture of Particularly helpful Moodlers

Pardon this intrusion, but ...

"Root permissions are inherited (xxx) and that are set by server admin (of remote server)."

I think is the issue ... system is linux, you are not root user, it is remotely hosted and true server administrator (ie, root user) setup the moodledata folder.  If it has root:root ownership/permissions FileZilla will not see it and for sure Moodle won't see it or can't use it.

Moodle does have a requirement ... moodledata cannot be in a directly accessible web directory ... like http://site/moodledata ... which is the same level as your elearning directory where the current moodle code resides.

While that can be worked around would hate to suggest something to try without knowing there is a chance for success.   To offer such suggestions, one would need to know more detail about the server: what provider (hosting company), operating system is Linux but what flavor, and since you are on what appears to be a shared server, just how much access do you have.  

So, bottom line .... you probably need to contact server admin and tell him/her about the issue.

'spirit of sharing', Ken


In reply to Ken Task

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Imran Akhtar -

Ken, thanks for the details. You are right my domain is "http://infomed.memon.jp/".

Instead installing in root folder, I created a folder "elearning" and installed in it.

Path I have given myself for moodledata was '/usr/www/users/padela/moodledata' that I can see in config.php as 

$CFG->dataroot  = '/usr/www/users/padela/moodledata';

Site is hosted at pair.com.

I am afraid that you are right, moodle is not able to access it.

Is there any way to move moodledata to some other location or create a new one and change path in config.php?




In reply to Imran Akhtar

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Ken Task -
Picture of Particularly helpful Moodlers

Ok, have done some 'leg work' for you ... ie, investigation, which may NOT be correct, but it might give you a clue as to what you need to do and what you need to ask hosting provider.

https://www.pair.com/support/knowledge_base/the_basics/troubleshooting_access_problems.html

on the page above it says under troubleshooting:

"There is a symbolic link called "public_html" in your home directory, which can be used to reach your Web directory. You may also reach your Web directory at the path "/usr/www/users/username/".

The directory  for the moodle code needs to be inside public_html (normally).  It is ... as anyone can see an elearning directory there and when accessing it one sees that Moodle is being served out.

But, one can also see a /usr/www/users/[yourusername]/mdata/moodledata/ directory in public_html.   Moodle should object to that and it could be the source of your errors.

You need to ask your provider IF they could change the directory to be served out to be public_html/elearning/     That becomes your document root ... thus one would only need http://yoursite/ to access it.   The moodledata folder now is the issue ... having apache access it securely.

IF the provider would allow you to have public_html still readable/accessible by apache then what you have in /usr/www/users/[yourusername]/public_html/mdata/moodledata could be moved to /usr/www/users/[yourusername]/public_html/moodledata/ and Moodle code (apache user/group) could still see the data folder.  BUT no one could browse to http://yoursite/moodledata.

You would have to adjust your config.php files path to

/usr/www/users/[yourusername]/public_html/moodledata/

You could try this to see if the errors go away or not:

In the path to moodledata:

/usr/www/users/[yourusername]/mdata/moodledata/

Now it might work, but you'd need a way to prevent directory browsing ... ie, test to see if

you could access directly via URL line of a browser:

http://yoursite/mdata/

Without those secure changes, afraid Moodle might only half function and you'll continue to get 403 forbidden errors as Moodle code does NEED to be able to write to directories/files that are in moodledata.

When you talk to provider, might also give them this link:

https://docs.moodle.org/29/en/Installing_Moodle#Create_the_.28moodledata.29_data_directory

which explains.

'spirit of sharing', Ken

In reply to Ken Task

Re: "NetworkError: 403 Forbidden in new moodle 2.9.1 installation

by Imran Akhtar -

Thanks Ken,

Planning to reinstall from scratch.