@jfitzi/vhost-cli-tool
v0.1.1
Published
A cli tool that lets you create and delete apache vhost files on the fly. Heavily inspired by the awesome RoverWire/virtualhost bash script I've been using for years.
Downloads
4
Maintainers
Readme
vhost-cli
A cli tool that lets you create and delete apache vhost files on the fly. Heavily inspired by the awesome RoverWire/virtualhost bash script I've been using for years.
Note Likely currently only works on Linux (I've only tested it on Ubuntu 20.04 so far). Currently, also only works with Apache2.
Usage
vhost create <name>
vhost delete <name>
All configurations can be overridden by flags and options, see vhost --help
for details.
Configuration
The tool checks three paths for config files:
/etc/vhost-cli.conf
$HOME/vhost-cli.conf
/home/(process.env.SUDO_USER || process.env.USER)/vhost-cli.conf
Each path overwriting the previous one.
The third path is mainly checked because during testing $HOME
was set to /root
instead of the
calling users home dir.
Example config
{
"serverAdmin": "admin@{name}.local",
"serverName": "{name}.local",
"serverAlias": "{name}.dev",
"documentRoot": "/var/www/{name}/public",
"projectRoot": "/var/www/{name}",
"confName": "{name}.conf",
"confPath": "/etc/apache2/sites-available",
"templatePath": "/path/to/template.tmpl",
"user": "your_username",
"group": "www-data",
"localIp": "127.0.0.1"
}
{name}
can be used in any property and will be replaced by the name provided via cli.
user
defaults to process.env.SUDO_USER || || process.env.USER