Lightweight VirtualHost manager for Mac. A MAMP alternative.
- Add and modify localhost VirtualHosts
- Autoload
.vhosts
files from project folders and instert them into globalhttpd-vhosts.conf
Run in Terminal: curl -s https://raw.github.com/willfarrell/.vhosts/master/boostrap.sh -o boostrap.sh && bash boostrap.sh && rm boostrap.sh
Requirements:
- Apache 2 (Built into Mac OS X)
Optional:
- Hosts.prefpane
- MySQL dev.mysql.com - Useful settings
- nginx
brew install nginx
- redis redis.io
##.vhosts File
You can add a .vhosts file into the root of your project directory and it will automatically be loaded into your VirtualHosts the next time you visit http://vhosts.localhost
. Project folders in ~/Sites
are scanned by default, you can add a custom one by adding to the dirs
array in json/config.json
. __DIR__
will automatically be replaced with the project directory.
# Defaults applied to all directories listed in json/config.json['dirs']
<Directory "/Users/username/.vhosts">
Options Indexes MultiViews Includes ExecCGI
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
# VirtualHosts for Yeoman projects
<VirtualHost *>
ServerName yeoman
DocumentRoot __DIR__
</VirtualHost>
<VirtualHost *>
ServerName app.yeoman
DocumentRoot __DIR__/app
</VirtualHost>
<VirtualHost *>
ServerName dist.yeoman
DocumentRoot __DIR__/dist
</VirtualHost>
<VirtualHost *>
ServerName test.yeoman
DocumentRoot __DIR__
<Directory>
DirectoryIndex test/e2e/runner.html
</Directory>
</VirtualHost>
sudo apachectl -k start
sudo apachectl -k restart
sudo apachectl -k stop
sudo nginx
sudo nginx -s stop
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
- port support
- nginx support
- debug on clean machine of clean install
- yum package to monitor for new .vhosts files