Drupal

Drupal is a powerful PHP content management system (CMS).

Preinstall
The Drupal package installs everything you need except a database server. However, some configuration is best done before installing. And some packages might be used for more things than Drupal and hence should be installed separately.

USE flags
If you plan to use the default webserver, Apache 2, edit and add "apache2" to your USE flags.

Then add the needed USE flags for PHP. Edit and add "gd mysql mysqli pdo" to the PHP specific USE flags.

If you plan to use PostgreSQL instead of the default MySQL / MariaDB, add "postgres.

Packages
You must install a database server unless you are planning to use an already existing (remote) server. Use MariaDB (or MySQL

If you plan to use a webserver for other things than Drupal, install it separately.

if you want to use Apache.

If you need PHP for other web applications, install it separately too.

PS! To enable PHP in Apache, edit and add to your  line.

Controlling your LAMP stack
Start up your LAMP stack

Set the LAMP stack to start upon boot

If you use systemd, modify the commands above.

Unmask
At the time of writing, is masked as experimental only. If you run a "stable" system, you'll have to add it to your.

Emerge
Now we can get on with emerging:

You will have to run webapp-config manually.

you may change localhost to the hostname of your virtual host/website.

Web Install
if you are using apache 2.4 or newer run this sed command once.

point your browser to http://localhost/drupal/install.php

Maintenance Mode Access
If you suddenly find your self locked out of your drupal cms because it is in maintenence mode:

http://localhost/drupal/user

Cron
Many Drupal modules have periodic tasks that must be triggered by a cron job. To activate these tasks, you must call the cron page. This will pass control to the modules and the modules will decide if and what they must do.

The following example crontab line will activate the cron script on the hour (you can edit the crontab with crontab -e:

0 * * * * wget -O - -q http://localhost/drupal/cron.php

Note: If anyone is having problem with cron job settings, using online cron job like https://www.easycron.com as an alternative is a good idea.

Installing Drupal modules
Installing and configuring modules for Drupal is a lot of fun. You can browse the list at http://drupal.org/project/Modules. Untar the packages to drupal/modules but remember, you have to update the database manually for most modules! Installation instructions come with the tar package.

For example, if you want to install the Daily module, and your user for mysql is drupal: