These are the steps to deploy Laravel apps on shared hosting with cpanel.
Open the ~/.bashrc
file and find the following code
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
exports.basicAuth = function (req, res, next) { | |
// authentication middleware | |
const auth = { login: process.env.LOGIN, password: process.env.PASSWORD }; // change this | |
// parse login and password from headers | |
const b64auth = (req.headers.authorization || '').split(' ')[1] || ''; | |
const [login, password] = Buffer.from(b64auth, 'base64') | |
.toString() |
Create a new repository, or reuse an existing one.
Generate a new SSH key:
ssh-keygen -t ed25519 -C "your_email@example.com"
Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:
ssh-keygen -t rsa -C "your_email@example.com"
Like PHP's htmlentities()/htmlspecialchars() functions, JavaScript is easy to implement it.
/**
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user