Simply server manager for manage virtual hosts in nginx and Linux
C++ Shell Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.server-manager
src/ServerManager
.gitignore
LICENSE.md
Makefile
README.md
install.sh

README.md

ServerManager

Simply server manager for manage virtual hosts in nginx and Linux.

Requirements

  • ngnix configuration by this manual

Installation

  1. Run $ sudo sh install.sh [command-name]
  2. Default command name is server-manager but you can change this if run installation script with command name argument.
  3. And next you must edit /home/user/.server-manager/.server-manager config file and fill your paths and configuration.

You can update base templates or create custom in ~/.server-manager/templates. This files are templates for configuration. For more info see Template

If you want set directory automatically use htdocs=pwd

Usages

Important! Server manager must be run with sudo

$ sudo server-manager list [options]
$ sudo server-manager create <host-name> [options]
$ sudo server-manager remove <host-name> [options]
$ sudo server-manager search <host-name> [options]

Actions:

  • list - Display list of created virtual hosts
  • create <host-name> - Create a new virtual host with name
  • remove <host-name> - Remove virtual host and all project files
  • search <host-name> - Search if host with exist

Options:

Options has a higher priority than configuration in config file

  • --root - Path to server root
  • --tld - Set server tld
  • --htdocs - Set path to htdocs directory
  • --nginx - Set path to nginx sites-enabled directory
  • --hosts - Set path to hosts file (/etc/hosts)
  • --log - Set log directory (relative to root)
  • --systemTemplate - Set template for host in system hosts file
  • --serverTemplate - Set template for server (apache/nginx/...) configuration
  • --project - Set default git project repository link

All default configuration are in /home/user/.server-manager/.server-manager file and you can change it.

Templates

You can edit templates for system hosts and server virtual host configuration. You can create custom template too. In templates you can use keywords: %hostName, %tld%, %root%, %htdocs%. This keywords will be replaced by section in configuration file or by options with same name.

If you can add custom template you must edit in config file section serverTemplate or systemTemplate or you can use options --serverTemplate <path> and ---systemTemplate <path>.

Default options are: