Installation in CenTOs by the book

Installation in CenTOs by the book

by Mari Cruz García -
Number of replies: 5

Hello,

Our department has recently hired hosting space at the University and we have a virtual machine using CenTOs 6.3.

I am installing a brand new Moodle site 2.5 stable to set up a sort of performance baseline.

There are specific firewall restrictions at the University, so I have had problems installing some repositories in the virtual machine in the past.

I am installing the Moodle site following the instructions in Moodle.org (that is what I meant with 'by the book'):

http://docs.moodle.org/25/en/CentOS_Linux_installation

I have two problems following the instructions:

1) I cannot install zend-server because I get a network error connection (I guess it may be firewall restrictions).

As far as I understand, zend-server is php-web based software to enhance the performance, but it not an strict requirement (as a matter of fact, I have seem 'unofficial' Moodle technical blogs in which the authors don't use Zend server).

Can you please confirm that it is OK not to install Zend-server?

2) I cannot finish the installation by running http://localhost/moodle,

because I don't have a remote access desktop software (I use Putty and WinSCP). I have requested IT to have a VN client in my laptop computer and they are installing desktop facilities and a VNC server in the VM, but I don't know when this will be completed and I am behind schedule.

Will the performance be affected if I create the config.php manually?

To enable the option of 'Unix socket' on, in addition to

'dbsocket'  => true,

Do I need to do something else?

Thank you very much for your advice.

Average of ratings: -
In reply to Mari Cruz García

Re: Installation in CenTOs by the book

by Ken Task -
Picture of Particularly helpful Moodlers

First, CentOS 'by the moodle book' is one persons recommendations ... don't run Zend Server myself on several CentOS 5 and 6 servers and really don't miss it.

One could install without the use of browser.  Not sure the CentOS desktop will actually provide you any advantage since you already have ssh access.

Before you begin ... does the server have an entry in DNS - a fully qualified domain name?  Rather than localhost, use the FQDN ... it will save some work later.

Have all the required php extensions already installed?

php -v (will show version)

php -m (will show all extensions loaded)

Have a DB created for Moodle already?  Is the DB set to character set utf8 with collation utf8_general_ci?

Have you manually created the moodledata directory and set ownership/permissions to apache user apache group?

Have you set selinux from enforcing to submissive?  That might require restart of server.

Do you have MySQL daemon (mysqld) already running with a password?

Is the version of MySQL high enough to run 2.5->?

IMHO ... there really isn't any advantage in working in the CentOS GUI (desktop).   Rather, look into installing something called Webmin.  Has all the tools one needs to get moodle up and running - start/stop daemons, set the user/passwords/host for MySQL, create databases with correct character set/collation, etc.  Plus some other handy tools ... schedule a cron based auto backup of the DB for Moodle, etc, etc.

If all things are in place, one could use ssh to install:

cd moodle/admin/cli/

php install.php -h

will bring up the help screen for that script.

or just run it and be ready to answer the prompts (same ones you see using the web based install).

After successful install, one could need to change ownerships/permissions on the files/folders in the moodle code folder - one ran the script as root user and thus config.php is tagged as belonging to root user.  If you don't do this ... you'll get a blank screen and might think the install failed.  It didn't ... just:

cd /var/www/html/[moodle]

chown apache:apache * -R

and then try the URL in a browser again.

'spirit of sharing', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Installation in CenTOs by the book

by Mari Cruz García -

Thank you very much for answering, Ken.

I managed to complete the installation in a different way, but it is working fine. Your advice was very useful.

I haven 't installed Zen Server at the moment.

For an empty Moodle site, I got the following performance info:

2.304815 secs

RAM: 21.2MB

RAM peak: 21.5MB

Included 656 files Contexts for which filters were loaded: 1 Filters created: 2

Pieces of content filtered: 3 Strings filtered: 0

get_string calls: 961 DB reads/writes: 49/

6 Load average: 0.08 Session: 4.1KB

The configuration of the Unix socket is:

$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbsocket' => 1,
'dbport'    => '',
);
 

Having the debugger on to show ALL reasonable messages (standard theme, Moodle 2.5 estable), I got the following error messages many times:

/html/moodle/lib/moodlelib.php on line 9234 Warning: include(): Unable to allocate memory for pool. in /var/www/html/moodle/lib/moodlelib.php on line 9234

Warning: include(): Unable to allocate memory for pool. in /var/www/html/moodle/lib/moodlelib.php on line 9234

Warning: include(): Unable to allocate memory for pool. in /var/www/html/moodle/lib/moodlelib.php on line 9234

Warning: include(): Unable to allocate memory for pool. in /var/www

Average of ratings: Useful (1)
In reply to Mari Cruz García

Re: Installation in CenTOs by the book

by Ken Task -
Picture of Particularly helpful Moodlers

Well, that's why one has to be careful about following documentation that was written for CentOS 5 and before version 2.5 of Moodle.  Not faulting documentation nor the author ... it's the nature of documentation to be out of date almost from the moment of publishing in many cases.

Your CentOS *6* could be running apc now ... which is caching.  Now think about that one a minute ... we now have MUC (Moodle cacheing) + apc + whatever your provider may have setup (network wise).  Confusion will be the order of the day then.

The error 'Unable to allocate memory for pool.' might be coming from apc.

http://us2.php.net/apc.configuration

Fix:

apc.shm_size -> than what value is there now.

And, forgot which one, but an apc-x.ttl (time to live) needs reducing - ie, will update the cache more often.

You'll find apc.ini in /etc/httpd/conf.d/ if it is running and in that file is where one does the tweaks.

Restart apache after tweaking/editing:

/sbin/service httpd restart

Check error log:

tail -n 40 /var/log/httpd/error_log

Something else to consider ... if you followed the recommendations to install MySQL via rpm's ... that was ok ... at least the recommendation was for 5.5.  But ... most linuxes do have repos that are reliable sources for updates.  For CentOS 6, there is remi repo (Google that to see how to set it up).  I mention this for a couple of reasons ... yum with repos makes it dead simple to update.  If there is a security announcement about MySQL 5.5 and you installed via the RPM route, you'll have to manually upgrade via RPM route.  If one had installed via repo (remi) those updates are a breeze to acquire.

Just my two cents! ;)

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Installation in CenTOs by the book

by Mari Cruz García -

Hello Ken,

Sorry I couldn't get back to you because I have had to finish some priority task (the centOS server is for a new MSc we will launch next year, but I have to move it forward as much as I can before editors start putting content on it).

Thank you for your suggestions. I did work.

In reply to Mari Cruz García

Re: Installation in CenTOs by the book

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome!  Administering an internet server of any flavor for the first time is a learning curve.  Hang in there ... it DOES get easier with time and experience.  If you ever want to know how NOT to do something, contact me (I've finally learned how to learn from my past mistakes! :\)

Wise of you to attempt to get ahead of the content providers, but will warn that content providers might disclose other things that need tweaking (difficult to predict what those are).  Server administration and Moodle admin are a constant, sometimes daily, duty.

Since you have CentOS, suggest Google to be a friend, but use some caution ... not every solution applies to your system.  Know your versions: OS, Moodle, apache, php, and mysql.

Also suggest checking into Webmin: http://www.webmin.com/ for assisting in admin of server OS.

And ... time to study up on 'git'.  Installing and getting Moodle up and running is but tip of the ice burg with the current 'moodle march'.  Git will allow one to easily update Moodle ... it is getting better and easier, BTW.

'spirit of sharing', Ken