Steps to install LAMP + Drupal on OLPC with Yum

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

First, I thought about the order of operations, and what would make sense to try out first. It's important to keep in mind this is just a first iteration. You may want to replace the Apache with Lighttpd, the MySQL with another database, etc.

If you are interested in using lighttpd, and some start/stop scripts, you may want to check out another Drupal on OLPC HOWTO over on the OLPC wiki.

But, the following process was very quick as an experiment. Since I'd be hopeless if Apache didn't work, that's where I started. I then installed PHP and got the two talking. Then I installed MySQL and connected MySQL and Apache with PHP. Here are the basic steps.

YUM. The OLPC comes with Yum, a package manager, which makes installing the binaries for the AMP stack pretty easy.

Install the web server applications. You need to be connected to the internet for this:

yum install apache php mysql mysql-server php-mysql

In this installation process, I ran into a couple out of memory errors while installing. You can try a few things to avoid these. I just installed each separately, like:

yum install apache

Also even with installing each separately, the PHP install in particular gave me memory errors. I shut down the other applications I had running on the OLPC, and then installed php again, and on the third try, it worked fine.

The web root on the OLPC is:

/var/www/html

I wanted to give the OLPC a nice localhost URL, so I went to /etc/hosts and added the line:

127.0.0.1 lilds.dev

Now we can get to the web server root at http://lilds.dev (or http://localhost).

This will not work until you start Apache:

/etc/init.d/httpd start

Then, you can make a test file in /var/www/html/ with a call to phpinfo(); to see your setup. You will want to make sure this is not owned by root so the web server can execute it.:

<?php
echo phpinfo();
?>

One hold up in the installation process was a missing sym link to the libmysqlclient.so.15 shared object file. You will need to make sure there is a symlink in /usr/lib that points libmysqlclient.so.15 to /usr/lib/mysql/libmysqlclient.so.15.0.0. If the sym link was not made with your installation, you can just do:

ln -s /usr/lib/mysql/libmysqlclient.so.15.0.0 /usr/lib/libmysqlclient.so.15

You'll then want to start MySQL and make a database and a user. You can start mysql like:

/sbin/service mysqld start

I noticed that after shutting the OLPC down and turning it back on, mysql was unable to run. For some reason the directory where it stores its pid was missing. I had to recreate this after starting up the LAMP stack a second time and still need to look into why this happened. One idea is that it's a user/permission issue. But if mysql cannot start there's a chance it's related to this missing directory. Just do:

mkdir /var/run/mysqld

I had a similar issue with Apache, where it's directory and log file were wiped out. You can recreate that if needed:

mkdir /var/log/httpd<br />touch /var/log/httpd/error_log

After you get MySQL running, you can make the database for Drupal and a user. Then just download Drupal from Drupal.org and follow the instructions for installation. There's a chance I may have missed a step, so I will update this page when I get a chance to run through the steps again on a new OLPC.