Installing Drupal in Gentoo

So,I have stumbled over a page here ,which basically suggest that the installation was problematic. So I decided to plunge into it to have a crack on it.

My Gentoo system has prohibit me too..here are the interaction with my system:

bhaskar@GentooLinux_13:41:15_Thu Feb 09:~> sudo emerge -av drupal

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "drupal" have been masked.
!!! One of the following masked packages is required to complete your request:
dev-lang/php pdo gd mysql mysqli xml
- www-apps/drupal-7.12::gentoo (masked by: ~x86 keyword)
- www-apps/drupal-7.10::gentoo (masked by: ~x86 keyword)
- www-apps/drupal-6.24::gentoo (masked by: ~x86 keyword)
- www-apps/drupal-6.22::gentoo (masked by: ~x86 keyword)
- www-apps/drupal-5.23::gentoo (masked by: ~x86 keyword)

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.


bhaskar@GentooLinux_13:41:39_Thu Feb 09:~> sudo vim /etc/portage/package.keywords/druapl.keywords


bhaskar@GentooLinux_13:44:54_Thu Feb 09:~> sudo emerge -av drupal

These are the packages that would be merged, in order:
dev-lang/php pdo gd mysql mysqli xml apache2

Calculating dependencies... done!

emerge: there are no ebuilds built with USE flags to satisfy "dev-lang/php[pdo,postgres?,sqlite?,xml]".
!!! One of the following packages is required to complete your request:
- dev-lang/php-5.3.9::gentoo (Change USE: +pdo)
(dependency required by "www-apps/drupal-7.12" [ebuild])
(dependency required by "drupal" [argument])


bhaskar@GentooLinux_14:02:29_Thu Feb 09:~> sudo vim /etc/portage/package.use/php.use


bhaskar@GentooLinux_14:04:01_Thu Feb 09:~> sudo emerge -av drupal

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no ebuilds built with USE flags to satisfy "=dev-lang/php-5.3*[apache2]".
!!! One of the following packages is required to complete your request:
- dev-lang/php-5.3.9::gentoo (Change USE: +apache2)
(dependency required by "virtual/httpd-php-5.3" [ebuild])
(dependency required by "www-apps/drupal-7.12" [ebuild])
(dependency required by "drupal" [argument])


bhaskar@GentooLinux_14:04:27_Thu Feb 09:~> sudo emerge -av drupal

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] dev-libs/oniguruma-5.9.2 528 kB
[ebuild N ] app-admin/webapp-config-1.50.16-r1 102 kB
[ebuild N ] dev-libs/libmcrypt-2.5.8-r2 1,304 kB
[ebuild N ] app-admin/eselect-php-0.6.2 2 kB
[ebuild N ] media-libs/t1lib-5.1.2 USE="X -doc -static-libs" 1,829 kB
[ebuild N ] virtual/httpd-cgi-0 0 kB
[ebuild N ] app-text/aspell-0.60.6.1 USE="nls" LINGUAS="-af -be -bg -br -ca -cs -cy -da -de -el -en -eo -es -et -fi -fo -fr -ga -gl -he -hr -is -it -la -lt -nl -no -pl -pt -pt_BR -ro -ru -sk -sl -sr -sv -uk -vi" 1,835 kB
[ebuild N ] app-dicts/aspell-en-6.0.0 179 kB
[ebuild N ] dev-lang/php-5.3.9 USE="apache2 berkdb bzip2 cli crypt ctype exif fileinfo filter gd gdbm hash iconv ipv6 json ldap mysql mysqli nls pdo phar posix readline session simplexml spell ssl tokenizer truetype unicode xml zlib -bcmath -calendar -cdb -cgi -cjk -curl -curlwrappers -debug -doc -embed -enchant -firebird -flatfile -fpm -frontbase -ftp -gmp -imap -inifile -intl -iodbc -kerberos -kolab -ldap-sasl -libedit -mhash -mssql -mysqlnd -oci8-instant-client -odbc -pcntl -pic -postgres -qdbm -recode -sharedmem -snmp -soap -sockets -sqlite -sqlite3 -suhosin -sybase-ct -sysvipc -threads -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -zip" 11,438 kB
[ebuild N ] virtual/httpd-php-5.3 0 kB
[ebuild N ~] www-apps/drupal-7.12 USE="mysql -postgres -sqlite -vhosts" 3,017 kB

Total: 11 packages (11 new), Size of downloads: 20,229 kB

Would you like to merge these packages? [Yes/No] y

On the process to get it into my system I have added it keywords file and made some flags to add with the php .

First I have added a file drupal.keywords in /etc/portage/package.keywords and the content of the file look like this :


www-apps/drupal ~x86
~

Then, I have added another file as php.use in /etc/portage/package.use and the content of the file is like this :


dev-lang/php pdo gd mysql mysqli xml apache2

Look at the flags I have added to emerge php to integrate with others.Then I started to emerge the drupal.

Once the emerge complete; it look like below:

* Messages for package dev-lang/php-5.3.9:

* Installing php.ini for cli into /etc/php/cli-php5.3
*
* Installing php.ini for apache2 into /etc/php/apache2-php5.3
*
* Make sure that PHP_TARGETS in /etc/make.conf includes php5-3 in order
* to compile extensions for the 5.3 ABI
*
*
* This ebuild installed a version of php.ini based on php.ini-development version.
* You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either
* 'production' or 'development' in /etc/make.conf
* Both versions of php.ini can be found in /usr/share/doc/php-5.3.9
*
* For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:
* http://www.gentoo.org/proj/en/php/php-upgrading.xml
*

* Messages for package www-apps/drupal-7.12:

* (server owned) htdocs/files
* (server owned) htdocs/sites/default
* (server owned) htdocs/sites/default/settings.php
* (config) htdocs/sites/default/settings.php
* (config) htdocs/.htaccess
* (info) /usr/portage/www-apps/drupal/files/postinstall-en.txt (lang: en)
*
* SECURITY NOTICE
* If you plan on using SSL on your Drupal site, please consult the postinstall information:
* # webapp-config --show-postinst drupal 7.12
*
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

* Regenerating GNU info directory index...
* Processed 135 info files.

Now we need put the required thing right place like below is way to do it:

bhaskar@GentooLinux_14:52:16_Thu Feb 09:~> sudo webapp-config -I -h GentooLinux.localdomain drupal 7.12
*
* You may be installing into the website's root directory.
* Is this what you meant to do?
*
* Creating required directories
* Linking in required files
* This can take several minutes for larger apps
* Files and directories installed

=================================================================
POST-INSTALL INSTRUCTIONS
=================================================================

You will need to provide a database for your drupal installation.

This assumes you have some knowledge of MySQL, and already have it
installed and configured. If not, please refer to the Gentoo MySQL
guide at the following URL:

http://www.gentoo.org/doc/en/mysql-howto.xml

Once you have a database ready all you need to do is to go to this
location

http://GentooLinux.localdomain//

and provide the credential required for the database access.

SECURITY NOTICE: If you use SSL on your Drupal installation, you
should enable the PHP configuration option 'session.cookie-secure'
to make it harder for attackers to sniff session cookies.

References:
CVE-2008-3661
http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-secure
http://drupal.org/node/315703

After that you can start to use drupal.

=================================================================

* Install completed - success

So, what left? the database..lets do it:


bhaskar@GentooLinux_15:05:43_Thu Feb 09:~> sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61-log Gentoo Linux mysql-5.1.61

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.02 sec)

mysql> create database drupal;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| drupal |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> INSERT INTO user (host, user, password, select_priv, insert_priv, update_priv) VALUES ('GentooLinux', 'drupal', PASSWORD('drupal'), 'Y', 'Y', 'Y');
Query OK, 1 row affected, 3 warnings (0.00 sec)

mysql> use drupal;
Database changed
mysql>
mysql> GRANT ALL PRIVILEGES ON drupal.* TO drupal@'%' IDENTIFIED BY 'drupal';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH privileges;
Query OK, 0 rows affected (0.00 sec)

We are almost there!! let’s get into the browser for installation:

Now let’s get into the CMS:

Installing Drupal shell a.k.a drush

bhaskar@GentooLinux_20:30:51_Thu Feb 09:~> sudo emerge -av drush
Password:

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "drush" have been masked.
!!! One of the following masked packages is required to complete your request:
- app-admin/drush-4.4::gentoo (masked by: ~x86 keyword)

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

Hmmm.. problem..let add the keyword file into the system:

bhaskar@GentooLinux_20:31:04_Thu Feb 09:~> sudo vim /etc/portage/package.keywords/drush.keywords

and the content is this :

app-admin/drush ~x86

Let’s try to merge it into the system:


bhaskar@GentooLinux_20:35:49_Thu Feb 09:~> sudo emerge -av drush

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild N ] dev-php/PEAR-PEAR-1.9.3 289 kB
[ebuild N ] dev-php/PEAR-Structures_Graph-1.0.4 30 kB
[ebuild N ] dev-php/PEAR-Console_Getopt-1.3.1 5 kB
[ebuild N ] dev-php/PEAR-Archive_Tar-1.3.7 18 kB
[ebuild N ] dev-php/PEAR-XML_Util-1.2.1-r2 18 kB
[ebuild N ] dev-php/pear-1.9.3 0 kB
[ebuild N ~] app-admin/drush-4.4 USE="-examples" 248 kB

Total: 7 packages (7 new), Size of downloads: 605 kB

Would you like to merge these packages? [Yes/No] yes

So it installed in the system:

bhaskar@GentooLinux_20:39:15_Thu Feb 09:~> whereis drush
drush: /usr/bin/drush /usr/share/drush

For using drush from the command line look here for my earlier post about it.

Hope this will help.

Cheers!
Bhaskar

About unixbhaskar
GNU/Linux Consultant

One Response to Installing Drupal in Gentoo

  1. Good day! I could have sworn I’ve been to this site before but after reading through some of the post I realized it’s new to me.

    Anyhow, I’m definitely happy I found it and I’ll be
    book-marking and checking back often!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: