Difference between revisions of "Cool Solution - Install Drupal"

From Univention Wiki

Jump to: navigation, search
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Cool Solutions Disclaimer|Repository=yes|UCS=4.1}}
+
{{Version|UCS=4.1}}
 +
{{Cool Solutions Disclaimer|Repository=yes}}
 +
{{#seo:
 +
|title={{#replace:{{#replace:{{#replace:{{#replace:{{FULLPAGENAME}}|'|'}}|&|&}}|"|"}}|Cool Solution - |}} - {{SITENAME}}
 +
<!--|description=-->
 +
}}
 +
 
 +
This article explains how to setup Drupal in UCS 4.1.
  
 
== Prepare your Drupal installation ==
 
== Prepare your Drupal installation ==
To install Drupal, you will require a running web-server and a database server, in this article we will work with Apache2, PHP5 and MySQL.
+
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'
 
   ucr set repository/online/unmaintained='yes'
 
   univention-install apache2 php5 php5-mysql mysql-client mysql-server
 
   univention-install apache2 php5 php5-mysql mysql-client mysql-server
  
 
== Create a database and a database user ==
 
== Create a database and a database user ==
If the installation was succesfully we'll need to create a database via mysql.
+
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.
+
Run the following command to connect to the mysql shell.
  
 
   mysql -u root -p$(cat /etc/mysql.secret)
 
   mysql -u root -p$(cat /etc/mysql.secret)
Line 15: Line 22:
  
 
   CREATE USER ''''<some_username>''''@localhost IDENTIFIED BY ''''<your_password_here>'''';
 
   CREATE USER ''''<some_username>''''@localhost IDENTIFIED BY ''''<your_password_here>'''';
   create database ''''<some_database_name>'''';
+
   create database '''<some_database_name>''';
   GRANT ALL ON ''''<your_database_name>''''.* TO ''''<your_username>''''@localhost;
+
   GRANT ALL ON '''<your_database_name>'''.* TO ''''<your_username>''''@localhost;
 
   FLUSH PRIVILEGES;
 
   FLUSH PRIVILEGES;
 
   exit
 
   exit
  
 
== Download Drupal ==
 
== Download Drupal ==
Now you can download drupal with the following command (replace x.x with the version of drupal you want):
+
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.''
 
''Hint: Check https://www.drupal.org/project/drupal for the latest update.''
Line 28: Line 35:
  
  
Extract the file and take it away to '''/var/www/
+
Extract the file and copy it to '''/var/www/
 
'''
 
'''
 
   tar -xf drupal-7.41.tar.gz
 
   tar -xf drupal-7.41.tar.gz
Line 37: Line 44:
 
To avoid error messages later on, run the following commands:
 
To avoid error messages later on, run the following commands:
  
   apt-get install php5-gd
+
   univention-install php5-gd
 
   service apache2 restart
 
   service apache2 restart
 
   mkdir -p /var/www/drupal/sites/default/files
 
   mkdir -p /var/www/drupal/sites/default/files
Line 54: Line 61:
  
  
The next step is up to you. Install drupal as you wish.
+
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.
+
In the database configuration, enter the database name '''<your_database_name>''', the username '''<your_username>''' and the password you’ve set.
  
After installation finishes, don’t forget to change the permissions of configuration files to avoid security risks if any:
+
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 -R 755 /var/www/drupal/sites/default/
 
   chmod 777 /var/www/drupal/sites/default/files
 
   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.
 
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. [https://www.drupal.org/project/ldap]
 +
 +
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 [https://www.drupal.org/docs/7/extending-drupal/installing-modules#using-manual-install 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:
 +
 +
{| class="wikitable"
 +
|-
 +
! 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 ==
 
== Further links ==
Drupal installation - http://www.tecmint.com/install-drupal-in-ubuntu-debian/
+
*Drupal installation - http://www.tecmint.com/install-drupal-in-ubuntu-debian/
 +
*Drupal LDAP authentication - http://blog.zwiegnet.com/linux-server/drupal-7-openldap-authentication/
  
  
  
 
[[Category:EN]] [[Category:Howtos]]
 
[[Category:EN]] [[Category:Howtos]]

Latest revision as of 13:58, 8 September 2017

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