开发者

Moodle 2.0 with Nginx backend

开发者 https://www.devze.com 2023-04-05 11:42 出处:网络
Hello I am looking for a tutorial on how to configure a server for Moodle 2.0 with nginx as the server and PHP-FPM or FastCGI with mySQL as the backend. Sorry if I am confusing these terms bit of a se

Hello I am looking for a tutorial on how to configure a server for Moodle 2.0 with nginx as the server and PHP-FPM or FastCGI with mySQL as the backend. Sorry if I am confusing these terms bit of a server architecture noob. Probably would run it on Ubuntu/Debian machine

found a tutorial for older versions of Moodle with older PHP and PostgreSQL compiled from source. This would slow d开发者_Python百科own my deployment plans and seems deprecated. Also would prefer MySQL over Postgres based on my experience level with MySQL.

Can anyone out there make some updated suggestions?


I wrote a documentation for Nginx and Moodle 2: http://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm

Don't forget to set slash arguments to off in Moodle, otherwise you'll have problem with image links in the html editor.


First of all, you need to run php-fpm on nginx... http://www.bytetouch.com/blog/linux/how-to-nginx-with-php-fpm-fastcgi-implementation-on-debian-lenny/

to better performance i use unix sockets to connect instead tcp sockets, here appears configuration for unix sockets. http://andreas-lehr.com/blog/archives/491-nginx-wordpress-php-fpm-on-debian-squeeze.html

i use the following conf for php in nginx

            location ~ \.php($|/) {
                    if ($uri ~ "^(.+\.php)(/.*)") {
                            set $script $1;
                            set $path_info $2;
                    }

                    fastcgi_pass    unix:/var/run/php-fpm.sock;
                    fastcgi_param   SCRIPT_FILENAME  $document_root$script;
                    fastcgi_param   SCRIPT_NAME      $script;

                    include        /etc/nginx/fastcgi_params;
            }

you need to replace the unix socket, and i don't know if debian distribution have fastcgi_params include file, but have anyway by hand in tutorials

After that, you run php in a nginx server then you could use moodle and all your favorite php scripts or applications.

if you have some doubt, comment it =).


I suggest you to keep slash argument enabled, expecially if you have already uploaded resources (ie. SCORM) and put this in the server {} section of your nginx virtual host

rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号