0

Created a new Laravel project in htdocs in MAMP. Followed all the steps, added virtual hosts, changed conf file, etc/hosts, restarted mamp and my pc several times but I just can't get my virtual host to run.

however, when I am in the MAMP Dashboard I can navigate to my website -> website -> public and the default Laravel boilerplate page appears.

Has anyone had this issues with MAMP before? I gave up with XAMPP and Valet so it's my last chance here..

Specs High Sierra 10.13.5 on 2015 MBP, Composer version 1.6.5, php 7.2.7

httpd.conf

# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

httpd-vhosts

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /Applications/MAMP/htdocs
    ServerName localhost
</VirtualHost>


<VirtualHost *:80>
    DocumentRoot "Applications/MAMP/htdocs/website/public"
    ServerName website.dev
</VirtualHost>

etc/hosts

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
#255.255.255.255        broadcasthost
#::1             localhost

127.0.0.1 website.dev
Sougata Bose
  • 31,517
  • 8
  • 49
  • 87
asus
  • 1,427
  • 3
  • 25
  • 59
  • *but I just can't get my virtual host to run* as in? it did not show the website? is this path correct `DocumentRoot "Applications/MAMP/htdocs/website/public"` ? – Bagus Tesa Jul 13 '18 at 06:14
  • `This site can't be reached` is what is returned in the browser when I hit `website.dev `. I believe the path is correct unless I need a `/` or `~/` before it, but I did not see that in any examples.. – asus Jul 13 '18 at 14:29
  • using `/` means the path is started from the root, while without one means it is located relative to the `httpd` executable i believe.. can you try to use full path first? – Bagus Tesa Jul 15 '18 at 04:08

1 Answers1

1

website.dev is technically a public url, so the browser is looking for it on the internet I guess. I was trapped once in this dreadful situation. changing the name to something like website.local should solve your issue. It did for me.

Souvik Ghosh
  • 731
  • 8
  • 22