Drupal: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (User:Grugnog moved to Drupal)
No edit summary
Line 46: Line 46:
== Service Startup ==
== Service Startup ==


It is recommended that you start the services manually when you (or your friends!) want to use Drupal, but it would be easy to adapt this to autostart if you want. This will save some memory, so your system will run faster the rest of the time.
Start the 2 services manually and check for any errors:

Note: the /var filesystem appears to not persist over reboots (perhaps it is ROM based - there may be a way round this, I haven't found one yet), and so we need to recreate and reown the appropriate directories for these services to start.

Go to the root users home directory:
cd /root

Start editing a new file:
nano start-web.sh

Type the following:
#!/bin/sh
mkdir /var/run/lighttpd /var/log/lighttpd
chown lighttpd:lighttpd /var/run/lighttpd /var/log/lighttpd
mkdir /var/run/mysqld
chown mysql:mysql /var/run/mysqld
/etc/init.d/lighttpd start
/etc/init.d/lighttpd start
/etc/init.d/mysqld start
/etc/init.d/mysqld start


Make the script executable, and run it to check everything starts up OK:
If you only plan on using Drupal occasionally you can simply put those 2 commands in a shell script (e.g. ''/root/start-web.sh'') and run it as needed. This will save some memory, so your system will run faster the rest of the time.
chmod u+x start-web.sh

./start-web.sh
Alternatively you can start these services on boot automatically by running:
/sbin/chkconfig --levels 235 lighttpd on
/sbin/chkconfig --levels 235 mysqld on


When you are done, start the 'Browse' activity, and go to the URL 'localhost' - you should see the lighttpd placeholder page.
When you are done, start the 'Browse' activity, and go to the URL 'localhost' - you should see the lighttpd placeholder page.

Revision as of 05:04, 7 January 2008

Installing software

Start the 'Terminal' activity (on the far right of the menu bar).

Get root access:

su

You should now see a prompt that looks like:

bash-3.2#

Install the various tools we will need:

yum install mysql mysql-server lighttpd lighttpd-fastcgi php php-mysql php-gd

Basic Configuration

Give MySQL a root password:

mysqladmin -u root password YOUR-ROOT-MYSQL-PASSWORD

Go to the /etc directory:

cd /etc/

Edit the php.ini file (with your favorite editor):

nano php.ini

Add the following line to the very bottom of the file:

cgi.fix_pathinfo = 1

Edit the lighttpd configuration file and enable FastCGI:

nano lighttpd/lighttpd.conf
  • Uncomment "mod_fastcgi" line, in the server.modules section
  • Uncomment the fastcgi.server section (all ~8 lines of it)

XO Friendly MySQL Configuration

Copy in the low memory configuration template:

cp /usr/share/mysql/my-small.cnf /etc/my.cnf

Uncomment the following lines:

skip-networking
skip-bdb

In the section [mysqld] add the line:

skip-innodb

Service Startup

It is recommended that you start the services manually when you (or your friends!) want to use Drupal, but it would be easy to adapt this to autostart if you want. This will save some memory, so your system will run faster the rest of the time.

Note: the /var filesystem appears to not persist over reboots (perhaps it is ROM based - there may be a way round this, I haven't found one yet), and so we need to recreate and reown the appropriate directories for these services to start.

Go to the root users home directory:

cd /root

Start editing a new file:

nano start-web.sh

Type the following:

#!/bin/sh
mkdir /var/run/lighttpd /var/log/lighttpd
chown lighttpd:lighttpd /var/run/lighttpd /var/log/lighttpd
mkdir /var/run/mysqld
chown mysql:mysql /var/run/mysqld
/etc/init.d/lighttpd start
/etc/init.d/mysqld start

Make the script executable, and run it to check everything starts up OK:

chmod u+x start-web.sh
./start-web.sh

When you are done, start the 'Browse' activity, and go to the URL 'localhost' - you should see the lighttpd placeholder page.

Install Drupal

Switch back to the Terminal activity, and change to the web root directory:

cd /srv/www/lighttpd/

Clean it up, and change ownership:

pwd
rm *
chown olpc:olpc .

Switch back to our regular (non-root) user, and go to our home directory:

exit
cd ~

Download and extract Drupal (replace x.x with the latest Drupal stable version, currently 5.5):

wget http://drupal.org/files/projects/drupal-x.x.tar.gz
tar -zxvf drupal-x.x.tar.gz

Move the contents of the drupal-x-x directory into the webroot:

mv drupal-x.x/* drupal-x.x/.htaccess /srv/www/lighttpd/

Change to the web root directory, create a files directory (for uploads) and adjust permissions on this and the settings.php file:

cd /srv/www/lighttpd/
mkdir files
chmod a+w files
chmod a+w sites/default/settings.php

Follow the regular Drupal installation process:

And you are all set - congratulations!