How Do You Create a Node.js Application to Be Presentable and Usable via a Docker Container?

Problem scenario
You want to create a basic “Hello World” web page with Node.js running in a Docker container.  How do you do this?

Solution
Prerequisite

Install Docker.  If you need assistance, see this posting.

Procedures
1.  Create three files in the same directory on a Linux server. 

How Do You Write Tic-Tac-Toe in JavaScript?

Problem scenario
You want to write a program using JavaScript. You want to play Tic-Tac-Toe. What do you do?

Solution

1. Save the file below as contint.html to your computer.
2. Open a web browser, preferably Firefox.
3. View the HTML file on your computer via the web browser. (e.g., c:\path\to\contint.html)

<!DOCTYPE html<html<body<h2Play Tic-Tac-Toe with Anyone You Can Share a Keyboard With</h2<p</p<p***************************************************************</p<pTo make your mark, …

How Do You Install and Configure Gulp?

Problem scenario
You want to use Gulp the automation tool (https://gulpjs.com/).  How do you install it and get it to work on Linux (either a Debian distribution or a Red Hat distribution)?

Solution
1.  If you are using CentOS, Red Hat Enterprise Linux, or Fedora, run these two commands:

sudo yum -y install nodejs npm  # *
sudo npm install -g gulp

If you are using Debian or Ubuntu Linux,

How Do You Install npm and Node.Js on Any Distribution of Linux?

Problem scenario
You have Linux servers of different distributions (including Debian/Ubuntu, Red Hat derivatives such as CentOS, RHEL, or Fedora, and Linux SUSE).  You want to install npm and Node.js on them.  What do you do?

Solution
Prerequisites
i.  You need a server with at least 1 GB of RAM.  To add virtual memory, see this posting

How Do You Use “sudo npm” or “sudo node” Commands?

Problem scenario
You run “sudo npm” or “sudo node” and you get “command not found” error messages.  What should you do?

Solution
Modify the /etc/sudoers file.  Find the stanza with secure_path.  Append “:/usr/local/bin” (with no quotes) to the line.

Here is an example of how the stanza should look (it is often on line 80 of /etc/sudoers):

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

Once the /etc/sudoers file has been saved,

What Can Be Done to Enhance the Reliability and Performance of a Jira Server?

Problem scenario
You find that your Jira is very slow and sometimes stalls or hangs when it is being used.  The Linux back-end of the Jira server shows considerable CPU and memory constraints.  When Jira is up on the back end you use the Linux “top” command, you find that the CPU and RAM are being heavily utilized.  You want to optimize the system for improved performance.