Skip to content

Instantly share code, notes, and snippets.

@smohadjer smohadjer/vhost_mac.md
Last active Feb 16, 2020

Embed
What would you like to do?
Updating virtual host on Mac
  1. Uncomment the following line in httpd.conf located at /etc/apache2/ on Mac:
    # Virtual hosts
    #Include /private/etc/apache2/extra/httpd-vhosts.conf
    
  2. Add below snippet to /etc/apache2/extra/httpd-vhosts.conf:
    <VirtualHost *:80>
    ServerName html.launcher
    DocumentRoot "/Users/sm/Documents/ril/html.launcher/web"
    
    SetEnv DB_HOST         localhost
    SetEnv DB_USER         user
    SetEnv DB_PASS         pwd
    SetEnv DB_PORT         3306
    SetEnv DB_NAME         ril
    SetEnv SPACE_NAME      DEV
    
    <Directory "/Users/sm/Documents/ril/html.launcher/web">
    	DirectoryIndex index.php
    
    	AllowOverride All
    	Require all granted
    </Directory>
    </Virtualhost>
    
  3. Add the following to hosts file located at /etc on Mac:
    127.0.0.1   html.launcher
    
  4. Restart apache
    sudo /usr/sbin/apachectl restart
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.