Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ahmdadl/vhost

simple and easy composer Library to create virtual hosts as cli app
https://github.com/ahmdadl/vhost

cli cli-app composer hosts hosts-file php7 symfony-console virtual-hosts windows xammp

Last synced: about 1 month ago
JSON representation

simple and easy composer Library to create virtual hosts as cli app

Awesome Lists containing this project

README

        

# :computer: Virtual Hosts Cli
Create Virtual Hosts for apache with one click

## :wrench: Installation
Install with Composer as global for best perfomance
```
composer global require abo3adel/vhost
```
#### :heavy_exclamation_mark: Reqirements:
* php: 7.3 or newer
* symfony/console: 3.4.23

## :sparkles: Usage
**:heavy_exclamation_mark: Note:** Run as Administrator

![trailer image](https://github.com/abo3adel/vhost/blob/master/trailer.gif)

There are two ways:
### :fax: Options Way:
```ps
C:\xampp\htdocs\project> vhost add -s "project.test"
Creating Virtual Host From this data
========================================

------------------------------------------------------------
ServerName project.test
------------------------------------------------------------
DocumentRoot "C:\xampp\htdocs\project"
------------------------------------------------------------
ServerAdmin
------------------------------------------------------------
ServerAlias
------------------------------------------------------------
ErrorLog ""
------------------------------------------------------------
CustomLog ""
------------------------------------------------------------

Existing Application, GoodBuy.
```

#### All Avaliable options:

* add [-s|--server **[Server Name]**] **[Required]**
* [-d|--dir [Path to Server Directory]] **[Optinal]** Defaults to **CurrentDirectory**
* [-a|--admin **[Admin Email]**] **[Optinal]**
* [-l|--alias **[Server Alias]**] **[Optinal]**
* [-e|--error-log **[Error Log]**] **[Optinal]**
* [-c|--custom-log **[Custom Log]**] **[Optinal]**
```ps
C:\xampp\htdocs\project> vhost add -s "project.test" -d "C:\xampp\htdocs\someOtherApp" -a "[email protected]" -l "dev.preoject.test" -e "path/to/error/file.log" -c "path/to/custom/file.log"
```
---
### :gift: Interactive Mode:
```ps
C:\xampp\htdocs\project> vhost i

Creating Virutal Host From this data
====================================

Server Name ["project.com"]:
>

Server Directory ["C:\xampp\htdocs\project"]:
>

Server Admin Email []:
>

Server Alias []:
>

Error Log File []:
>

Custom Log File []:
>

```

## TODO:
* support linux and macOs