npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vhostman

v0.0.9

Published

Node Virtual Hosting Manager

Downloads

5

Readme

Node Virtual Hosting Manager

This app will help with managing Websites under Nginx & PHP-FPM

Usage: [options] [command]

Node Hosting Manager - interactive hosting configurator

Options:

-V, --version              output the version number
-h, --help                 output usage information

Commands:

cv|create-vhost            Create vhost Nginx & Php-fpm config files
cl|client-list             List of clients directories
cwl|client-web-list        List of client websites
gfsp|get-free-socket-port  Get first free socket port
cav|create-all-vhost       Create all vhosts
le|letsencrypt             Run Certbot for selected domain

Installation

$ npm i -g vhostman

Alternavive the bad (but possible) way to install it if npm installation failed is bellow:

$ git clone https://github.com/thujer/node-vhostman
$ cd node-vhostman/
$ npm i -g .

Commands

Create VHOST (cv)

$ hostman cv
or
$ hostman create-vhost            

Shows client selection in interactive CLI menu.

Continue by pressing enter

? Select client: (Use arrow keys)
❯ < Create new client > 
  client-01-xxx 
  client-03-yyy 
  client-05-zzz 

On next step You can see Nginx template selection to make configuration from

? Select template: 
❯ nginx-comments 
  nginx-letsencrypt 
  nginx-proxy 
  nginx-ssl-letsencrypt 
  nginx-without-ssl 

In next step its needed to know domain which configuration is for

? Enter domain (domain.xy): (spsy.eu)

By pressing enter are configuration files for selected domain created in directories bellow:

  • /etc/nginx/sites-available: Configuraction for Nginx
  • /etc/nginx/sites-enabled: Symlink for web activation in Nginx
  • /etc/php/{PHP version dir}/fpm/pool.d: Listen configuration for PHP-FPM

App need root privilegs.

If config files exists, then print error and show configuration lines to screen and You can edit files manually

Last socket port is automattically incremented from last one and is used same value for Nginx and associated PHP listener

There is created bash script named "generate-letsencrypt.sh" to obtain ssl certificate in "bash" subdirectory of website.

If website doesn't have ssl certificate, it's needed to select template nginx-without-ssl before for the first time. Then You can run LetsEncrypt certification challenge.

If everything happend ok, You can see right symlink to live certificate files named "@ssl".

Then is possible to delete first time website config and use nginx-letsencrypt configuration template.

Don't forget to delete both configuration files before - Nginx/sites-available and PHP/pool.d

After Nginx and Php restart You can see green HTTPS status in website url line in browser.

Client list

$ hostman cl
or
$ hostman client-list

Shows list of client directories

Client directories are the first level directories in /var/www

Client web list

$ hostman cwl
or
$ hostman client-web-list

Shows CLI interactive menu to select client and shows client's domains (subdirectiries)

Get free socket port

$ hostman gfsp
or
$ hostman get-free-socket-port

Traverse all nginx configuration files in directory sites-available, read socket port number and get the greather one + 1

Create all vhosts

$ hostman cav
or
$ hostman create-all-vhost

Traverse all client directories and all domains (subdirectories) and create Nginx and Php configuration automatically

It's needed to remove all conflict configuration files before this action, otherwise it will not be created, but only printed to screen

Authors

See also the list of contributors who participated in this project.

Big thanks

Inquirer for CLI interactive menus

Commander for CLI application command interface

Bluebird Promises for Promisify interface

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • First idea was write just simple appliacation to automated creating of Nginx and PHP-fpm configuration
  • This project was inspirated by ISPConfig project website structure
  • Project was realized because some problems happens sometimes with ISPConfig delayed write to configuration files by crontab and I must debug this problems for many times.