PHP Apache Virtual Host Creator for WAMP
The first thing to do is config only three varables:
- The wamp's www path.
$www_dir = 'C:/wamp/www/';
- The
httpd-vhosts.conf
file location. Here, almost in all of the cases the only thing that changes is the version of apache.
$httpdVhosts = 'C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf';
- The apache service name. This might be
wampapache64
for 64 bits machines, orwampapache
for 32 bits.
$apache_service_name = 'wampapache64';
First, download the avhCreator
file from this repository.
Open the prompt (or similar) as Administrator and run this command:
cd /location/of/avhCreator/file php avhCreator <serverName> <publicFolder>
Parameter | Required | Default value | Description |
---|---|---|---|
serverName | yes | The name of the server that you want create. Ex.: myecommerce.app, myblog.app, ... |
|
publicFolder | no | public | The public folder for your server. Ex.: public, public_html, web, ... |
php avhCreator myblog.app public_htmlAnd then, go to http://myblog.app