Drupal - Installation

in

1. Configure Apache

  1. <VirtualHost *:80>
  2.  ServerName drupal-server-name:80
  3.  php_flag  register_globals       off
  4.  php_flag  allow_url_fopen        off
  5.  php_flag  safe_mode              off
  6.  php_flag  session.use_trans_sid  off
  7.  php_value memory_limit           40M
  8.  php_value upload_max_filesize    32M
  9.  php_value post_max_size          32M
  10.  RewriteEngine On
  11.  DocumentRoot /var/www/drupal
  12.  <Directory /var/www/drupal>
  13.   Options -Indexes -ExecCGI +FollowSymLinks -MultiViews
  14.   DirectoryIndex index.php
  15.   AllowOverride All
  16.   RewriteBase /
  17.   RewriteCond %{REQUEST_FILENAME} !-f
  18.   RewriteCond %{REQUEST_FILENAME} !-d
  19.   RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  20.  </Directory>
  21. </VirtualHost>

2. Configure MySQL

Either do it manually

create database drupal character set 'utf8';
grant all privileges on drupal.* to drupal@localhost identified by 'drupal';
flush privileges;

Or use the phpMyAdmin web interface. Set collation to utf8_general_ci.

3. Install Drupal

I started my installation as described in the fast drupal blog start.

Download distributive from www.drupal.org or www.drupal.ru. Upload it into document root of your site and unroll

cd /var/www/
tar -zxvpf drupal-x.x.tar.gz
mv drupal-x.x drupal

Manually copy settings.php from defaults and give apache write permissions to it. In Windows give full access to the file to Everyone. Also create a folder for uploading files on the site.

cd drupal/sites/default
cp default.settings.php settings.php
chmod a+w settings.php
mkdir files
chown apache:apache files

Point your browser to main page of your site and answer 3 wizard screens of questions.When done, remove write permissions from settings:

chmod 555 sites/default/settings.php

Now you can create articles (Create content >> Story), register users, write comments and subscribe to RSS.

4. Cron

Setup a cron job for routine drupal operations

cat > /etc/cron.hourly/drupal
/usr/bin/wget http://mysite.com/drupal/cron.php    -O - > /dev/null 2>&1
^D
chmod +x /etc/cron.hourly/drupal

If the server runs behind corporate proxy, you need to patch include/common.inc as described here and here2. Then restart drupal and surf to http://mysite.com/admin/settings/proxy.

5. Extending Drupal

Чтобы установить сторонний модуль, его обычно надо закачать на сервер и разархивировать в папку sites/all/modules/<module name>. Может также потребоваться выставить разрешения на чтение (и возможно, запись) в файловой системе. После этого он, как и встроенные модули, появится в интерфейсе администратора, где его надо включить.

Для установки темы оформления ее, как и модуль, надо закачать на ваш сервер в папку sites/all/themes/<theme name>. Далее ее можно будет выбрать в меню сайта Administer -> Site building -> Themes. Для простых самописных тем, состоящих из одного файла .css и где нет отдельных файлов .tpl, эти файлы шаблонов следует искать в папке themes/engines/phptemplate.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
To prevent automated spam submissions leave this field empty.