Drupal: Difference between revisions
(New page: yum install mysql mysql-server lighttpd lighttpd-fastcgi php php-mysql php-gd lynx) |
No edit summary |
||
(15 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
== Drupal-OLPC community == |
|||
yum install mysql mysql-server lighttpd lighttpd-fastcgi php php-mysql php-gd lynx |
|||
There is a community of Drupal hackers who are deeply interested in the OLPC project and doing some fantastic work at the intersection of the two. See http://groups.drupal.org/drupal-olpc for more. |
|||
== Why do this? == |
|||
Well, here are 3 reasons: |
|||
* The XO is cool |
|||
* Drupal is cool |
|||
* XO + Drupal = righteous! |
|||
More seriously, this could let a community of XOers write books, blog, vote, arrange events and store/list structured content and do all the great community centric things that Drupal allows. |
|||
This HOWTO uses Lighttpd instead of Apache, because it is much more lightweight. I considered using SQLite instead of MySQL, but after testing found that MySQL was perfectly fast enough (and makes using contributed modules much easier). Having said that, you wouldn't want to use this for serving more than a handful of clients on a regular XO! |
|||
If you are interested in joining other people interested in Drupal on XOs there is a group at http://groups.drupal.org/drupal-olpc |
|||
<strong><em>A fourth reason?</em></strong>: See the Discussion tab on this page for a possible application of Drupal wizardry in actual XO classrooms... [[Talk:Drupal]] |
|||
== 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 == |
|||
Start MySQL: |
|||
/sbin/service mysqld start |
|||
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 |
|||
Edit the configuration file: |
|||
nano 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 want to use Drupal (this will save some memory, so your system will run faster the rest of the time). But it is easy to adapt this to autostart if you want. |
|||
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 user's 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 |
|||
touch /var/log/lighttpd/error.log /var/log/lighttpd/access.log |
|||
chown -R 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. |
|||
After a reboot, when you want to use Drupal just type: |
|||
su -c /root/start-web.sh |
|||
== 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: |
|||
* Create the database: http://drupal.org/getting-started/5/install/create-database/mysql |
|||
* Run the installation script: http://drupal.org/getting-started/5/install/run-script |
|||
* Configure your site: http://drupal.org/getting-started/5/install/configure |
|||
* Set up cron: http://drupal.org/getting-started/5/install/cron |
|||
And you are all set - congratulations! |
|||
== Reduce Drupal Memory Usage == |
|||
This replacement for some of Drupal's core code can help reduce Drupal's memory footprint: http://wtanaka.com/drupal/system |
Latest revision as of 12:33, 8 March 2009
Drupal-OLPC community
There is a community of Drupal hackers who are deeply interested in the OLPC project and doing some fantastic work at the intersection of the two. See http://groups.drupal.org/drupal-olpc for more.
Why do this?
Well, here are 3 reasons:
* The XO is cool * Drupal is cool * XO + Drupal = righteous!
More seriously, this could let a community of XOers write books, blog, vote, arrange events and store/list structured content and do all the great community centric things that Drupal allows.
This HOWTO uses Lighttpd instead of Apache, because it is much more lightweight. I considered using SQLite instead of MySQL, but after testing found that MySQL was perfectly fast enough (and makes using contributed modules much easier). Having said that, you wouldn't want to use this for serving more than a handful of clients on a regular XO!
If you are interested in joining other people interested in Drupal on XOs there is a group at http://groups.drupal.org/drupal-olpc
A fourth reason?: See the Discussion tab on this page for a possible application of Drupal wizardry in actual XO classrooms... Talk:Drupal
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
Start MySQL:
/sbin/service mysqld start
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
Edit the configuration file:
nano 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 want to use Drupal (this will save some memory, so your system will run faster the rest of the time). But it is easy to adapt this to autostart if you want.
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 user's 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 touch /var/log/lighttpd/error.log /var/log/lighttpd/access.log chown -R 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.
After a reboot, when you want to use Drupal just type:
su -c /root/start-web.sh
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:
- Create the database: http://drupal.org/getting-started/5/install/create-database/mysql
- Run the installation script: http://drupal.org/getting-started/5/install/run-script
- Configure your site: http://drupal.org/getting-started/5/install/configure
- Set up cron: http://drupal.org/getting-started/5/install/cron
And you are all set - congratulations!
Reduce Drupal Memory Usage
This replacement for some of Drupal's core code can help reduce Drupal's memory footprint: http://wtanaka.com/drupal/system