Drupal Drupal System Administration

Drupal 7 contains administration functions built into its web application. In <Reports> there is a website status report as well as reports for errors, log messages, and available updates. The <Configuration> menu provides access to a Cron process for performing automated periodic maintenance, deletion of cache, and settings to control the display of error messages. In <People> you can create new user roles and assign the roles permissions. You can create users accounts and assign them one or more user roles. If you enable the Tracking module, you can also as setup tracking on user's accounts. Additional modules can be added and enabled to enhance the core functions, such as the Backup and Migrate module which allows for automated backups of the website database.

Additionally, a command shell called Drush can be used for system administration. Drush also provides a scripting interface for Drupal websites. Drush is more flexible, more precise, faster, and uses less system resources than does the administration functions built into Drupal's GUI web-interface. See the Drush page for more information on using the Drupal command shell.

Drupal 7 contains a maintenance mode. When maintenance mode is enabled, only users with “Use the site in maintenance mode” permission will be able to access the website. All other visitors will see a page indicating the website is currently under maintenance.

Backups Backup and Restoring Websites

A Drupal website consists of a database and a set of files. Both the database and the files need to be backed up. The drush archive-dump command will backup both the database and the files. There is also a Backup and Migrate module which can be added to the Drupal web application. The module allows for easy and automated backups of the website database (only the database, not files). One technique to using the Backup and Migrate module is to create a backup directory inside the Drupal website root. Then downloading or copying the website root to get both the database backup and the Drupal files.

Below is the procedure for setting up and using the Backup and Migrate module:

  1. Under <Configuration><Media><File System> specify a "Private File System Path" where you desire to store the database backups (e.g. sites/default/files/private/backups).
  2. Download, install, and enable the Backup and Migrate module.
  3. Under <Configuration><Backup and Migrate><Destinations> add a destination for the backups (Backups = sites/default/files/private/backups). Then under <Backup><Quick Backup> specify the destination (Backups). Run a quick backup and verify.
  4. Under <Advanced Backup> specify the desired configurations (e.g. Compression=Zip, Take site offline during backup, send email on backup success and failure). Then run advanced backup and verify.
  5. Under <Schedule> set up the desired backup schedules (eg Daily Backup, every 1 day, keep 3 backup files). Then run Cron and verify backup.
  6. FTP the entire website root to desired backup location. Verify.
User Roles Role Based Permission System

Core Drupal contains three types of user roles:

  1. Anonymous User - User who is not logged in.
  2. Authenticated User- User who is logged in.
  3. Administrator - User who is logged in and and maintains the website.

Additional user roles can be defined in Drupal. Permission are assigned to each type of user role. When a new user account is created, it is assigned one or more user roles.

The permissions associated with user roles determine the account's capabilities on the website. There are numerous permissions that are set in <People.><Permissions>. The permission settings determine how the website will appear to the user. Permissions also determine what content the user can view, edit, delete, and creates as well as administration capabilities.

User Accounts Registration and Cancellation Processes

There are settings for controlling the user registration and cancellation processes under <Configuration><People><Settings>. These setting provide options on who can create user accounts:

  1. Administrators Only - Only users assigned the administrator role can create user accounts.

  2. Visitors - Anyone using the website can create accounts by themselves.

  3. Visitors, but administration approval is required - Anyone sing the website can start the account creation process, but it must be approved by an administrator (default setting).

There is also a check box that requires e-mail verification before a visitor is able to create an account. When checked, an email is sent with a key value. If the user does not respond to that email within 24 hours, then they are not allowed a user account. (default is checked).

When setting up the site for visitors you may wish to enable the Tracking module. This will then show a tracking tab on the user's account where the user can see their history. Only the administrator will be able to see the tracking history of others.

User Emails Welcome, Password Recover, Account Activated or Blocked

Under <Configuration><People><Settings>, there are also controls for determining when the website will send an email to a user. There are editable form letters associated with account events such as welcoming a new user, recovering a user's password, and the activation, blocking, or cancellation of a user account.

Configuration Note: (D7) When acting as an anonymous user and attempting to set up an account, I received the message: "Unable to send e-mail. Contact the site administrator if the problem persists". The new user was added to the database in a blocked status, but no emails were sent by Drupal at all. Below are the steps to resolve the problem:

  1. Created an email account on the same domain as the Drupal site:
    • Email Account: hikingtrails@kcshadow.net
    • POP3: mail.kcshadow.net
    • SMTP: mail.kcshadow.net

    Then to test the account: telnet hikingtrails@kcshadow.net 110. Should get a POP3 OK reply.

  2. Installed the SMTP Authentication module (bypassing the default PHP email function). Configurations for SMTP module:
    • SMTP Server: mail.kcshadow.net
    • SMTP Port: 25
    • User Name: hikingtrails@kcshadow.net
    • Email from address: hikingtrails@kcshadow.net

  3. Then under <Configuration><Site Information> changed the email address to be: hikingtrails@kcshadow.net.

To set up the account in Thunderbird email:

  1. In <Tools><Account Settings><Add Account>
  2. Account Name = Hiking Trails.
  3. Your Name = Hiking Trails.
  4. Email Address = hikingtrails@kcshadow.net
  5. Outgoing Server (SMTP) = smtp.comcast.net
  6. Server Name (POP) = mail.kcshadow.net
  7. Port = 110
  8. UserName = hikingtrails@kcshadow.net

Drupal 7 Contact E-mail Bug:

There is a documented bug in D7 where you receive the error message when sending a contact email: "Unable to send e-mail. Contact the site administrator if the problem persists." To fix this I found a code change was needed in modules\contact\contact.pages.inc:

findstr

Around line 147 this code:
  // Get the to and from e-mail addresses.
  $to = $values['category']['recipients'];
  $from = $values['sender']->mail;
 
should be changed to this:
  
  // Get the to and from e-mail addresses.
  $to = $values['category']['recipients'];
  $from = "hikingtrails@kcshadow.net";
  




Top