1

I'm trying to create a MAMP virtualhost so that I can use my laravel project easier, but whatever I do I get " Not Found The requested URL / was not found on this server " when entering localhost or my vh name (cms.dev)

I tried this : How to create virtual hosts in MAMP? And this : http://eppz.eu/blog/virtual-host-for-mamp-on-osx/

Even reinstalled MAMP and I still have the same issue, I did everything the same way it's shown in these articles.

Here's my httpd-vhosts.conf config :

   #
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/Desktop/MAMP"
    ServerName localhost
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/Desktop/MAMP/cms/public"
    ServerName cms.dev
    ErrorLog "logs/dummy-host2.example.com-error_log"
    CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

Do you guys know what's happening ???

Thanks

Community
  • 1
  • 1
naspy971
  • 1,137
  • 2
  • 13
  • 31
  • Are your `DocumentRoot` paths correct? – gmc Apr 09 '17 at 23:47
  • Well, that's actually the folder of my projects so I guess it's okay – naspy971 Apr 10 '17 at 03:00
  • Really? In your MacOS you have a `Desktop` folder right under `/`? That seems strange.. are you sure it shouldn't be `/Users/youruser/Desktop/...`? If so, in principle the apps should be in the `Applications` folder... – gmc Apr 10 '17 at 10:07
  • Actually before I edit the this line the path was /Application/MAMP..... so guess Desktop is at the same level than Application, am I wrong ? – naspy971 Apr 10 '17 at 11:33
  • You are wrong. Applications is right under /, but the Desktop is under you user folder: `/Users/[yourusername]/Desktop` – gmc Apr 10 '17 at 11:41
  • I guess it might be the issue, I'll try later and let you know, thanks ! – naspy971 Apr 10 '17 at 16:16
  • Just tried it, and this actually works ! My path was wrong, thanks a lot ! – naspy971 Apr 14 '17 at 02:28

1 Answers1

1

Your DocumentRoot paths are wrong. In MacOS, the Desktop folder is in /Users/[yourusername]/Desktop.

gmc
  • 3,910
  • 2
  • 31
  • 44