Drupal Server Environment: automated server setup for Drupal websites

Submitted by admin on Tue, 07/04/2017 - 07:19

Hi, fellow Drupalers. Today, I’d like to share with you a project of ours that allows automating web server setup for Drupal-powered websites.

At Drupal Admin team, we often set up and fine tune servers for Drupal websites, so it was only natural for us to develop a routine that automates the related processes. We picked Ansible configurations management system for initial setups and further servers maintenance.

Why Ansible? This systems allows:

  • automated servers setup that translates into saving time on manual software installation and configuration;
  • quick introduction of typical software settings that, again, saves us some  manual labour;
  • simplifying documenting configurations of supported servers.

But Ansible belongs to sysadmins and not developers. Is there a tool more suited for the latter?

There is. We built Drupal Server Environment, or DrupalSE, a tool devoid of drawbacks of Ansible (from the developers’ perspective) and enabling quick setup of servers for Drupal installations.

Drupal Server Environment: Description

In a nutshell, DrupalSE lets you quickly set up server software you need to have a Drupal-powered website up and running smoothly.

Installed software:

  • Nginx
  • Php-fpm7.0
  • Mysql
  • Drush
  • Composer
  • Ntp (time sync)
  • Ferm (firewall)
  • Exim (mail server)

Core features of DrupalSE:

  • automated setup of server environment for Drupal-powered websites;
  • quick addition and deletion of sites;
  • optimization of server software configurations with regard to available server resources;
  • automated setup firewall. 

Drupal Server Environment: Installation

To have Drupal Server Environment on your server, download and launch this script under root:

wget https://s3-eu-west-1.amazonaws.com/drupalse/drupalSE.sh
sh drupalSE.sh

Next, enter a password for webmaster. This user will carry things over SFTP.
Then, move to point “1. Configure new server” and let DrupalSE know server configs and name.

After that, the software installs to your server and automatically launches the script that enables adding sites.

Managing websites

Adding a website

  1. Connect through ssh under root user and the menu launches automatically or run manually from root user’s home directory script drupalSE_menu.sh:
    sh drupalSE_menu.sh
  2. Click “2. Manage sites on the server”.

  3. Click “1. Create site”.

  4. Enter site’s domain name.

  5. Enter DB encoding.

  6. Hit Enter, see the following info on your screen:
    - path to site’s directory;
    - DB user name and password;
    - DB name.

  7. Save this info for future reference.

  8. Click “0. Exit”.

  9. Upload Drupal to site’s directory, install or restore DB and start working.

Deleting a website

  1. Connect through ssh under root user and the menu launches automatically or run manually from root user’s home directory script drupalSE_menu.sh:
    sh drupalSE_menu.sh
  2. Click “2. Manage sites on the server”.

  3. Click “2. Delete site”.

  4. Enter path to site: /home/webmaster/domains/$site_name

  5. Hit Enter and “0. Exit”.

I hope this project will be useful for the Drupal community. I am open to your comments and further development suggestions.

 

Add new comment

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.