Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part III: Drupal 7

Drupal Logo

Part III – Drupal 7:

In Part I and II, Apache, PHP, MySQL were installed and configured.  In Part III, Drupal 7 configuration is the focus.  This information can be derived from Drupal 7 installation documentation.  The reader is encouraged to review the documentation at www.drupal.org.


Update the FreeBSD 10 Ports Tree:

# portsnap fetch update


Update installed ports using portmaster:

# portmaster -ad


Drupal 7:

# cd /usr/ports/www/drupal7
# make install clean



Enclosed are the recommended php.ini settings in /usr/local/etc/php.ini:

memory_limit = 128M


Create MySQL Database:

To create a MySQL Database in a secure manner with phpMyAdmin, it is suggested to add a database user that has all the privileges to the new database, but none to any other databases or the server itself.

Create MySQL User:

  1. Sign into phpMyAdmin as the root user.
  2. Select the ‘Users‘ Tab then select ‘Add user
  3. In the ‘User Name’ Field, enter the User name you wish to use
  4. In the ‘Host’ Field section, select ‘Local‘ unless you are accessing this user and database from another server
  5. Enter a Password for the user
  6. Select ‘Go‘ to create the user

Create MySQL Database:

  1. Select the ‘Database‘ tab
  2. In the ‘Create database‘ section, enter the database name
  3. Select ‘utf8_general_ci’ under Collation pull down menu
  4. Click ‘Create

Assign privileges to the new database:

  1. Select the ‘Users‘ tab
  2. Locate the new user and click on ‘Edit Privileges
  3. Click the ‘Database‘ button next to the ‘Global‘ button
  4. In the ‘Add privileges on the following database(s):’ field, enter the name of the newly created database name
  5. Select ‘Go’
  6. Check the ‘Database-specific privileges’ Check All box
  7. Select ‘G0’



Drupal 7 installs a configuration file at /usr/local/www/drupal7/sites/default/settings.php.  Before running the installation script, change its permissions. After the installation, restrict the permissions again.

# cd /usr/local/www/drupal7/sites/default
# cp -p default.settings.php settings.php



To configure Apache to point to the correct web site, the Document Root directive needs to be modified as follows.  Please edit /usr/local/etc/apache24/httpd.conf and change the following:

DocumentRoot "/usr/local/www/drupal7"
<Directory "/usr/local/www/drupal7">
Options Indexes FollowSymLinks MultiViews
AllowOverride All


 Installation Script:

To run the Drupal install script, point your browser to the base URL of your web site.  In most cases, it will be http://your-domain-name.com or http://your-ip-address.  If you experience the install script not executing using the base URL, append /install.php to the end of the base url for example http://your-domain-name.com/install.php.

After running the installation script, you will be guided through several pages.


1.  Standard or Minimal Installation:

The first page gives the user a choice between Standard or Minimal Installations.  Most will choose Standard Installation.  The Minimal Installation is geared to more advanced users with specific needs.


Standard Install

2.  Choose Language:

Choice of Language



3.  Database Requirements:

Enter Database Name, Username, and Password Information.




Database Requirements


4. Site Information:

Enter the required site information:


Site Information


5.  Installation Complete:

Installation Complete


6.  Initial Site Visit:

Initial Site Visit


7. Check Status Reports:



8. Report Options:

It is recommend to run cron manually by clicking the appropriate link in the report status page.  Additionally,the server is capable of displaying the upload progress, but the necessary port is not installed.

To install pecl-uploadprogress:

# cd /usr/ports/devel/pecl-uploadprogress
# make install clean
# apachectl restart


Report Options


9.  Clean Status Report:

Clean Status Report



Installing and configuring Drupal 7 on a FreeBSD 10 Server is not difficult.  In Part IV of this article, implementing ssl will be demonstrated.


Additional Resources:




Leave a Reply

Your email address will not be published. Required fields are marked *