
为了真正能使Moodle用起来,性能和安全是必须解决的问题。
闲着无事上午把Lamp优化的网页瞎看了一下。
我们的Moodle现在是放在windows上的,可以直接使用Moodle一体化安装包进行优化。也可以考虑最新版Xampplite for windows,把一体化安装包中的Moodle相关目录拷贝到这个xmapplite目录下进行安装。
这篇文章:readme_en.txt相对比较详细的介绍了ApacheFriends XAMPP一些安全必读的内容
这一段很重要:
----------------------------------------------------------------
A matter of security (A MUST READ!)
As mentioned before, XAMPP is not meant for production use but only for developers in a
development environment. The way XAMPP is configured is to be open as possible and allowing
the developer anything he/she wants. For development environments this is great but in a
production environment it could be fatal. Here a list of missing security
in XAMPP:
- The MySQL administrator (root) has no password.
- The MySQL daemon is accessible via network.
- phpMyAdmin is accessible via network.
- Examples are accessible via network.
To fix most of the security weaknesses simply call the following URL:
http://localhost/security/
The root password for MySQL and phpMyAdmin, and also a XAMPP directory protection can being
established here.
---------------------------------------------------------------ApacheFriends XAMPP (basic package) version 1.6.4 包含以下内容
+ Apache 2.2.6
+ MySQL 5.0.45
+ PHP 5.2.4 + PHP 4.4.7 + PEAR
+ PHP-Switch win32 1.0 (please use the "php-switch.bat")
+ XAMPP Control Version 2.5 from http://www.nat32.com
+ XAMPP Security 1.0
+ SQLite 2.8.15
+ OpenSSL 0.9.8e
+ phpMyAdmin 2.11.1
+ ADOdb 4.95
+ Mercury Mail Transport System v4.01b
+ FileZilla FTP Server 0.9.23
+ Webalizer 2.01-10
+ Zend Optimizer 3.3.0
+ eAccelerator 0.9.5.2 for PHP 5.2.4 (comment out in the php.ini)
如果对命令行不习惯,也可以考虑使用图形化的Apache配置软件apconf或者APMServ进行Apache的图形
设置,部署好了之后,可以考虑对性能进行一些测试,我这里有一个简单的test.php,可以测试载入时间
,100万次循环运算。
然后看看PHP和Apache的几个优化:
Zend Optimizer
eaccelerator 安裝分享
eaccelerator下载
如果是Moodle一体化安装包,就可以直接对内置的zend等进行优化,针对httpd.conf和PHP.INI文件操作
,可以去掉注释符号,把eaccelerator放在zend之前即可。
然后看看Apache的性能测试,在bin目录的ab命令的使用。ab/?看帮助
ab -n 10 -c 10 http://127.0.0.1/
得到以下结果
C:\xampp\apache\bin>ab -n 10 -c 10 http://127.0.0.1/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient).....done
Server Software: Apache/2.2.6
Server Hostname: 127.0.0.1
Server Port: 80
Document Path: /
Document Length: 58769 bytes
Concurrency Level: 10
Time taken for tests: 1.437500 seconds
Complete requests: 10
Failed requests: 0
Write errors: 0
Total transferred: 589890 bytes
HTML transferred: 587690 bytes
Requests per second: 6.96 [#/sec] (mean)
Time per request: 1437.500 [ms] (mean)
Time per request: 143.750 [ms] (mean, across all concurrent requests)
Transfer rate: 400.70 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 281 871 420.4 1000 1437
Waiting: 281 863 419.4 1000 1437
Total: 281 871 420.4 1000 1437
Percentage of the requests served within a certain time (ms)
50% 1000
66% 1031
75% 1281
80% 1296
90% 1437
95% 1437
98% 1437
99% 1437
100% 1437 (longest request)
也可以将并发数和用户数加大,我加到200的时候,机器类似于死机。-n是多少个请求,-c是多
少个并发当然也可以利用test.php具体测试速度变化,调整到100的时候,感觉能用。看来还需
要对系统进一步优化,见该网页:
Apache 1.3.x的安装与配置笔记`
MYsql优化实例
然后就找些资料,慢慢的优化,知道路子就好了。先把模拟考试过程走完
这是官方的Moodle优化建议
没事可以多研究一下。模拟测试的学生名单
模拟考试的试题
根据给的试题和名单,进行模拟名单导入以及模拟试题的导入或填写,
走完部署考试软件过程总结的前5个模拟流程。(原文地址:http://hi.baidu.com/whusoft/blog/item/1740901618d0f91b962b4379.html)


