willfarrell / dotVhosts

Lightweight VirtualHost manager for Mac.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.vhosts

Lightweight VirtualHost manager for Mac. A MAMP alternative.

Features

  • Add and modify localhost VirtualHosts
  • Autoload .vhosts files from project folders and instert them into global httpd-vhosts.conf

Alt text

Install

Run in Terminal: curl -s https://raw.github.com/willfarrell/.vhosts/master/boostrap.sh -o boostrap.sh && bash boostrap.sh && rm boostrap.sh

Requirements:

  1. Apache 2 (Built into Mac OS X)

Optional:

  1. Hosts.prefpane
  2. MySQL dev.mysql.com - Useful settings
  3. nginx brew install nginx
  4. 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.

users/username.conf

# 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>

Sample .vhosts File

# 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>

Flow of Information

Alt text

Terminal

Apache

sudo apachectl -k start
sudo apachectl -k restart
sudo apachectl -k stop

nginx

sudo nginx
sudo nginx -s stop

MySQL

sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop

Roadmap

  • port support
  • nginx support
  • debug on clean machine of clean install
  • yum package to monitor for new .vhosts files

About

Lightweight VirtualHost manager for Mac.


Languages

Language:PHP 82.4%Language:Shell 17.6%