Skip to content

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

Notifications You must be signed in to change notification settings

jimmygle/Virtual-Hosts-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages