Tuesday, September 6, 2011

Multisite Drupal 6 Configuration


Use the following commands, here I have taken example of my system and "arvind" as a working directory.
1: cd /home/arvind/
2: mkdir drupal6
3: cd drupal6
4: mkdir logs
6: tar xvzf drupal-6.22.tar.gz
7: mv drupal-6.22.tar.gz htdocs
8: cd logs
9: cat > error.log
10: cat > access.log
11: pwd
ex:/home/arvindaithal/drupal6/htdocs
12: Go to cd /etc/apache2/sites-available
       Ex:arvindaithal@hoodota:/home$ cd /etc/apache2/sites-available/
       arvindaithal@hoodota:/etc/apache2/sites-available$ ls
              default  defaultbk  default-ssl
       arvindaithal@hoodota:vim default

    Make these changes.
<VirtualHost *:80>
        ServerAdmin webmaster@localhost

         DocumentRoot /home/arvindaithal/drupal6/htdocs/
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /home/arvindaithal/drupal6/htdocs/>
                 Options Indexes FollowSymLinks MultiViews
                 AllowOverride All
                 Order allow,deny
                 allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                 AllowOverride None
                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                     Order allow,deny
                     Allow from all
        </Directory>

         ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
         LogLevel warn

         CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Alias /test "/home/arvindaithal/drupal6/htdocs/"
Alias /testsite "/home/arvindaithal/drupal6/htdocs"
13: mkdir 127.0.0.1.test
14: cd ..
15: Change the rewrite base.
vim .htaccess
      ex:arvindaithal@hoodota:~/drupal6/htdocs$ vim .htaccess 
        Add this code(test refers your site name).
            RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/test/(.*)$
    RewriteRule ^(.*)$ /test/index.php?q=$1 [L,QSA]
16: sudo /etc/init.d/apache2 restart
17: 127.0.0.1/test/
18: Make writable settings.php and files.
19: Give database name and password and save.,
20: Copy settings.php and files in 121.0.0.1.testsite/
21: Save.
If you need further information please refer this link http://drupal.org/node/43816.

Monday, September 5, 2011

How to install Drupal in LAMP?


Steps:
1.Extract Drupal and place it in \var\www
         Go to terminal $ :~ wget http://ftp.drupal.org/files/projects/drupal-6.22.tar.gz
                                $:~ tar xvzf drupal-6.22.tar.gz
2.goto sites\default ,copy default.settings.php to settings.php
3.make one new folder called files in default
4.go to terminal : /var/www
5.cd Testsite
6.cd sites
7.chmod 777 settigns.php
8.chmod 777 files
9.Change the mysql user name and password in settings.php
10.Download the modules required.Extract it and place it in sites/all/modules
11.Downlaod the themes requires.Extract it and place it in sites/all/themes

How to add secure pages


Add module content Access.
Create a role for  ex:"site admin"
Create a user test
add content type page for site admin
create content ->page for site admin->test

step 1:Add the role
Step 2:Enable content access module
Step 3:Create a content type for "site admin".
Step 4:Access control and enable the permissions for admin,"site admin".
Step 5:Give the permissions in admin->usermanamgement->permissions
Step 6:Site building->themes->uncheck submitted by for "site admin" content type.(this is not mandatory)
Step 7:Create a view for secure area
Step 8:Check Node Post Date: desc
Step 9:Check Node Published: Yes
Step 10:Check Node type: secure area for site admin
Step 11:Give either the access restriction: roles or in sitebuilding-> blocks ->configure the securearea siteadmin block and give role specification site admin and save.
Step 12:Place this block wherever required.

How to change the Server password?


How to change the Server password?

Login to the server database,check the particular database and write a query

update users set pass=md5('new_password') where uid = 1 ;