1
votes

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.

2
Have you tried to access your url mmcast.test without port i.e mmcast.test ? - Ritesh
Could happen to anyone, but have you restarted MAMP after making these changes? Also, define "nothing works". What error are you getting? - Tolga Ozses
Are you sure that 127.0.0.1 is correct ip address? Try visiting site over ip address or pinging ip address. - MilanG
@Ritesh, Yes. I tried without port. It shows "The requested URL / was not found on this server." bro. - May Phyu
@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 working - May Phyu

2 Answers

0
votes

in httpd.conf file

ServerName localhost:8888

has to be changed to

ServerName localhost:80

0
votes

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.