7

Install Hastebin on Ubuntu 20.04

 2 years ago
source link: https://www.vultr.com/docs/install-hastebin-on-ubuntu-20-04
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
<?xml encoding="utf-8" ??>

Introduction

Haste, also known as Hastebin, is an open-source server like Pastebin. This tutorial explains how to install Hastebin on Ubuntu 20.04 LTS.

Prerequisites

Install Hastebin Server

  1. SSH to your server as root.
  2. Clone the haste-server repository from GitHub.

    # git clone https://github.com/seejohnrun/haste-server.git
    
  3. Change to the haste-server directory.

    # cd haste-server
    
  4. Install the required packages with npm.

    # npm install
    # npm update
    
  5. Hastebin defaults to port 7777. Please change it to HTTP port 80.

    Edit config.js.

    # nano config.js
    

    Change this line from 7777 to 80:

    "port": "7777",
    

    When finished, it should look like this:

    "port": "80",
    

    Save and exit the file.

Install PM2

PM2 is a process manager for Node.JS applications. PM2 monitors and restarts your application if it goes offline.

  1. Install PM2.

    # npm install pm2 -g
    
  2. Start your Hastebin server.

    # pm2 start server.js
    
  3. Save your PM2 configuration, and ask it to run at startup.

    # pm2 save
    # pm2 startup
    

Test the Hastebin Server

Navigate to your server's IP address in a browser to load an empty page, ready for you to paste code.

More Information

Want to contribute?

You could earn up to $600 by adding new articles


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK