Skip to content

Latest commit

 

History

History
executable file
·
65 lines (51 loc) · 3.42 KB

README.md

File metadata and controls

executable file
·
65 lines (51 loc) · 3.42 KB

PHP Apache Virtualhost creator

Logo
by Jose Luis Chafardet Grimaldi
[email protected]


A simple PHP script to create Apache virtualhosts based on Symfony 4 Console Component.

Please be aware that this script is not meant for production environments! 
I wrote it for development purposes.
(to speed up the process of configuring Apache).

Screenshot

ToDo

  • Create working console code

  • Changed display output for the results.

  • Add support for CentOS and Ubuntu based distributions

  • Add configuration file (for distro specific information)

  • Add counter to prioritize virtualhost loading (in which order the virtualhosts will be loaded by Apache / nginx)

  • Add virtualhost template

  • Parse virtualhost template and replace the variables with the input

  • Save Apache / nginx .conf file with the parameters given by the user to the proper directory

  • Enable site with a2ensite with Apache if needed(Ubuntu)

  • Add support for nginx - request by a good friend

  • Restart Apache/ nginx

  • Print to the screen the outcome of the process

  • Add variable in the configuration file to switch between Argument and Question based execution of the script.

  • Compile a .phar file and add it to bin/release folder

  • Add support for framework parameter (symfony, laravel only for now)

  • Add ability to determine "current server" IP address as to remove it from manually configuring it in the config file

  • Finish the CONTRIBUTING.md file

  • Finish the CODE_OF_CONDUCT.md file

Please note that the configuration loading prioritization will be
automatic, there will be no "manual" prioritization.
  
At least is not in the plans for any of the inmediate future versions.

Usage

From the console type:

bin/virtualhost create hostname directory(optional)

The script receives 2 parameters, one is mandatory hostname, and the second is optional folder

bin/virtualhost create hostname folder sample output (Includes a view of the parsed Apache / nginx configuration file):
With two parameters

If no second parameter is given, it will use the hostname for the folder name. sample output:
Without second parameter


  • Send questions through the issues tracker.
  • suggestions through pull requests (please describe the suggestion accurately and briefly.)