Add a development domain (.dev) in MAC XAMPP

I was trying laravel PHP framework and setup a laravel.dev domain for testing.

Here are the high level steps on how I did it.

  1. add domain in host file
  2. enable virtual host in XAMPP
  3. add virtual host in XAMPP

Environment

  1. XAMPP for MAC 1.7.3 – Apache, MySQL, phpMyAdmin,
  2. Gas mask 0.6
  3. Mac OS X 10.8.2

1. Add domain in host file

We can manually locate the host file and add the domain. But using Gas mask is a lot easier and it simply works!

  • download gas mask
  • install gas mask
  • open gas mask
  • create new local host file (I used ‘dev’)
  • add the development domain you like to use

      127.0.0.1    laravel.dev
    
  • save

  • create new combined host file
  • add rignial File
  • also add dev (new created) local host file

gas-mask

  • save
  • activate

2. Enable virtual host in XAMPP

etc

  • goto /Applications/XAMPP/xamppfiles/etc/
  • open httpd.conf
  • find the following and remove #

      #Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
    
  • save

3. Add virtual host in XAMPP

  • goto /Applications/XAMPP/xamppfiles/etc/extra/
  • edit httpd-vhosts.conf
  • uncomment the existing vhosts except

      NameVirtualHost *:80
    
  • add the following

      <VirtualHost *:80>
          ServerName localhost
          DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
      </VirtualHost>
    
      <VirtualHost *:80>
          DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/laravel/public"
          ServerName laravel.dev
          <Directory "/Applications/XAMPP/xamppfiles/htdocs/laravel/public">
              Order allow,deny
              Allow from all
          </Directory>
      </VirtualHost>
    
  • save

  • restart Apache

Test

  • open browser of your choice
  • visit

      http://laravel.dev/
    
  • see the beautiful larval welcome page

More

  • Horst‘ is an alternative to ‘gas mask’
  • read vhosts manual at apache

Readings

Advertisements

1 thought on “Add a development domain (.dev) in MAC XAMPP”

  1. Z wykorzystaniem wystawy medialnej, zielonych ziaren kawy apendyksów
    ubytek veight Ekstrakt pozyskała tkliwe powitanie pośród konsumentów, jacy zmagają
    się z nadwagą. Gdy wiadomo, nadwyżka masy ciała przewodzi
    aż do długiej listy chorób zagrażających mieszkaniu, wskutek tego grunt istnieje, żeby znajdować się

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s