
We put Drupal 7.x + modules + localization in a few minutes
Good afternoon!
Recently, more and more often, the choice of a platform for customer projects falls oneveryone’s beloved Drupal 7. In this regard, one has to repeat almost the same series of soil preparation operations for a future site almost every day:
1) Download Drupal 7. x to the server via FTP
2) Creating a database
3) Installing Drupal through www.domain.com/install.php
4) Installing all the necessary modules by their URL
5) Adding the Russian language and updating all translations
All this takes a considerable amount of time in in the end, it was decided to simplify this process by installing Drupal fully by the command line. To do this, we will use such a wonderful tool as Drush.
I will not analyze the installation process of this tool, since there is more than enough information on the network, moreover, under any axis. Just google something like " drush install centos ".
After the successful installation of Drush - go to the root directory of the project (something like /var/www/domain.ru/).
1) First we need to download the current version of Drupal:
After a successful download, you will find a new directory ./drupal-7.x (instead of x - there will be a build version). However, we need the CMS files to be in the current directory, so we will execute 3 more commands: 2) The files are in their places - now we are installing Drupal with the si (site-install) command .
[admin_login], [admin_pass] - login and password of the future site administrator (user with id = 1).
[root_login], [root_pass] - login and password from the root user to work with the MySQL database.
[mysql_user], [mysql_pass], [mysql_db] - data for prescribing settings in settings.php for working with the MySQL database.
[install_profile] - Drupal installation profile (choose between "standrad" or "minimal").
[sitename] - the name of the future site (in the future you can always change in the settings).
The result is something like: 3) Now we have a “bare” Drupal installed with a minimal set of modules in English. Next, we will install the modules we need using the dl (download) command
. I will build your own kernel modules you need, you do it can vary:
drush the dl drush_language, admin_menu, devel, the fancybox, token, CTools, filefield_paths, filefield_sources, jquery_update, l10n_update, module_filter, Pathauto, views, ckeditor, of insert, -y Transliteration
Please attention to the l10n_update and drush_language modules - their installation is required for further work with language settings through Drush (see point 4). The drush_language module must be installed once on the same machine. After the successful installation of all modules, enable the modules we need using the en (enable) command :
That's it, now our system has overgrown with the modules we need. However, the site will be in English. Unfortunately, many people in our country have not yet acquired sufficient knowledge of the English language, so I will show how to quickly translate the entire engine and all modules into Russian.
4) To automatically update the language files of the engine and module, we will use theindispensable module l10n_update . And to add a new language through Drush we will use drush_language .
Add and enable the default Russian language: After which we just need to update all translations: That's all. The whole installation process fits in 5 minutes and does not require a single click of the mouse.
PS If this article is useful to anyone - in the next article I can consider creating your own installation profile for Drupal.
Recently, more and more often, the choice of a platform for customer projects falls on
1) Download Drupal 7. x to the server via FTP
2) Creating a database
3) Installing Drupal through www.domain.com/install.php
4) Installing all the necessary modules by their URL
5) Adding the Russian language and updating all translations
All this takes a considerable amount of time in in the end, it was decided to simplify this process by installing Drupal fully by the command line. To do this, we will use such a wonderful tool as Drush.
Drush is a command-line tool for managing Drupal content .
I will not analyze the installation process of this tool, since there is more than enough information on the network, moreover, under any axis. Just google something like " drush install centos ".
After the successful installation of Drush - go to the root directory of the project (something like /var/www/domain.ru/).
1) First we need to download the current version of Drupal:
drush dl drupal
After a successful download, you will find a new directory ./drupal-7.x (instead of x - there will be a build version). However, we need the CMS files to be in the current directory, so we will execute 3 more commands: 2) The files are in their places - now we are installing Drupal with the si (site-install) command .
mv ./drupal-7.x/* .
mv ./drupal-7.x/.htaccess .
rm ./drupal-7.x
drush si [install_profile] --account-name=[admin_login] --account-pass=[admin_pass] --db-su=[root_login] \
--db-su-pw=[root_pass] --db-url=mysql://[mysql_user]:'[mysql_pass]'@'localhost'/[mysql_db] --site-name='[sitename]'
[admin_login], [admin_pass] - login and password of the future site administrator (user with id = 1).
[root_login], [root_pass] - login and password from the root user to work with the MySQL database.
[mysql_user], [mysql_pass], [mysql_db] - data for prescribing settings in settings.php for working with the MySQL database.
[install_profile] - Drupal installation profile (choose between "standrad" or "minimal").
[sitename] - the name of the future site (in the future you can always change in the settings).
The result is something like: 3) Now we have a “bare” Drupal installed with a minimal set of modules in English. Next, we will install the modules we need using the dl (download) command
drush si minimal --account-name=admin --account-pass=123456 --db-su=root \
--db-su-pw=654321 --db-url=mysql://username:'password'@'localhost'/database --site-name='My new site on Drupal 7'
. I will build your own kernel modules you need, you do it can vary:
drush the dl drush_language, admin_menu, devel, the fancybox, token, CTools, filefield_paths, filefield_sources, jquery_update, l10n_update, module_filter, Pathauto, views, ckeditor, of insert, -y Transliteration
Please attention to the l10n_update and drush_language modules - their installation is required for further work with language settings through Drush (see point 4). The drush_language module must be installed once on the same machine. After the successful installation of all modules, enable the modules we need using the en (enable) command :
drush en admin_menu,devel,fancybox,token,ctools,filefield_paths,filefield_sources,jquery_update,l10n_update,module_filter,pathauto,views,ckeditor,contact,field_ui,file,list,menu,number,syslog,admin_menu_toolbar,views_ui,insert,transliteration -y
That's it, now our system has overgrown with the modules we need. However, the site will be in English. Unfortunately, many people in our country have not yet acquired sufficient knowledge of the English language, so I will show how to quickly translate the entire engine and all modules into Russian.
4) To automatically update the language files of the engine and module, we will use the
Add and enable the default Russian language: After which we just need to update all translations: That's all. The whole installation process fits in 5 minutes and does not require a single click of the mouse.
drush language-add ru
drush language-default ru
drush l10n-update
PS If this article is useful to anyone - in the next article I can consider creating your own installation profile for Drupal.