Download the PHP package mfonte/hte-cli without Composer
On this page you can find all versions of the php package mfonte/hte-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mfonte/hte-cli
More information about mfonte/hte-cli
Files in mfonte/hte-cli
Package hte-cli
Short Description [H]andle [T]est [E]nvironment CLI tool to create and manage VirtualHosts that are compatible with github.com/mauriziofonte/win11-wsl2-ubuntu22-setup or with any LAMP stack based on Debian or Ubuntu, with Multi PHP-FPM support via mpm_event, proxy_fcgi, and fcgid Apache modules.
License MIT
Homepage https://github.com/mauriziofonte/win11-wsl2-ubuntu22-setup
Informations about the package hte-cli
Ubuntu/Debian compatible LAMP Test Environment Creator CLI Tool
Heads Up! This utility is intended to be used in combination with https://github.com/mauriziofonte/win11-wsl2-ubuntu22-setup Anyway, this utility can be used in any LAMP stack on Debian or Ubuntu , with Multi PHP-FPM support.
Screenshot of hte-cli create
Screenshot of hte-cli remove
Screenshot of hte-cli details
What is this utility for?
HTE stands for Handle Test Environment.
It eases the process of creating Test Environments on both Local or Staging environments, when using Apache on a multi PHP-FPM flavour.
Basically, this utility takes care of :
- creating a new VirtualHost for your.local.domain.tld
- configure the VirtualHost to work via php-fpm on the PHP version of User's Choice
- enable http/2 protocol and brotli compression
- configure the PHP fpm pool by adding a new specific configuration file for your.local.domain.tld, with some useful test environment presets.
Security
This tool is not intended to be used on internet-facing LAMP environments. It's intended to be used on local devices, or any other Cloud VM that is properly firewalled.
This is because this tool configures Apache and PHP with presets that are good only for local developing, testing and benchmarking.
For more informations, refer to LAMP Stack Hardening and Linux Security Bookmarks.
Installation
The easiest way to get started with Hte-Cli is to download the Phar files for each of the commands:
Global Composer Package
If you use Composer, you can install Hte-Cli system-wide with the following command:
Make sure you have the composer bin dir in your PATH
.
The default value should be ~/.composer/vendor/bin/
, but you can check the value that you need to use by running composer global config bin-dir --absolute
The HTE-Cli
Tool will then be available on $(composer config -g home)/vendor/bin/hte-cli
It is suggested to modify your bash profile to expand your $PATH
so that it includes the composer/vendor/bin
directory. To do so, you can modify your .bashrc
file by executing:
Composer Dependency
Alternatively, include a dependency for mfonte/hte-cli
in your composer.json file on a specific project. For example:
You will then be able to run Hte-Cli from the vendor bin directory:
You can then create some Bash Aliases for your convenience:
Git Clone
You can also download the Hte-Cli source, and run your own hte-cli
build:
Build setup is made possible via humbug/box. See Laravel Zero Doc for the internals of building a Laravel Zero app.
Environment Pre-requisites
As said before, this utility is intended to be used on Debian or Ubuntu , with Multi PHP-FPM support.
This means that you must configure your LAMP stack with these commands:
The important part is to:
- disable
mpm_prefork
module - disable all
php**
handler modules - enable all
php**-fpm
handler modules - enable
fcgid
,mpm_event
,proxy_fcgi
,http2
,brotli
modules
Usage
Create a new test LAMP Env
To create a new LAMP local testing/developing VirtualHost, run the HTE-Cli
tool with option create
.
In this example, the HTE-Cli
create has been aliased with the hte-create
command.
After the VirtualHost setup, you can easily modify your hosts
file by binding some.localdomain.test
to 127.0.0.1
Delete a Test Env created via HTE-Cli
To remove a LAMP local testing/developing VirtualHost previously created with HTE-Cli Tool, run the HTE-Cli
tool with option remove
.
In this example, the HTE-Cli
remove has been aliased with the hte-remove
command.
List all Test Envs created via HTE-Cli
To list all LAMP local environments previously created with HTE-Cli Tool, run the HTE-Cli
tool with option details
.
In this example, the HTE-Cli
details has been aliased with the hte-details
command.
Credits
A big thank you goes to Nuno Maduro and Owen Voke for their Laravel Zero micro-framework.