Reputation: 151
I've went through all the posts I could find here, still couldn't get this to work:
I Have a Windows 10 + MAMP.
MAMP is set to folder C:/MAMP/htdocs as the root folder
I un-commented the Virtual host line on the httpd.conf:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Added :
<VirtualHost *:80>
DocumentRoot "C:/MAMP/htdocs/team/example"
ServerName dev.example.com
ServerAlias dev.examplecom
</VirtualHost>
into httpds-vhosts.conf to the extra folder (under conf)
added the following to my hosts file:
127.0.0.1 dev.example.com
I Can get to localhost, But every time I try a domain, it gices me: Not Found (The requested URL / was not found on this server.)
I'm pretty sure I am missing something small, But will greatly appreciate a solution to this.
So far i tried changing the Path in the conf files. Tried using relative paths rather than absolute. Tried any idea I could find onlie,
Thanks, and a happy new year :) Cheers.
Upvotes: 4
Views: 5372
Reputation: 112
I don't have enough points to comment on James's answer, but this is another quirk of the Windows environment:
In the hosts file, Windows wants two lines for each virtual host:
127.0.0.1 dev.example.com
::1 dev.example.com
Upvotes: 0
Reputation: 1
Not sure if this question is still relevant but I was having the exact same problem setting up my Virtual Host recently and I was receiving the: Not Found (The requested URL / was not found on this server.). The solution for me was to write it as the following:
<VirtualHost *:80>
DocumentRoot C:/MAMP/htdocs/team/example
ServerName dev.example.com
ServerAlias dev.examplecom
</VirtualHost>
Without the quotations around the DocumentRoot. Seems both simple and dumb but it worked for me. Make sure to restart the Mamp Servers again!
Upvotes: 0
Reputation: 121
I didn't see you mention anything about SymLink, maybe that's what you're missing to make it work.
Find this line in that same C:\MAMP\conf\apache\httpd.conf
file.
<Directory />
Options FollowSymLinks ExecCGI
AllowOverride none
Order deny,allow
Allow from all
</Directory>
Change AllowOverride
from none to all
<Directory />
Options FollowSymLinks ExecCGI
AllowOverride all
Order deny,allow
Allow from all
</Directory>
Although I'm late to the party, hope that helps.
Also make sure to restart the servers on MAMP after making any changes! If you don't reset the server to apply the changes, nothing will work even though you know you've done everything right.
Upvotes: 2
Reputation: 1706
Changing the line from Include conf/extra/httpd-vhosts.conf
to Include C:/MAMP/conf/extra/httpd-vhosts.conf
worked for me.
It seems that httpd.conf
requires absolute paths
Upvotes: 4