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

Advertisements

Cleanup Firefox clogging by pruning it’s database

I have been running firefox for quite sometime now. And sometime it come down to it’s knees to make me frustrated . Yes I must confess that I have had a fatty extensions build into it…but still the performance sometime really down.

So I started to investigate what is the actual cause( might be one of the cause to it) . And after some search in the ocean of internet I found a better solution.

It is all about pruning the firefox own database,which is an sqlite one. Because due to huge bookmarks and thousand of page visits everyday make it cache lot of thing in it’s database. So it’s really important to once in every second day to get it pruned .

I wrote a small and very trivial script(got the inspiration from Mozillazine web site and their developers) to run it in specified time, either by hand or by cron.

Here is the script….one has to change the path of thir own profile, nothing else has to be done.I gave it a name: ff_databse_cleanup..you can give anything you want 🙂

1 #!/bin/bash
2 profile_dir=”/home/bhaskar/.mozilla/firefox/2zbbd86m.default”
3
4 echo ” Killing all running swiftfox instances for database clean up…”
5
6 pkill swiftfox-bin
7
8 echo ” … Done”
9
10 echo ” getting into the profile dir …”
11
12 cd $profile_dir
13
14 pwd
15
16 echo ” present size of the database is : “
17
18 du -shc $profile_dir/*.sqlite
19
20 echo ” Now running the cleanup….”
21
22 find $profile_dir/ \( -name “*.sqlite” \) -exec sqlite3 {} “vacuum” \;
23
24 echo ” Now the size of trimed database is :”
25
26 du -shc $profile_dir/*.sqlite
27
28 echo ” Kindly start firefox/swiftfox now …..performance will be much improved”

Now a bit of explanation of the script : what it does basically get into you profile dir i.e where firefox keeps it’s profile and run a sqlite3 vaccum command to prune the internal database.

If firefox is running it will kill all instances of it then acting upon it.I have had got significant improvement running this script every second or third day to make my browser up on it’s toes.

Hope this will help .


Bhaskar Chowdhury
Google Talk: unixbhaskar Skype: unixbhaskar Y! messenger: unixbhaskar
DiggLinkedinWordpressTwitterTechnoratiStumbleuponReddit

The firefox saga on openSUSE

Ahh what a pain!! I have been struggling to get firefox going on OpenSUSE for quite some time. The problem is that it(firefox) eats out 100% cpu and freeze it forever.So it hinders the productivity of mine heavily ,because I spent lot of time in the browser to do lot of day to day activity.At last I am able to figure out and solve the owes regarding that problem.

The Solution:

The first step I took discard firefox and start using “swiftfox“, which is specifically optimized to run on GNU/Linux and of course on specific processor!!!. You can have a look at it in the website http://www.getswiftfox.com.

Once it came up ,I create a new profile in it and install my fatty extension(around 57 of them) on it(all firefox extensions are compatible with it) one by one.You can find my extension for firefox in mozilla site by looking at this url : https://addons.mozilla.org/collection/unixbhaskar

Then I have created a small script to restrict the cpu usage of swiftfox by a specific limit with the help of a software called “cpulimit“,which can be found here : http://cpulimit.sourceforge.net/ . So the next step to call it when the swiftfox start. So here is small snippet of code will do that:

#!/bin/bash
2
3 if [[ `ps -ef | grep swiftfox-bin` ]]
4 then
5 echo “swiftfox is running.”
6 `/usr/local/bin/cpulimit -e swiftfox-bin -l 70`&
7 echo “limiting the cpu usage by 70%”
8
9 fi

So I have restricted swiftfox to 70% of cpu usage.So it will never utilise more then that cpu usage power.

Now it’s running fine on OpenSUSE11.1 with latest kernel-2.6.31.3 .

At last some respite 🙂

Bhaskar Chowdhury
Chat Google Talk: unixbhaskar Skype: unixbhaskar Y! messenger: unixbhaskar
Contact Me DiggLinkedinWordpressTwitterTechnoratiStumbleuponReddit