From ArchWiki
Revision as of 11:07, 19 October 2011 by Sergej (talk | contribs) (from Arch repositories)
Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

"Drupal is a free and open source content management system (CMS) and Content Management framework (CMF) written in PHP and distributed under the GNU General Public License." - Wikipedia

This article describes how to setup Drupal and configure Apache, MySQL or PostgreSQL, PHP, and Postfix to work with it. It is assumed that you have some sort of LAMP (Apache, MySQL, PHP) or LAPP (Apache, PostgreSQL, PHP) server already setup.


Installing Drupal

from Arch repositories

Note: drupal installation is in /usr/share/webappps/drupal
  1. Install the Template:Package Official package from community
    pacman -S drupal
  2. Open the file Template:Filename with your editor of choice, e.g.
    # nano /etc/php/php.ini
    Find the line with, "Template:Codeline" and uncomment it by removing the ";" from the beginning of the line if necessary. If no such line is found, add it to the Template:Codeline section of the file.
    For Drupal 7, also enable a PDO extension for your database. For MySQL, Template:Codeline should be enabled.
  3. Open the file Template:Filename , e.g.
    # nano /etc/httpd/conf/httpd.conf
    Find the section that starts with "Template:Codeline" or whatever Directory you have installed Drupal in, in that section you will find a line that reads "Template:Codeline" and replace it with "Template:Codeline", that will enable the clean URL's
  4. Restart the Apache web server
    /etc/rc.d/httpd restart
Note: In the Drupal package from the community repository the first line of the Template:Filename file is set to 'Template:Codeline' unlike in the Template:Filename file from drupal.org. This disables access to the Template:Filename directory so one can not activate Drupal. Commenting out that line solves the problem.

manual install

  1. Download the latest package from http://drupal.org and extract it.
  2. Move the folders to apache's htdocs folder.
  3. Open a web browser, and navigate to "localhost"
  4. Follow the on-screen instructions.

Installing GD

You may need the GD library for your Drupal installation.

  1. Install the Template:Package Official package
    # pacman -S php-gd
  2. Open the file Template:Filename with your editor of choice, e.g.
    # nano /etc/php/php.ini
    Find the line with Template:Codeline and uncomment it by removing the ";" from the beginning of the line if necessary. If no such line is found, add it to the Template:Codeline section of the file.
  3. Restart the Apache web server
    /etc/rc.d/httpd restart

Installing Postfix

In order to send e-mails with Drupal, you will need to install postfix. Drupal uses e-mails for account verification, password recovery, etc.

  1. Install Postfix
    # pacman -S postfix 
  2. Configure Postfix as needed
    # nano /etc/postfix/main.cf 
    All that you should have to do is change the hostnames under "Internet Host and Domain Names"
     myhostname = hostname1 

    And then start the Postfix service:
    # /etc/rc.d/postfix start
  3. Send a test e-mail to yourself
     mail myusername@localhost 
    (Enter a subject, some words in the body, then press ctrl+d to exit and send the letter) Wait 10 seconds, and then type Template:Codeline to check your mail. If you've gotten it, excellent.
  4. Make sure Port 25 is fowarded if you have a router so that mails can be sent to the Internet at large
  5. Open the file Template:Filename with your editor of choice, e.g.
    # nano /etc/php/php.ini
    Find the line that starts with, Template:Codeline and change it to Template:Codeline
  6. Restart the Apache web server
    /etc/rc.d/httpd restart

Tips and Tricks

Scheduling with Cron

Drupal recommends running cron jobs hourly. Cron can be executed from the browser by visiting localhost/cron It is also possible to run cron via script by copying the appropriate file from the "scripts" folder into Template:Filename and making it executable.

Xampp Compatibility

The 5.x and 6.x series of Drupal do not support PHP 5.3, and as a result are incompatible with the latest release of Xampp. Currently, the last Drupal-compatible version of Xampp is 1.7.1.

Note: Xampp's PHP memory limit currently defaults to 8MB. Also, Xampp ignores php.ini files in the Drupal directory. To fix this:

  1. edit Xampp's php.ini file using your favorite editor.
    nano /opt/lampp/etc/php.ini
  2. Search for the "memory_limit" line, and replace it with an appropriate value. (Most Drupal installations are happy with 32M, but sites with a lot of modules may need 100M or more.)
  3. Restart Xampp.
    /opt/lampp/lampp restart

Upload progress Not enabled

Upon successful installation you may see the following message in the Status Report:

Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (preferred) or to install APC.

First, install the php-pear package:

# pacman -S php-pear

Next, use the pecl command to automatically download, compile and install the library:

# pecl install uploadprogress

Finally, add to Template:Filename


Restart apache.


Browser shows the actual PHP code when visiting localhost

You do not have php-apache installed.

# pacman -S php-apache

Then, enable the PHP module in Template:Filename by adding the following lines in the appropriate sections:

LoadModule php5_module modules/libphp5.so
Include conf/extra/php5_module.conf

If, when starting httpd, you get the following error:

httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName

You should edit Template:Filename

# nano /etc/httpd/conf/httpd.conf

In that file find the line that looks similar to

#ServerName www.example.com:80

Uncomment it (remove # from the front) and adjust the address as needed. Restart httpd by

# /etc/rc.d/httpd restart


# rc.d restart httpd
and you are ready to go!

Drupal's setup page is not the initial page when accessing localhost

In this situation, you should navigate in your Template:Filename directory and look for the Template:Filename folder (most probably it will be in the Template:Filename directory). Then edit Template:Filename by

# nano /etc/httpd/conf/httpd.conf
and look for a line starting with Template:Codeline and change the path with that folder's path (for me it looks like DocumentRoot "/srv/http/drupal") and also find another line starting with
and set the same path there as well. Restart httpd by
# /etc/rc.d/httpd restart
and you will be done.

Drupal's setup page does not start and shows HTTP ERROR 500

This may be because Drupal needs the Template:Codeline extension to be activated in your Template:Filename. just uncomment the line Template:Codeline from Template:Filename by deleting the initial ';' and restart httpd service by typing /etc/rc.d/httpd restart. (See this link for info.)

More Resources