How to Put Drupal 7 in Maintenance Mode

Here’s how to turn on Maintenance Mode in Drupal 7:

Step 1

  • Go to “Configuration” then “Maintenance mode”.

Step 2

  • Make sure the “Put site into maintenance mode” box is checked
  • Enter the message you want visitors to see during the interruption.
  • Click “Save configuration”.

Step 3

  • You’ll now see a message saying “The configuration options have been saved”.

Step 4

  • You will be able to browse around your site without problems but visitors who aren’t logged in will see the message above.
  • If you log yourself and can’t get back in, just add /?q=user after your site address and you’ll be back to the user login page.

Reset password in Drupal 6 & 7 from database

For drupal6

UPDATE users SET name='admin', pass=md5('drupal') WHERE uid = 1;

For drupal7
define(‘DRUPAL_ROOT’, getcwd());
require_once DRUPAL_ROOT . ‘/includes/bootstrap.inc’;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
require_once ‘includes/password.inc’;
$pwd = user_hash_password(‘NewPassword‘);

UPDATE users SET name=’admin’, pass=’$pwd’ WHERE uid = 1;

Install drupal through command line step by step

Download and extract files

$  wget https://www.drupal.org/files/projects/drupal-x.x.tar.gz
$  tar -zxvf drupal-x.x.tar.gz

Move to root folder

$  mv drupal-x.x /var/www/html

Create the configuration file and grant permissions

In the sites/default directory, copy the default.settings.php file and rename the copied file to settings.php.

$ cp sites/default/default.settings.php sites/default/settings.php

Give the web server write privileges (666 or u=rw,g=rw,o=rw) to the configuration file.

$ chmod a+w sites/default/settings.php

Give the web server write privileges to the sites/default directory.

$ chmod a+w sites/default

Create the Drupal database

To complete the installation, you must create an empty database and a user with full access to the newly created database for Drupal to use. You can do this by command line, or through phpMyAdmin or another database client.

$ mysqladmin -u username -p create databasename

Where ‘username’ is a MySQL user which has the CREATE and GRANT privileges. MySQL will prompt for the ‘username’ database password. Next you must set the access database rights. Log in to MySQL:

$ mysql -u username -p

$ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO ‘username’@’localhost’ IDENTIFIED BY ‘password’;

Run the installation script

Point your browser to the base URL of your website

http://www.example.com

Create an .info.yml file in Drupal 8

You create the .info.yml file in the root of your theme folder. The folder should have the same name as the .info.yml file. So if your theme is named “Fluffiness” then the folder is named “fluffiness/” and the .info.yml file is named “fluffiness/fluffiness.info.yml“. If the file is present your theme will be visible in your website at Manage > Appearance (http://example.com/admin/appearance).

Example

name: Fluffiness (Required)
type: theme (Required)
description: ‘A cuddly theme that offers extra fluffiness.’ (Required)
package: Custom
core: 8.x (Required)
libraries:
– fluffiness/global-styling
stylesheets-remove:
– ‘@classy/css/layout.css’
– core/assets/vendor/normalize-css/normalize.css
regions:
header: Header
content: Content
sidebar_first: ‘Sidebar first’
footer: Footer

.info files are now .info.yml files in Drupal 8

Drupal 7

configure = admin/config/system/actions

Drupal 8

configure: action.admin

Drupal 7 ( theme_name.info )

name = Bartik
description = A flexible, recolorable theme with many regions and a responsive, mobile-first layout.
package = Core
version = VERSION
core = 7.x

; Stylesheets
stylesheets[all][] = css/layout.css
stylesheets[all][] = css/style.css
stylesheets[all][] = css/colors.css
stylesheets[print][] = css/print.css

; Regions
regions[header] = Header
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom
regions[highlighted] = Highlighted

regions[featured] = Featured
regions[content] = Content
regions[sidebar_first] = Sidebar first
regions[sidebar_second] = Sidebar second

regions[triptych_first] = Triptych first
regions[triptych_middle] = Triptych middle
regions[triptych_last] = Triptych last

regions[footer_firstcolumn] = Footer first column
regions[footer_secondcolumn] = Footer second column
regions[footer_thirdcolumn] = Footer third column
regions[footer_fourthcolumn] = Footer fourth column
regions[footer] = Footer

; Settings
settings[shortcut_module_link] = 0

Drupal 8( theme_name.info.yml )

name: Bartik
type: theme
description: ‘A flexible, recolorable theme with many regions and a responsive, mobile-first layout.’
package: Core
version: VERSION
core: 8.x

# Stylesheets
stylesheets:
all:
– css/layout.css
– css/style.css
– css/colors.css
print:
– css/print.css

# Regions
regions:
header: Header
help: Help
page_top: ‘Page top’
page_bottom: ‘Page bottom’
highlighted: Highlighted
featured: Featured
content: Content
sidebar_first: ‘Sidebar first’
sidebar_second: ‘Sidebar second’
triptych_first: ‘Triptych first’
triptych_middle: ‘Triptych middle’
triptych_last: ‘Triptych last’
footer_firstcolumn: ‘Footer first column’
footer_secondcolumn: ‘Footer second column’
footer_thirdcolumn: ‘Footer third column’
footer_fourthcolumn: ‘Footer fourth column’
footer: Footer

# Settings
settings:
shortcut_module_link: ‘0’

Drupal requirements to install

System requirements

Disclaimer
Note that the minimum requirements of Drupal core can be subject to change, given an important enough reason. Where such a change is likely to have broad impact on Drupal’s user base, every effort will be made to communicate these decisions ahead of time.

Disk space
A minimum installation requires 15 Megabytes. 60 MB is needed for a website with many contributed modules and themes installed. Keep in mind you need much more for the database, files uploaded by the users, media, backups and other files.

Web server
Apache, Nginx, or Microsoft IIS
More details about web server requirements.

Database
Drupal 6: MySQL 4.1 or higher, PostgreSQL 7.1,
Drupal 7: MySQL 5.0.15 or higher with PDO, PostgreSQL 8.3 or higher with PDO, SQLite 3.3.7 or higher
Drupal 8: MySQL 5.5.3/MariaDB 5.5.20/Percona Server 5.5.8 or higher with PDO and an InnoDB-compatible primary storage engine, PostgreSQL 8.3 or higher with PDO, SQLite 3.4.2 or higher
Microsoft SQL Server and Oracle are supported by additional modules.
More details about database requirements.

PHP
Drupal 6: PHP 5.x only (5.2.5 or higher recommended). Warning: support for PHP 4.x has been dropped. Drupal core should work with PHP 5.3.x, but PHP 5.3.x and higher may produce errors or unexpected behavior especially for contributed modules and themes.
Drupal 7: PHP 5.2.5 or higher (5.4 or higher recommended).
Drupal 8: PHP 5.5.9 or higher