Virtual Host with MAMP
Asked Answered
C

2

1

I installed Drupal 8 with MAMP.
My MAMP preference number for Apache Port : 80 , Nginx Port: 80 and MySQL Port: 8889

In etc/hosts file, I add

127.0.0.1 mmcast.test

In httpd.conf file,

Listen 80 

and uncomment the following line.

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

In httpd-vhosts.conf file,

NameVirtualHost *:80

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

<VirtualHost *:80>
    ServerName mmcast.test
    DocumentRoot "/Applications/MAMP/htdocs/mmcast"
</VirtualHost>

When I call the site, I type mmcast.test:8888 and also try with mmcast.test:80.
However, nothing works! :(
Could someone help me please?
I've been trying this problem and still cannot solve.

Calculus answered 26/9, 2018 at 4:46 Comment(6)
Have you tried to access your url mmcast.test without port i.e mmcast.test ?Enow
Could happen to anyone, but have you restarted MAMP after making these changes? Also, define "nothing works". What error are you getting?Plexiglas
Are you sure that 127.0.0.1 is correct ip address? Try visiting site over ip address or pinging ip address.Friend
@Ritesh, Yes. I tried without port. It shows "The requested URL / was not found on this server." bro.Calculus
@TolgaOzses, bro whatever I make changes, I always restart MAMP. When I open the site without port or with 8888 or with 80. All are not workingCalculus
what is the output of localhost/mmcast?Gilson
A
0

in httpd.conf file

ServerName localhost:8888

has to be changed to

ServerName localhost:80

Aut answered 24/8, 2020 at 13:15 Comment(1)
It may resolve the issue but a little explanation to the answer in proper format make it more usable.Viperous
R
0

For Drupal 8 you need different settings for creating virtual host.

Here is the snippet that needs to be added for virtual host:

<VirtualHost *:8888>
  DocumentRoot "/Applications/MAMP/htdocs/site-name/web"
  ServerName local.site-name.com
  <Directory /Applications/MAMP/htdocs/site-name/web/>
    Options Indexes FollowSymLinks
    AllowOverride all
    RewriteEngine On
    RewriteBase /
  </Directory>
</VirtualHost>

So I access my local site as

local.site-name.com:8888

I have used default port, which is 8888. So above snippet is according to it.

You can refer this link from Drupal.org as well.

Rhyne answered 4/9, 2020 at 4:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.