本文始作于2012年3月20日,刊登于人人网,于2013年2月13日迁移至此
寒假的时候就答应sunner帮他维护cms,结果后来就忘了,主要原因应该是寒假那会儿安装moodel失败了,结果就再没管那些事。最近才想起来这件事,为了以后重用,我把关键步骤记录下来:
前提是用新立得安装的LAMP。首先你应该切换到apache工作目录/var/www/下,然后根据moodle官方的推荐,用git下载moodel源代码,并且让我作为开发者跟踪moodle的开发进程官方配置是这样说的:
$ git clone git://git.moodle.org/moodle.git (1)
$ cd moodle$ git branch -a (2)
$ git branch --track MOODLE_22_STABLE origin/MOODLE_22_STABLE (3)
$ git checkout MOODLE_22_STABLE (4)
- The command (1) initializes the new local repository as a clone of the 'upstream' (i.e. the remote server based) moodle.git repository. The upstream repository is called 'origin' by default. It creates a new directory namedmoodle, where it downloads all the files. This operation can take a while as it is actually getting the entire history of all Moodle versions
- The command (2) lists all available branches.
- Use the command (3) to create a new local branch called MOODLE_22_STABLE and set it to track the remote branch MOODLE_22_STABLE from the upstream repository.
- The command (4) actually switches to the newly created local branch.
Note that Git has a huge number of options for each command and it's actually possible to do the above process with a single command (left as an exercise!!).
这样就在apache工作目录下下载好了moodle的源码了,但是还没有安装。在浏览器地址栏输入:localhost/moodle,然后就是安装界面了,然后连续的点击下一步。
在安装的过程中报错需要给php安装并开启curl扩展:
shell> sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
然后重启apache:
shell> sudo /etc/init.d/apache2 restart
然后回到浏览器安装界面,点击“重新载入”来继续安装。
在安装的过程中还会遇到无法创建moodledata的问题,这个是权限问题,在浏览器没办法使用超级用户权限,于是你就不得不手动创建moodledata并赋予可都可写可执行权限:
shell> cd /var/www
shell> sudo mkdir moodledata
shell> sudo chmod 777 moodledata
我记得好像还要改变moodle根目录的读写执行权限才可以:
shell> sudo chmod 777/var/www/html/moodle
然后回到页面使其继续安装,应该就可以了,安装的时间回比较长,在这个过程中浏览器标签会一直显示正在载入,别刷新别关闭重来什么的,过一会儿就好。
浙公网安备 33010602011771号