Archive for the ‘Drupal’ Category

The username admin has not been activated or is blocked in drupal

Wednesday, December 2nd, 2009

Error : The username admin has not been activated or is blocked.

Solution : If your user name “admin” is not active then you can face this problem so  you need to active admin user name  by using phpmyadmin.

1) Login to cpanel then click on the phpmyadmin and choose your database which you have used in installation.

2) Then click on the “users”  table and edit the the admin user name entry and change

status  0 to 1 and click on the GO button

Done

Drupal default .htaccess file

Thursday, November 19th, 2009

When you are facing some problem in drupal then you need to copy this default .htaccess file in document root.

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

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<Files ~ “(\.(inc|module|pl|sh|sql|theme|engine|xtmpl)|Entries|Repositories|Root|scripts|updates)$”>
Order deny,allow
Deny from all
</Files>

# 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 exist in sites/default/settings.php, but
# the following cannot be changed at runtime. The first IfModule is
# for Apache 1.3, the second for Apache 2.
<IfModule mod_php4.c>
php_value magic_quotes_gpc                0
php_value register_globals                0
php_value session.auto_start              0
</IfModule>

<IfModule sapi_apache2.c>
php_value magic_quotes_gpc                0
php_value register_globals                0
php_value session.auto_start              0
</IfModule>

# Reduce the time dynamically generated pages are cache-able.
<IfModule mod_expires.c>
ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on

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

# 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 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]
</IfModule>

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

Drupal Site with temporary URL

Sunday, November 8th, 2009

Question :  How to access Drupal Site with temporary URL(http://serverip/~username) ?

Answer : If you have installed drupal by using fantastico and if you want to access your drupal site with the tempoary URL like http://serveripaddress/~username  then follow the steps

1] Change the “$base_url = ” in /public_html/sites/default/settings.php to your temporary URL WITHOUT A TRAILING SLASH!!!!

for example:
$base_url = ‘http://192.168.0.2/~test’;

now the site should work, but on certain links on the site, the browser will error out with a bad redirect and the URL in the browser.

so to correct this…

2] Uncomment the “RewriteBase /”  line in /public_html/.htaccess and change it from:

#RewriteBase /
to
RewriteBase /~username

for example:
RewriteBase /~test

and now you should be able to set up and test the website you created in Drupal. Once you are finished and have tested everything successfully.

Done ….