Installing Drupal 8 on Ubuntu 14.04 Nginx on AWS

Published on Author craigzearfossLeave a comment
  1. Create a database.
    mysql -h localhost -u root -p
    CREATE DATABASE DRUPAL_DATABASE;
    CREATE USER DRUPAL_USER@localhost IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON DRUPAL_DATABASE.* TO DRUPAL_USER@localhost;
    FLUSH PRIVILEGES;
    exit;
    
  2. Install git and drush.

    sudo apt-get install git drush -y
    
  3. Create the project. You can do this three ways.

    1. With Composer (Recommended)
      composer create-project drupal-composer/drupal-project:8.x-dev PROJECT_DOMAIN --stability dev --no-interaction
      
    2. Clone Drupal
      cd /var/www
      git clone --branch 8.0.x http://git.drupal.org/project/drupal.git PROJECT_DOMAIN
      
    3. Use drush
      drush dl drupal-8
      mv drupal/* /var/www/PROJECT_DOMAIN/
      
    4. Create settings.php and services.yml file.

      cd /var/www/PROJECT_DOMAIN/sites/default
      cp default.settings.php settings.php
      cp default.services.yml services.yml
      
    5. Set the trusted host configuration in the settings.php file.

      sudo nano settings.php
      

      The trusted host configuration should look something like this.

      $settings['trusted_host_patterns'] = array(
         '^PROJECT_DOMAIN\.com$',
         '^.+\.PROJECT_DOMAIN\.com$',
      );
      
    6. Update directory and file permissions

      cd /var/www/PROJECT_DOMAIN
      mkdir default/sites/files
      chown -R ubuntu:www-data *
      

      Make settings.php writeable for the installation process.

      chmod 664 default/sites/settings.php
      
    7. In your browser navigate to your domain http://PROJECT_DOMAIN and update the following settings:

      • language
      • database name
      • database user
      • database password
    8. Enter the site information.

      • Site name
      • Site email address (for automated emails)
      • Username / Password
      • Email address
    9. Remove the write permissions on settings file.

      chmod 644 default/sites/settings.php
      

    References:

Leave a Reply

Your email address will not be published. Required fields are marked *