Thursday, November 27, 2008

To enable clean url in drupal - Ubuntu

To enable clean url in drupal just follow these steps

1. To enable apache module "mod_rewrite"
$sudo a2enmod rewrite

2. To make the apache server to accept .htaccess file
$sudo vim /etc/apache2/sites-enabled/000-default

Under "Directory" section change the "AllowOverride none" to "AllowOverride all".


...
AllowOverride all
...



3. Create a text file name .htaccess in your document root and paste these te

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.

Order deny,allow
Deny from all


# Set some options.
Options -Indexes
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0


# PHP 4, Apache 2

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0


# PHP 5, Apache 1 and 2

php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0


# Reduce the time dynamically generated pages are cache-able.

ExpiresByType text/html A1


# Various rewrite rules.

RewriteEngine on

# If your site can be accessed both with and without the prefix www.
# you can use one of the following settings to force user to use only one option:
#
# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule .* http://www.example.com/ [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
# RewriteRule .* http://example.com/ [L,R=301]


# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /

# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]

# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]

# Rewrite rules for static page caching provided by the Boost module
# BOOST START

AddCharset utf-8 .html

RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{REQUEST_URI} !^/user/login
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{HTTP_COOKIE} !DRUPAL_UID
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI} -d
RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}/index.html -f
RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1/index.html [L]
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{REQUEST_URI} !^/user/login
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{HTTP_COOKIE} !DRUPAL_UID
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}/0/%{REQUEST_URI}.html -f
RewriteRule ^(.*)$ cache/%{SERVER_NAME}/0/$1.html [L]
# BOOST END

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


# $Id: boosted.txt,v 1.4 2006/12/05 10:39:19 arto Exp $

Modify "RewriteBase /" in line 68 to "RewriteBase /example" if your site is in subdirectory "example."

http://drupal.org/node/121834 To know more about it.

4. Restart your apache server.
$sudo /etc/init.d/apache2 restart

Thats all your site will rock now :D.




Tuesday, November 25, 2008

MySQLTuner - Need For Speed

want to speed up your database server ? then you need to try MySQLTuner.
Its a perl script will assist you in configuring the MySQL settings it has been programmed to display the statistics about your MySQL installation and the variable to altered to obtain better performance.

To Download the MySQLTuner

# wget -c http://mysqltuner.com/mysqltuner.pl

# chmod +x mysqltuner.pl

# ./mysqltuner.pl


To know more about MySQLTuner

wiki o O ---> http://wiki.mysqltuner.com/MySQLTuner

Perl script o O --> http://mysqltuner.com/mysqltuner.pl

http://www.debianadmin.com/check-your-mysql-server-performance-with-mysqltuner.html

Tuesday, November 11, 2008

Must Read This

Top 50 amazing ubuntu time saving tips

http://www.techradar.com/news/software/operating-systems/50-amazing-ubuntu-time-saving-tips-482714

Friday, November 07, 2008

Nokia PC Suite for Linux

Nokia PC Suite equivalent tool for Linux

http://www.smokinglinux.com/tutorials/nokia-pc-suite-for-linux-with-obextool-on-ubuntu-gutsy

Monday, November 03, 2008

GNOME ALSA Mixer - to get better sound effect in ubuntu

Are you looking for better sound effect, increased volume then you are at the right place.

Gnome Alsa Mixer a "volume control" application works cool. To know more about Gnome Alsa mixer

http://packages.ubuntu.com/intrepid/sound/gnome-alsamixer

To install alsa mixer, yup do apt-get

$sudo apt-get install gnome-alsamixer

Saturday, November 01, 2008

ubuntu 8.10 freezes at start up

I installed Ubuntu 8.10 (intrepid) on my desktop today (1/11/08), but i was not able to login because my system freezes after login screen nothing works at this point including "alt+ctrl+del" key. After searching on ubuntu forum i came to know that this problem is because of "compiz and compiz-core" packages.

To remove these packages i followed these steps

1. Press Esc at boot time i.e at grub menu
2. Select Ubuntu 8.10 rescue mode option
3. Now you can find a menu with a list of option, there select "root shell prompt" (I think net access will be unavailable at this point )
4. Now remove the package compiz and compiz-core using apt-get
#apt-get remove compiz compiz-core
5. Then reboot your system


but this procedure didnt work for me. I tried my own trick yup using Live CD

1. Boot from Ubuntu live cd
2. Mount your interpid partiton and take a backup of your interpid xorg.conf
$ sudo cp /media/disk/etc/X11/xorg.conf /media/disk/etc/X11/xorg.conf.backup
[In my case it was /media/disk please change it as per your mount point]
3. Copy the live cd xorg.conf file to interpid xorg.conf
$sudo cp /etc/X11/xorg.conf /media/disk/etc/X11/xorg.conf
4.Now reboot your system.

Now you may be able to login with some warning messages.

If you don't want to receive any warning messages at start up do copy the content xorg.conf.failsafe to xorg.conf

$sudo cp /etc/X11/xorg.conf.failsafe /etc/X11/xorg.conf


I followed this trick now ubuntu 8.10 is working fine for me.

Also you can try this, add a line * Driver "vesa" * in xorg.conf under Device section

Section "Device"
Identifier "Configured Video Device"
Driver "vesa"
EndSection