How to build a LEMP/Drupal Server VM in cloud

How to build a LEMP/Drupal Server VM in cloud

Submitted by Jitesh Doshi on Sat, 05/09/2015 - 01:21
screenshot of the video

This video shows how to build LEMP (Linux+Nginx+MySQL+PHP) server VM in the cloud and run a Drupal site on it. The notes for the video are below. Use them along with watching the video.

In case you decided to sign up with Vultr, use my affiliate link here.

Vultr Logo

Please note that the following ARE NOT exact instructions. They are just notes that make sense only with the video.

  1. Update & Upgrade packages:
    apt-get update && apt-get upgrade
  2. Install essential software:
    apt-get -y install vim curl unzip ntp sudo debconf dialog
  3. Install nginx:
    apt-get -y install nginx
  4. Basic server config file:
    server {
      listen 80;
      server_name yourhostname;
      root /home/username/dev/web;
    }
  5. Install php etc:
    apt-get -y install php5-fpm php-pear php5-gd php5-mysql php5-curl
  6. Install mysql:
    apt-get -y install mysql-server
  7. Generate a fairly random password:
    openssl rand 16 -hex
  8. Create regular non-root user:
    useradd username --create-home --shell /bin/bash --group adm -G sudo,adm,www-data
  9. Append to /etc/sudoers.d/custom:
    # Allow members of group sudo to execute any command (without password)
    %sudo   ALL=(ALL:ALL) NOPASSWD: ALL
  10. Install drush:
    pear channel-discover pear.drush.org
    pear install drush/drush
    drush status
  11. Download Drupal:
    drush dl drupal-7
  12. Site directory changes:
    mkdir files
    cp default.settings.php settings.php
    chgrp www-data files settings.php
    chmod g+s files
    mkdir -p modules/contrib modules/custom modules/features themes libraries scripts
  13.  

In case you decided to sign up with Vultr, use my affiliate link here.

Vultr Logo

Jitesh Doshi

Profile picture for user Jitesh Doshi
Managing Partner & CTO
  • A seasoned technology entrepreneur and enthusiast
  • A regular speaker at industry conferences and universities
  • Host and organizer of technology user groups
  • Active in management of non-profit organizations serving the local community
  • Leader and contributor for multiple open-source projects
  • Expert in cloud, application integration, web and mobile technologies
  • Author of open-source projects, including on Drupal.org - Popular Tags and PRLP.
  • Developed several highly successful software platforms and frameworks for clients