Tuesday, September 21, 2010

P2PU: Drupal Introduction #1

I’ve started two drupal courses through P2PU and want to keep my work on each separated.

To achieve this I need:

  • Two separate drupal folders
  • Two separate drupal databases
  • Two separate virtual sites for apache

I made the first site “drupalintro” in the same manner as outlined in my earlier post P2PU: Drupal Social Web Application #1 with the following changes.

  1. The drupal directory was named /var/www/drupalintro
  2. $ mysqladmin –u root –p create drupalintro
  3. mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON drupalintro.* TO ‘<drupaluser>’@’localhost’ IDENTIFIED BY ‘<drupalpass>’;
  4. mysql> FLUSH PRIVILEGES;
  5. mysql> \q
  6. $ vim /var/www/drupalintro/sites/default/settings.php
  7. edit:  $db_url = ‘mysql://<drupaluser>:<drupalpass>@localhost/drupalintro’;
  8. $ cp /etc/apache2/sites-available/default /etc/apache2/sites-available/drupalintro
  9. $ vim /etc/apache2/sites-available/drupalintro
  10. edit: DocumentRoot /var/www/drupalintro
  11. edit: Directory /var/www/drupalintro

Now to make the second site called “openhippel” I did the same again with the following changes:

  1. The drupal directory was named /var/www/openhippel
  2. $ mysqladmin –u root –p create openhippel
  3. mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON openhippel.* TO ‘<drupaluser>’@’localhost’ IDENTIFIED BY ‘<drupalpass>’;
  4. mysql> FLUSH PRIVILEGES;
  5. mysql> \q
  6. $ vim /var/www/openhippel/sites/default/settings.php
  7. edit:  $db_url = ‘mysql://<drupaluser>:<drupalpass>@localhost/openhippel;
  8. $ cp /etc/apache2/sites-available/default /etc/apache2/sites-available/openhippel
  9. $ vim /etc/apache2/sites-available/openhippel
  10. edit: DocumentRoot /var/www/openhippel
  11. edit: Directory /var/www/openhippel

Now to change between the two virtual sites I simply use the following (shown for selecting drupalintro)

  1. $ sudo a2dissite openhippel && sudo a2ensite drupalintro
  2. $ sudo /etc/init.d/apache2 reload

Then I can browse to my localhost address and see the home page for the desired site.

3 comments:

  1. The difference between the right word and the almost right word is more than just a fine line! it's like the difference between a lightning bug and the lightning!
    we buy houses cash

    ReplyDelete
  2. I enjoyed reading your nice blog. I see you offer priceless info. Stumbled into this blog by chance but I'm sure glad I clicked on that link. You definitely answered all the questions I've been dying to answer for some time now. Will definitely come back for more of this.
    skinny fiber

    ReplyDelete
  3. To tell you the teuth I was passing around and come across your site. It is wonderful. I mean as a content and design. I added you to my list and decided to spent the rest of the weekend browsing. Well done!
    houses in san antonio

    ReplyDelete