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.

No comments:

Post a Comment