jimmygle / Virtual-Hosts-Helper

Simple bash script to add entry to vhosts and hosts file for local web environments like MAMP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Virtual Hosts Helper

Note: I recommend using Vagrant/Homestead instead of MAMP these days.

Simple bash script to add entry to vhosts and hosts file for local web environments like MAMP.

Setup

  1. Open up vhosts.sh in a text editor to check configuration.

  2. Check web_root_path is path to local web root. Example: /Users/name/Sites/

  3. Check vhost_path is correct path to your vhosts file. Example: /Applications/MAMP/conf/apache/vhosts.conf

  4. Check apache_restart contains correct path to apachectl. Example: "/Applications/MAMP/bin/apache2/bin/apachectl restart

  5. Check apache_port is the correct port for apache. Default: 8888

  6. Verify vhosts block contains correct configuration (line 58)

Usage

Run as root: sudo sh vhosts.sh

  1. Enter desired local domain. Example: newproject.local

  2. Enter desired directory new local domain points to. Example: newproject

  3. Test new local domain in browser. Example: http://newproject.local:8888/

About

Simple bash script to add entry to vhosts and hosts file for local web environments like MAMP


Languages

Language:Shell 100.0%