安裝了Drupal7以後,若是直接使用的話,效果是不好的,它之因此能成爲這麼流行的開源CMS,你們爲它所貢獻的模塊和主題功不可沒,那麼如何安裝模塊和主題呢,其實Drupal7已經提供了很是好的主題和模塊安裝方式,但這些若是同Drush比起來就相形見拙了。php
Drush顧名思意就是 Drupal + Shell,這是一個十分強大的命令行命令。使用它一來能夠利用Drush開發社區的力量,二來Drush的命令更爲可靠,適用於更多的環境。bootstrap
在Ubuntu 14.04 LTS中安裝Drush很簡單,一個命令便可:bash
sudo apt-get install drush
但若是是象我上篇文章所講的那樣是本身安裝的Drupal,那就須要自行安裝Drush了。不過這也不會太難,命令以下:ide
sudo apt-get install php5-pear sudo pear channel-discover pear.drush.org sudo pear install drush/drush
在安裝了drush以後,您能夠使用如下命令:this
drush version
來查看drush是否正常安裝?若是您獲得瞭如下提示:
spa
$ drush version Drush needs to download a library from [error] http://download.pear.php.net/package/Console_Table-1.1.3.tgz in order to function, and the attempt to download this file automatically failed because you do not have permission to write to the library directory /usr/share/php/drush/lib. To continue you will need to manually download the package from http://download.pear.php.net/package/Console_Table-1.1.3.tgz, extract it, and copy the directory into your /usr/share/php/drush/lib directory.
說明您沒有安裝Console_Table,能夠使用如下命令安裝:.net
sudo pear install Console_Table-1.2.0
安裝完後,您再查詢Drush的版本號將獲得如下結果:命令行
7$ drush version Drush Version : 6.2.0
安裝好了Drush以後,再要安裝Drupal模塊或主題的話將十分的輕鬆。例如,我要安裝我最經常使用的模塊和主題的話,只須要輸入下面的語句便可:開發
cd /var/www/drupal7 drush dl ctools views panels admin_menu module_filter l10n_update bootstrap