Drupal Installation
Server Requirements
Installing Laravel
Configuration
Web Server Configuration
Pretty URLs
Server Requirements
Drupal has a few system requirements.
You will need to make sure your server meets the following requirements:
- PHP >= 7.1
- XML extension
- GD library
- PHP OpenSSL
- JSON (usually compiled by default anyway)
- cURL
- Mbstring
Installing Drupal
Drupal utilizes Composer to manage its dependencies. So, before using Drupal, make sure you have Composer installed on your machine.
Via Composer Create-Project
First, cd into your web root on your localhost e.g: cd /var/www/public_html
Now download the Drupal installer using Composer:
composer create-project drupal-composer/drupal-project:8.x-dev ./ --stability dev --no-interaction
Composer will put your website files into a directory called web
.
Get Drupal Console
Install Global Drupal Console Launcher
curl https://drupalconsole.com/installer -L -o drupal.phar
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal
Add Drupal Console to project
composer require drupal/console:~1.0 \
--prefer-dist \
--optimize-autoloader
Local Development Server
If you have PHP installed locally and you would like to use PHP's Built-in web server to serve your application, you may use the php -S
command. Change directory into the web
folder, then this command will start a development server at http://localhost:8000
:
php -S localhost:8000
Will bring up the install steps. You'll need to create a database (e.g. using mysql
or phpMyAdmin).
... It's pretty self explanatory.
Configuration
Public Directory
After installing Drupal, you should configure your web server's document / web root to be the web
directory. The index.php
in this directory serves as the front controller for all HTTP requests entering your application.
Configuration Files
All of the configuration files for Drupal are stored in the /web/sites/default/
directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you.
Directory Permissions
After installing Drupal, you may need to configure some permissions. Directories within the storage /web/sites/default/files
directories should be writable by your web server.
Application Key
The next thing you should do after installing Drupal is set your application key to a random string. If you installed Drupal via the Drupal installer, this key has already been set for you by the installer.
For enhanced security, you may set this variable to the contents of a file outside your document root; you should also ensure that this file is not stored with backups of your database.
Additional Configuration
Drupal needs almost no other configuration out of the box. You are free to get started developing! However, you may wish to review the /web/sites/default/settings.php
file and its documentation. It contains several options that you may wish to change according to your application.
You may also want to configure a few additional components of Drupal, such as:
- Cache
- Database
- Session
Web Server Configuration
Pretty URLs
Apache
Drupal includes a public/.htaccess
file that is used to provide URLs without the index.php
front controller in the path. Before serving Drupal with Apache, be sure to enable the mod_rewrite module so the .htaccess file will be honoured by the server.
In Drupal 8, 'Clean URLs' are enabled by default and can't be disabled.
Nginx
If you are using Nginx, the ngx_http_rewrite_module
module is required as Drupal 8 uses it for clean URLs.
The word "Drupal" and the wordmark logo are registered trademarks of Dries Buytaert.