Installation of an Additional Drupal Site after Base Install

Drupal Site Installation

This will assume that the main Drupal install has already been created and is in /var/www/html/sp06/.  [where sp06 is the folder for the current semester]

Omit {} in the following instructions.

Commands to know

  • cd {folder name}
    use this to move from one directory to a sub directory (e.g., "cd sp06/" or "cd sp06/sites"); do not precede with a "/"
  • cd ..
    use to to move up to the parent directory
  • cd {path name}
    use this to move directly to a location; requires full path preceded by "/" (e.g. "/var/www/html/sp06/sites")
  • ls
    use this for a directory listing
  • ls -al
    use this for a verbose directly listing that includes permissions information and hidden files
  • rm -rf {folder name}
    use this to remove a folder that has been inadvertently created in the wrong directory/folder

Create the new db

  1. Open up phpmyadmin
  2. Login using your mysql database username and password.
  3. Verify that the database name, {new db}, that you have chosen does not already exist using the pull down menu in the left column.
  4. If not, return to the home phpmyadmin page (use the Home link in the left column near the top).
  5. Enter {new db} in the create new database text field. [new db is the name of the particular Drupal installation for the user, e.g., blakesley5]
  6. Login to joe.english.purdue.edu using Putty.
  7. Go to /var/www/html/sp06/database/
  8. Execute mysql command using the mysql username in the command: mysql -u {username} -p {new db} < drupaled_4.3.6.1.sql   (Put the mysql username where indicated. The system will prompt you for the mysql password)
  9. Verify using phpmyadmin that your db was populated with tables
    1. Go to Home where you previously created the db.
    2. Refresh your browser.
    3. Select your {new db} from the pull down menu

Setup individual site

  1. Using putty, go to /var/www/html/sp06/sites/
  2. Create a new folder: mkdir joe.english.purdue.edu.sp06.{new db}
  3. Go to /var/www/html/sp06/sites/default
  4. Copy contents to new folder just created: cp -rf * ../joe.english.purdue.edu.sp06.{new db}
  5. Open up SSH file transfer client.
  6. Download /var/www/html/sp06/sites/joe.english.purdue.edu.sp06.{new db}/settings.php
  7. Use a text editor such as Notepad or Dreamweaver
  8. In $db_url, replace drupaled_database with {new db}
  9. In $base_url, amend the url to read: http://joe.english.purdue.edu/sp06/{new db} (this step is not necessary for newer Drupal installations where the base_url variable does not exist)
  10. Upload the now changed settings.php file back to the server
  11. Using Putty, go to /var/www/html/sp06/sites/joe.english.purdue.edu.sp06.{new db}/
  12. Change permissions on files folder: chmod -R 777 files
  13. Using Putty, go to /var/www/html/sp06/
  14. Create the symbolic link: ln -s . {new db}
    Note: spaces are important here within the command. There are spaces on both sides of the period.
  15. Using the browser, visit your new site at http://joe.english.purdue.edu/sp06/{new db}
  16. Login as admin:english. Go to administer/settings.
  17. Change File system path to: sites/joe.english.purdue.edu.sp06.{new db}/files
  18. Save changes. If it worked, you should get no error.

Setup cron

  1. Using SSH file transfer client, download /root/batch/drupal_crons.sh.
  2. Edit using a text editor (e.g. Notepad or VI or Dreamweaver).
  3. Reload the file.

Updated: 12-12-05-- CL > DB
Updated 5-26-08--JT

Comments

David Blakesley's picture

Here are some additional notes (from Jeremy), just for the record:

We use multisite installations (so for example we have one Spring '08 Drupal installation that encompasses about 70 sites), but each site has its own database in our MySQL installation. We don't recommend using one database for multiple sites, because if anything goes wrong on any of the sites and the database gets corrupted, it becomes a problem for all the sites. If each site has its own database, any corruption in one database won't affect the other sites.

The instructions contained in the link are correct, although the base_url variable isn't in Drupal anymore (I made an edit about this on the page). Additionally, creating the first Drupal site in an installation can be slightly tricky, because newer Drupal versions try to force you to use their auto setup features instead of manually creating sites. Once the first site has been created using the auto setup features, subsequent sites don't have this restriction. In the PW program, we tend to use that first site as the base site, so we set it up the way we want it, export its database, and then modify our custom replication script to use its .sql file and site folder.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.