Reputation: 389
I installed MAMP v3.2.1 on my new MacBook Pro running OSX Yosemite (10.10.3).
localhost is running as expected, I can browse http://localhost
, no problem.
However, something is amiss with my named virtualhost - when i browse to the site I get a 404. EDIT: I'm now seeing 'This webpage is not available - ERR_CONNECTION_TIMED_OUT' (in Chrome)
I've read and checked other threads on similar issues, but none of them has so far resolved my issue. I'm hoping somebody can help me, as I'm now totally stuck.
Here's what I've done and tried:
In /private/etc/hosts
127.0.0.1 mysitename.dev
::1 mysitename.dev
And in /Applications/MAMP/conf/Apache/httpd.config
, uncommented to include the virtualhosts file in extra/httpd-vhosts.conf
And added the directive in the vhosts file like so:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot “/Users/myName/Sites/mysitename“
ServerName mysitename.dev
ServerAlias mysitename.dev
</VirtualHost>
I changed MAMP Apache settings to listen to port 80 (and checked httpd.config
for the line Listen 80
(I think MAMP updates this?)
I've checked and double checked the paths to folders, checked for typos...even double checked that the index.html file exists.
When i look at the Apache log, I don't see anything untoward, although I probably wouldn't be able to tell if there was(!?)
I haven't explicitly 'turned off' the Mac's own Apache server, because I haven't turned it on (should I? But my localhost is working with MAMP, so...)
I'm a Mac-novice - you could say I'm having some teething problems! Any help or suggestions in the right direction would be much appreciated.
Thanks in advance.
P.S.
I just ping'd mysitename.dev
and got
--- mysitename.dev ping statistics ---
132 packets transmitted, 132 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.039/0.096/0.294/0.042 ms
I got similar results from pinging localhost
(no timeout messages), so I assume it's good, but I'm still lost...
Upvotes: 0
Views: 1189
Reputation: 55
I was caught out by the formatting issue as stated above. The example I used was using “
around the document root instead of "
.
Upvotes: 0
Reputation: 76
I believe this is a quotation mark formatting issue. Look how quotation marks on your DocumentRoot are formatted differently from the DocumentRoot in the default example. To make sure the formatting is correct just copy the correct quotation mark character from the example DocumentRoot and paste it over the your DocumentRoot quotation marks. This issue can come up when text is copy-pasted from one place to another.
Upvotes: 2