Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Installing Moodle on SmarterASP.NET.

Installing Moodle on SmarterASP.NET: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 120: Line 120:


* it appears wwwroot works with both www.ccsdcurriculum.com/moodle and ccsdcurriculum.com/moodle, I'm not sure if one is more right/correct than the other.
* it appears wwwroot works with both www.ccsdcurriculum.com/moodle and ccsdcurriculum.com/moodle, I'm not sure if one is more right/correct than the other.
* if you type in the wrong path to dataroot, will get an error like this:
** Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.


==test connection with MySQL phpMyAdmin==
==test connection with MySQL phpMyAdmin==

Revision as of 18:18, 22 February 2013

Background

Often teachers and administrators want to use Moodle in a live shared web hosting environment instead of a private local computer install. Many hosting companies such as Go Daddy have a one-click install of Moodle. In the case of Go Daddy, they install Moodle 1.9 (as of 2/18/2013) but what if you want to run a later/newer version of Moodle (see below Go Daddy tech support response) or your web hosting company doesn't support Moodle one-click installs? This installation guide will walk you through the steps to install the latest version Moodle on SmarterASP.NET shared web hosting.

Upgrading Existing Moodle Install on Go Daddy shared hosting

  • "Thank you for contacting Online Support. I understand you need your Moodle upgraded. We are unable to upgrade the Moodle for you and unable to provide exact instructions on how to do it. The upgrade is not done through the hosting control center. You must do the upgrade through the coding of the site itself. Moodle will provide you with instructions on how to upgrade Moodle. Upgrading Moodle" (Go Daddy tech support response by Taylor P. on 2/22/2013)

Obtain Domain Name

Purchase Web Hosting

  • obtain web hosting account on SmarterASP.NET (if you like this tutorial, please support me by purchasing through my affliliate account)
  • I purchased the .NET Premium shared hosting for $7.95 a month ($95.40 a year)

Configure Domain Name Server (DNS)

DNS on Go Daddy

  • If you purchased your domain from another hosting company, you will need to login to the control panel of that hosting company and have the DNS entry point to the SmarterASP.NET servers, ns1.dns-ez.com & ns2.dns-ez.com
    • If your domain was purchased from Go Daddy, here is the steps to set/change the domain name so it points to SmarterASP.NET web hosting
      • login to Go Daddy My Account
      • My Account → Domains → WestCTA.com → Launch → Nameservers Set Name Server
      • change nameserver to point to smarterasp.net, ns1.dns-ez.com and ns2.dns-ez.com
      • GoDaddySetNameserver.png

DNS on SmarterASP.NET

  • login to SmarterASP.NET control panel add new site in the Hosting Manager → Website Domain Manager → Add New Site
    • Website/Folder Name: ccsdcurriculum.com
    • Programming Language: PHP
    • might have to rename site5 to ccsdcurriculum.com, under the Site heading click the pencil paper icon next to site5 to change the name to westcta.com
      • if you forget to do this, will not be able to rename the site if you have a folder with the same domain name. Here is the work around
        • 1. rename the ccsdcurriculum.com folder to something different like, 1ccsdcurriculum.com
        • 2. change the domain name from site4 in website domain manager to ccsdcurriculum.com. Note, won't be able to do this if a folder of that name already exists.
        • 3. rename 1ccsdcurriculum.com back to ccsdcurriculum.com
    • add domain www.ccsdcurriculum.com to site5 by typing ccsdcurriculum.com under the Mapped Domain column heading and then clicking the Add button.
      • smarteraspWebDomainMgr.png

Setup DNS CNAME to ftp.ccsdcurriculm.com

  • note, this might already be done by default.
  • login to SmarterASP.NET control panel, then Hosting Control Panel → DNS Manager → westcta.com - click Manage button
  • create a CNAME record to ftp.ccsdcurriculum.com which points to ftp.smarterasp.net
  • SmarterASP-CNAME.png

Setup subdomain ftp.ccsdcurriculum.com

  • login to SmarterASP.NET control panel
  • Hosting Control Panel → DNS Manager
  • select domain name and click Manage button
  • edit CNAME record to ftp.ccsdcurriculum.com and point this to the SmarterASP.NET ftp server IP address 208.118.63.62

Create website directory and moodledata subdirectory

  • login to SmarterASP.NET control panel
  • Hosting Control Panel → Hosting Manager → File Manager → New Folder and recommend giving it the same name as your domain name, i.e. ccsdcurriculum.com. This folder might already exist, created automatically from previous step.
  • create a New Folder under ccsdcurriculum.com called moodledata. Note that SmarterASP.NET uses Windows Hosting so you cannot change permission like on linux systems using chmod 775
  • Hosting Control Panel → Hosting Manager → File Permission. Can only set edit Read/Write or edit Read-Only. I kept it at the default Read/Write but down the road Moodle complains the moodledata folder is not protected.

Setup FTP account

  • Goal is to create an ftp account to transfer local files to SmarterASP.NET
  • login to SmarterASP.NET control panel
  • Hosting Control Panel → Hosting Manager → FTP Users Manager → Add FTP User. Enter a user name and password.
  • Unable to create a ftp account at the root level with SmarterASP.NET, need to create a subdirectory. Recommend naming the file directory name the same as your domain name, for example ccsdcurriculum.org.

Create MySQL database

  • login to the SmarterASP.NET control panel and navigate to Hosting Control Panel → Database Manager → MySQL Manager → click Create New Database
  • enter a portion of the database name, like moodcur and the fullname will be db_9898fc_moodcur and a password of Abcd1234
  • write down the connection string info (Database Name, Server URL, Login Name and Password) as this will be used when creating the config.php file
  • SmarterASPCreateMySQLDB.png

Download Moodle

  • download zip version of moodle, moodle-2.4.1.zip standard package, don't use the windows installer one because this includes Apache, PHP and other server stuff which is not needed on a shared hosting environment.
    • Typically shared hosting companies do not allow remote desktop access (windows) or telnet shell access (linux) to manually download files to the server, so we have to download to your local computer and then upload it to SmarterASP.NET

Upload zip version of Moodle to web hosting

  • Need to use an ftp client such as FileZilla or UltraEdit to upload the zip file into your domain name directory.
  • Do not upload the file into the moodledata subdirectory
  • When you unzip the moodle-2.4.1.zip file, it will create the moodle directory and all the necessary application data.
  • Example, ftp.ccsdcurriculum.com and enter the ftp account info above for the username and password.
  • Then use File Manager of SmarterASP.NET Control Panel to unzip the moodle-2.4.1.zip file.
  • SmarterASPUnpackMoodle.png
    • takes a minute or two to unzip, when done will get a message that says "File Unzipped"

Check PHP Version Installed

  • login to SmarterASP.NET control panel, if not already in it.
  • Hosting Control Panel → Hosting Manager → File Manager → click New File button on the bottom of the screen. Give it a name phpinfo.php
  • click phpinfo.php and click Editor button (default is ANSI editor, can switch to UTF-8). Then type in the below code.
  • create a text file called phpinfo.php and type in the following code. Save and upload file via ftp to the SmarterASP.NET webserver, e.g. www.ccsdcurriculum.com/phpinfo.php

<?php

 phpinfo();

?>

optional - Update PHP version to 5.4.7

  • login to SmarterASP.NET control panel
  • Hosting Control Panel → IIS Manager → PHP Version Manager
  • SmarterASPIISUpgradePHP.png

Create config.php

  • edit the ccsdcurriculum.com/moodle/config-dist.php and save as config.php in the same directory. I'm using UltraEdit.
  • edit lines 41 - 47 with the SmarterASP.NET specific connection string

$CFG->dbtype = 'mysqli'; // 'pgsql', 'mysqli', 'mssql', 'sqlsrv' or 'oci' $CFG->dblibrary = 'native'; // 'native' only at the moment $CFG->dbhost = 'MYSQL5002.Smarterasp.net'; // eg 'localhost' or 'db.isp.com' or IP $CFG->dbname = 'db_991088_moodcur'; // database name, eg moodle $CFG->dbuser = '991088_moodcur'; // your database username $CFG->dbpass = 'Abcd1234'; // your database password $CFG->prefix = 'mdl_'; // Prefix to use for all table names

  • Other variables must be defined as follows, line 97 for wwwroot, line 113 for dataroot (use SmarterASP.NET File Manager to find the full path to your domain name, in this case it is h:\root\home\jefferyjjensen-001\www\ccsdcurriculum.com)

$CFG->wwwroot = 'http://www.ccsdcurriculum.com/moodle'; $CFG->dataroot = 'h:\root\home\jefferyjjensen-001\www\ccsdcurriculum.com\moodledata';

  • it appears wwwroot works with both www.ccsdcurriculum.com/moodle and ccsdcurriculum.com/moodle, I'm not sure if one is more right/correct than the other.
  • if you type in the wrong path to dataroot, will get an error like this:
    • Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

test connection with MySQL phpMyAdmin

  • login to SmarterASP.NET control panel
  • Hosting Control Panel → Database Manager → MySQL phpMyAdmin. Use the following login creditials
  • Server = MYSQL5002.Smarterasp.net
  • Username = 991088_moodcur
  • Password = Abcd1234
    • if getting error number 1045 Cannot log in to the MySQL server, double check your Server name is correct, in my case it was wrong.
    • the database should be blank, that is no tables in it.
    • logout of phpMyAdmin

Moodle Configuration

  • visit your domain name, for example http://www.ccsdcurriculum.com/moodle
  • Installation - agree to the copyright notice, click the Continue button
  • Server checks on Moodle 2.4.1+ build, click the Continue button
    • might need to notify SmarterASP.NET to enable the following php_extensions
      • soap extension which is useful for web services and some contrib modules
      • Intl extension which is used to improve internationalization support, such as locale aware sorting
      • UPDATE - on 2/21/2013 Ailen, SmarterASP.NET staff member globally enabled the PHP soap and intl extensions, so you shouldn't see any warning messages on the server checks.
  • wait about 5 minutes while the Moodle tables are imported into the MySQL database
    • HTTP Error 500.0 - Internal Server Error. C:\php54\php-cgi.exe - The FastCGI process exceeded configured request timeout.
      • SmartASPMoodleSetupError.png

See Also