Cool Solution - Install Drupal

From Univention Wiki

Jump to: navigation, search
Produktlogo UCS Version 4.1

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Packages provided by a Cool Solutions Repository are built by Univention, but will not be maintained. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.

This article explains how to setup Drupal in UCS 4.1.

Prepare your Drupal installation

To install Drupal, you need a web server and a database server. In this article we will use Apache2, PHP5 and MySQL.

 ucr set repository/online/unmaintained='yes'
 univention-install apache2 php5 php5-mysql mysql-client mysql-server

Create a database and a database user

Once the installation was completed successfully, we'll need to create a database via mysql. Run the following command to connect to the mysql shell.

 mysql -u root -p$(cat /etc/mysql.secret)

Enter your mysql root password and run the following series of commands on the MySQL terminal to create new a ‘drupal‘ user and database.

 CREATE USER '<some_username>'@localhost IDENTIFIED BY '<your_password_here>';
 create database <some_database_name>;
 GRANT ALL ON <your_database_name>.* TO '<your_username>'@localhost;
 FLUSH PRIVILEGES;
 exit

Download Drupal

Now you can download Drupal with the following command (replace x.x with the version of Drupal you want):

Hint: Check https://www.drupal.org/project/drupal for the latest update.

 wget http://ftp.drupal.org/files/projects/drupal-7.41.tar.gz


Extract the file and copy it to /var/www/

 tar -xf drupal-7.41.tar.gz
 mkdir -p /var/www/drupal
 cp -R drupal-7.41/* /var/www/drupal


To avoid error messages later on, run the following commands:

 univention-install php5-gd
 service apache2 restart
 mkdir -p /var/www/drupal/sites/default/files
 chmod 777 /var/www/drupal/sites/default/files
 cp -R /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php
 chmod 777 /var/www/drupal/sites/default/settings.php

Install Drupal via web browser

Now you can open your browser and go to one of the following links:

 http://<your_domain>/drupal

OR

 http://<your_ip_address>/drupal


The next steps are up to you. Install Drupal as you wish.

In the database configuration, enter the database name <your_database_name>, the username <your_username> and the password you’ve set.

After the installation finishes, don’t forget to change the permissions of configuration files to avoid security risks:

 chmod -R 755 /var/www/drupal/sites/default/
 chmod 777 /var/www/drupal/sites/default/files
 chown www-data:www-data -R /var/www/drupal/

That’s it! Your installation is ready to use.

LDAP authentication

At first you need to download the LDAP plugin for drupal. Check the following link and download the plugin version 7.x-1.x-dev. [1]

Now switch to your Drupal system and log in with your Drupal admin account. Click on "Modules" on top of your welcome screen. Click on "Install new module" and upload your Drupal LDAP plugin. You can also install modules for Drupal without FTP access, head to the official documentation on that.. If the installation via FTP was successful, click on "Enable newly added modules". Scroll to the end of the page and activate all available LDAP modules. Some of the modules are not clickable, that's no problem.

Now switch to the tab "Configurations" (next to "Modules"). Open the LDAP Configuration and change the encryption setting to "Blowfish".

Switch to "Servers" and click on the button "Add LDAP Server Configuration".

Fill out the text field with the following values:

attribute values
Machine name your own choice
Name your own choice
Enabled <check this box>
LDAP Server Type OpenLDAP
LDAP server <IP of the server>
LDAP port 7389
Binding Method Service Account Bind
DN for non-anonymous search DN of your LDAP search user
Password for non-anonymous search password of your LDAP search user
LDAP User to Drupal User Relationship cn=users,<YOUR LDAP BASE>
AuthName attribute uid
Email attribute mailPrimaryAddress

save your settings by clicking on the "Add" button at the very bottom of the page.

Switch to "Authentication". Enable the LDAP Configuration settings: "Authentication LDAP Server Configurations" and save the settings again.

Now you can log in with your LDAP users.

Further links

Personal tools