Moodle on hostgator problems

Moodle on hostgator problems

by Dale Smith -
Number of replies: 18

I cannot register with moodle.  When I try, I get: ERROR 403 - FORBIDDEN   and some text about permissions but I do not know what files to give permissions to.

Also, I put a cron job as described via the cpanel but it doesn't seem to work.  

Please help.  

Average of ratings: -
In reply to Dale Smith

Re: Moodle on hostgator 403 problems

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hello. Thanks for posting here. (I replied to your query on the support email about registering.)

Just some background -and I am not a technical person so I can't help anymore. We've found this error message suggests you are using an Apache module which is not compatible with Moodle and therefore your system is generating the error message, not Moodle.

Therefore , it's not a Moodle problem although it might be a Hostgator problem so perhaps others with that experience can offer suggestions. Otherwise you could perhaps get in touch with Hostgator. 

In reply to Mary Cooch

Re: Moodle on hostgator 403 problems

by Dale Smith -

It is the only LMS I am experiencing this with so it is particular to moodle.  And I'm trying to find out if this means that Hostgator cannot be used as a host for moodle or if anyone who uses Moodle has had any insights to this before. I will contact Hostgator tomorrow to see what they say and if there is a solution or some kind of answer, I can post it.

Thank you.

In reply to Dale Smith

Re: Moodle on hostgator 403 problems

by Usman Asar -
Picture of Plugin developers Picture of Testers

Dale, like Mary mentioned, Apache's mod_security could be the issue, on most of the hosting services, this is not offered, as it adds another layer of security on top, if you're on CPanel, you will be able to find in SECURITY section, "ModSecurity", Disable ModSecurity for ALL or your Moodle domain and give it a try once gain.

if Mod Security isnt available there, let me know I'll let you know alternative way disabling Mod_Security using .htaccess file.

Alternatively, as you know the issue (btw, this is with HostGator only), you can go to their technical support straight away telling them to disable ModSecurity on your account for all your domains.




In reply to Usman Asar

Re: Moodle on hostgator 403 problems

by Dale Smith -

Usman,

Thank you for your response.  I do not see any feature in the cpanel called ModSecurity.  What other way could I fix this?


Thank you!

In reply to Dale Smith

Re: Moodle on hostgator 403 problems

by Usman Asar -
Picture of Plugin developers Picture of Testers

Dale, other way remains modifying .htaccess file, but before doing so, do contact technical support telling them you need  to turnoff modSecurity on your account, see what they say.


meanwhile, you can open filemanager in CPanel, and select option of show hidden/dot files

it will list files/folders in your account, look out for.htaccess file on root, right lick edit and and type in following.

even if you dont see file, you can create it manually

<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>
Save it and see if it solves the issue.
In reply to Mary Cooch

Re: Moodle on hostgator 403 problems

by Ken Task -
Picture of Particularly helpful Moodlers

Hosting providers sometimes have 2 or more versions of PHP on a single system and it's often the case that user is attempting to use older version of PHP with newer version of Moodle which requires higher version of php.

I see:

http://support.hostgator.com/articles/cpanel/how-do-i-create-and-delete-a-cron-job

and it says to enter the command for the cron job, but doesn't say what and I see no notes on possible issues running php in the cron job.

What did you enter in that box?

I'd advise using either wget or curl - something web based like a browser would use ...

wget http://yousite/admin/cron.php

or

curl http://yoursite/admin/cron.php

That's if: 1) the server you are hosted on has curl and/or wget installed on it, and 2)  you didn't check run cron from command line only.

And, If you put a password on running cron via web (which is advisable), then both of the above would have to incllude that password by adding ?password=letmein   The setup for that in Moodle shows exactly how to form the URL.

'spirit of sharing', Ken

In reply to Mary Cooch

Re: Moodle on hostgator 403 problems

by Dale Smith -

Even though hostgator fixed everything and the cron job is verified working on the server, I am still getting this notification from Moodle:  The cli/cron.php maintenance script has not been run for at least 24 hours. Help with Cron


I am also getting this message: Enabling the PHP setting display_errors is not recommended on production sites because some error messages may reveal sensitive information about your server.

How can I resolve these?  Thank you.



In reply to Dale Smith

Re: Moodle on hostgator 403 problems

by Usman Asar -
Picture of Plugin developers Picture of Testers

Dale, have you actually setup CRON in your Cpanel? if your Moodle was installed using script installer, then they do setup CRON automatically, if not, you have to setup CRON task in your CPanel's CRON Jobs section. CRON command that usually works for CPanel hosts is (adjust your path accordingly)

php -q /home/yourhostingusername/public_html/moodle/admin/cli/cron.php

Alternatively, Ken/Jonathan has already mentioned the cron command that will work on Hostgator BELOW

Regarding PHP errors, check your developer settings in Site administration > development > debugging and select NONE in debug messages. Else see if your PHP is setup to show debug messages, in that case your hosting provider will remove that option for you unless you are given privileges to make  changes in PHP.INI file.

In reply to Dale Smith

Re: Moodle on hostgator 403 problems

by Jonathan H. -

Good Evening,

I apologize I haven't had a chance to circle back on this yet - unfortunately we had some pretty serious flooding in Houston yesterday which kept most of us from making it to the office. All of our staff is doing fine but not everyone in the area was so fortunate so our thoughts go out to everyone negatively impacted.

I've since had a chance to look into this further and the issue with display_errors is pretty easily corrected by changing this setting from "On" to "Off" in the php.ini file for that directory. Here at HostGator we have an easy to use plugin to help modify that file for those who don't like using the command line or a code editor if anyone is interested : http://support.hostgator.com/articles/cpanel/php-configuration-plugin

In regards to the cron, I've done some research and see that Moodle has a security setting that by default, will only allow the cron job to run via the command line. Previously we had setup the cron to use 'wget' but as this is an http request, we needed to update this to use the 'php' command. There is an option to disable that setting in "Security - Site policies" but for security purposes, we've kept it intact. I've confirmed this ran successfully for the Moodle Dale contacted me about and an example for HostGator would be as follows : 

php public_html/example.com/admin/cli/cron.php >/dev/null

This example would be for an addon domain. If the Moodle was installed as your primary domain, you would use :

php public_html/admin/cli/cron.php >/dev/null

I hope this helps but if anyone on our platform continues to struggle please let me know!

In reply to Dale Smith

Re: Moodle on hostgator problems

by Just H -

Rather than people guessing and perhaps sending you down the wrong path, what exactly does the 403 say? Also, have a read through this article to see if it casts any light on the issue you're facing.

Personally, if you do have ModSec installed, I wouldn't suggest turning it totally off ... no matter how much a pain in the proverbial it can be. If the .htaccess file mentioned by Usman works (worth a quick check) I'd be looking into what rule Moodle is triggering and take it from there.

In reply to Dale Smith

Re: Moodle on hostgator problems

by Jonathan H. -

Greetings Dale,

My name is Jonathan H. and I'm our customer service supervisor over at HostGator.com. We were sorry to hear you're having trouble on our platform and would definitely like to investigate further with you, so if you wouldn't mind shooting us an e-mail to feedback@hostgator.com ATTN. Jonathan H. including the domain name for your account, we'll be glad to get this to our administrators to investigate as quickly as possible. 

Thanks for your attention and we'll look forward to hearing back from you soon.

Average of ratings: Useful (1)
In reply to Dale Smith

Re: Moodle on hostgator problems

by Jonathan H. -

Good Afternoon,

We wanted to follow up on this issue and report that as Usman had suggested, this issue was related to a mod_sec rule on our servers. After whitelisting this rule, we have received confirmation that the issue has been resolved. 

In regards to the cron job, similar to what Ken had suggested, the cron needed to be updated as follows :

0 * * * * wget example.com/admin/cli/cron.php >/dev/null

We hope this helps provide a bit of insight into the troubles but if any Moodle users continue to run into these issues, please give us a call at 1.866.96.GATOR or start a live chat at https://chat.hostgator.com and we'll be more than happy to help. 

Average of ratings: Useful (4)
In reply to Jonathan H.

Re: Moodle on hostgator problems

by Ken Task -
Picture of Particularly helpful Moodlers

Have to say ... congrats!  I think your's is the first posting I've ever seen in these forums from a well-known provider.   That's a + for HostGator!

Know that most of the time, one finds link to these forums from well-known providers sites yet, no one from the provider ever participates or answers issues - many times, best we 'mere mortals' can do is guess (if we don't happen to host with provider).   Also know y'all do have docs/FAQ's etc.   Maybe y'all need to start a Moodle on Hostgator thread somewhere. ;)

Now a question ... which you may/may not know for other providers ... but I'll ask anyway ...

Let's say customer discovers they need more umph and shared hosting won't get 'er done.   They opt to upgrade to a VPS.   Does Hostgator simply copy the users home directory to a new VPS and leave it at that?

Is it possible to re-set the cPanel in a VPS to see the entire VPS server thus customer is able to move out of restricted 'user space' and into areas like /var/www/ (apache space) as most standalone servers would have?

'spirit of sharing', Ken


In reply to Ken Task

Re: Moodle on hostgator problems

by Jonathan H. -

Good Afternoon Ken,

Thanks so much for the supportive comments!

It can certainly be daunting to try and keep up with the forums for all the different content management systems out there but we're making a concerted effort to try and stay more on top of these which has become a lot easier thanks to Google Alerts.

In regards to your questions, while VPS are great for individuals that need root access to the server, they might not necessarily have more "umph" depending on what you are referring to. Shared hosting servers are typically quite a bit more powerful than VPS so upgrading from shared to VPS for performance purposes is not always the best idea.

If you're looking to have access to /var then yes, VPS is a very cost effective way to have root access to your server as they are more affordable than dedicated servers. To circle back on your original question, while yes we do copy over the user's home directory, the customer will also have root access to the VPS.

I hope this helps but we also have the following article available where we have outlined scenarios where we recommend a VPS versus a dedicated server : http://support.hostgator.com/articles/hosting-guide/hosting-plan-comparison/dedicated-server-versus-a-high-level-vps

Thanks again for the feedback and we will certainly consider opening a dedicated thread for our platform. 

Average of ratings: Useful (1)
In reply to Jonathan H.

Re: Moodle on hostgator problems

by Usman Asar -
Picture of Plugin developers Picture of Testers

smile This is the first time I am seeing Customer support directly involving on this level, which is a good sign, wish every other hosting provider should start doing the same.

In reply to Jonathan H.

Re: Moodle on hostgator problems

by Dale Smith -

Thank you!  And great job for Hostgator!  I switched over to it two years ago and I am happier than ever that I did.


Dale