Skip to content

Instantly share code, notes, and snippets.

@anhphamt
Last active March 20, 2019 15:40
Show Gist options
  • Save anhphamt/174467cca1df3d9625bfd1a4f10eed91 to your computer and use it in GitHub Desktop.
Save anhphamt/174467cca1df3d9625bfd1a4f10eed91 to your computer and use it in GitHub Desktop.
Configure Virtual Host XAMPP OSX

Open file /Applications/XAMPP/xamppfiles/etc/httpd.conf and uncomment

#Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
sudo nano /Applications/XAMPP/etc/extra/httpd-vhosts.conf
sudo nano /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

A sample virtual directory will be like below:

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
    <Directory "/Applications/XAMPP/xamppfiles/htdocs">
        Options Indexes FollowSymLinks Includes execCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

We also change the host file:

sudo nano /etc/hosts

XAMPP VirtualHost mappings

127.0.0.1 mysite.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment