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).

You must also configure the database server by rerunning the prior command with the  option.

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. You might also want to check out PHP_TARGETS

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 to actually install the files for the webserver:

This command installs Drupal in the "drupal" subdirectory of the default vhost. You may change "localhost" to the hostname of another virtual host/website.

You can use webapp-config to install multiple Drupal sites (based on the same Gentoo package that you just emerged).

Configure a database
You need to create a database, a database user and give that user the correct permissions on the database tables. The needed SQL code depends on the Drupal version you installed and the database server you selected.

Hence, read the "Create the database" section of the "Installing Drupal" documentation (on drupal.org) - for Drupal 8 or Drupal 7. You should read the subsection about (SQL) commands / the command line.

Configure Drupal
The normal way to configure (or install) Drupal, is to visit your website in a browser and follow the instructions. Go to

http://localhost/drupal/

which will redirect you to the Drupal installer. (You can configure Drupal from the command line using Drush if you prefer.)

Read the Drupal documentation for help and tips - for Drupal 8 or Drupal 7.