Download Attune CE

Install MEAN Stack Dev Environment on CentOS/Fedora/Red Hat

Exported on 28-Sep-2021 13:31:13

Install MEAN Stack Development Environment On CentOS, Fedora and Red Hat Linux

This Blueprint installs MEAN stack development system in RHEL based systems.

The MEAN stack is JavaScript-based framework for developing web applications. MEAN stack is one of the most popular Technology Stack. It is used to develop a Full Stack Web Application and consists of MongoDB, Express.js, Angular.js, and Node.js.

MongoDB MongoDB is a cross-platform source-available document-oriented database program, it is a NoSQL database program. MongoDB is the leading general purpose database platform, modern, designed to unleash the power of data and software for applications and the developers.

Express.js Express, is a Node.js back-end web application framework, released under the MIT licence as a free and open-source software. It is designed for building web applications and APIs. It has been called the de facto standard server. Express philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, websites and hybrids.

Angular.js AngularJS is a toolset for building frontends, the framework is most suited to your application development. It is fully extensible and works well with other libraries. AngularJS is a JavaScript framework. It can be added to an HTML page with a script tag. AngularJS is maintained mainly by Google, and extends HTML attributes with Directives, and binds data with Expressions.

Node.js Node.js is a free, open-sourced, cross-platform JavaScript run-time environment that lets developers write command line tools and server-side scripts. With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy with NodeJS. Node was initially conceived for the purpose of making asynchronous programming easy and convenient.

Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Linux node for the host you wish to install the stack on.
  2. On the Inputs tab, create Linux credentials to connect to the host you wish to install the stack on.
Steps Involved
  • Update yum packages.
  • Install and configure MongoDB
  • Install and configure NodeJS with NPM
  • Install and configure MEAN Stack components from MEAN.io

Parameters

Name Type Script Reference Default Value Comment
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser

1 - Update Yum repositories

Update apt packages

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install APT update
sudo yum -y update

2 - Upload MongoDB Repo Configuration File

This adds the mongodb package to yum repository of the target system.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive mongodb-org-4.4.repo.zip to remote path uploads
  1. Locate Files archive "mongodb-org-4.4.repo.zip", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to uploads, relative to the home directory
  4. Check that the files are in the correct location

3 - Install MongoDB

This installs MongoDB database server

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Move MongoDB repo file
sudo mv uploads/mongodb-org-4.4.repo /etc/yum.repos.d/mongodb-org-4.4.repo

# Install MongoDB
sudo yum install -y mongodb-org

4 - Install NodeJS v12

This installs NodeJS server into the target machine

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Download setup script
sudo curl -fsSL https://rpm.nodesource.com/setup_12.x -o nodesource.sh

# Configure install script
sudo bash nodesource.sh

# Start installation 
sudo yum install -y nodejs

5 - Download MEAN.io Stack

Downloads MEAN Stack Packager From Git

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
git clone https://github.com/linnovate/mean

6 - Install Node Dependencies

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Change current working directory
cd mean

# Install Node Dependencies
npm i --force

# Create environment file
cp .env.example .env

7 - Install and configure screen

Installs and configures screen package to run the development server in background.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install Screen 
sudo apt install -y screen && 

# Configure mean stack
sudo echo "zombie xy" >> ~/.screenrc

8 - Start Development Server

This starts the development server on port 4040 of the target machine.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Start development server
cd ~/mean && screen -d -m npm start