Skip to content

Instantly share code, notes, and snippets.

@vikrantnegi
Created December 15, 2016 10:20
Show Gist options
  • Save vikrantnegi/88cbb4f03102295434b096a2a98ef82b to your computer and use it in GitHub Desktop.
Save vikrantnegi/88cbb4f03102295434b096a2a98ef82b to your computer and use it in GitHub Desktop.
Mac vhosts
sudo nano /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
    ServerName example.dev
    ServerAlias www.example.dev
    
    DocumentRoot "/Users/vikrant/Documents/projects/project_folder"
    ErrorLog "/private/var/log/apache2/example.local-error_log"
    CustomLog "/private/var/log/apache2/example.local-access_log" common
    ServerAdmin web@localhost.com

        <Directory "/Users/vikrant/Documents/projects/project_folder">
                Order allow,deny
                AllowOverride All
                Allow from all
                Require all granted
        </Directory>

</VirtualHost>

sudo nano /etc/hosts
127.0.0.1 example.dev
sudo apachectl restart
sudo mysql.server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment