Virtual Host with MAMP

后端 未结 2 1378
说谎
说谎 2021-01-24 16:38

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

In etc/hosts<

相关标签:
2条回答
  • 2021-01-24 16:48

    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.

    0 讨论(0)
  • 2021-01-24 17:05

    in httpd.conf file

    ServerName localhost:8888

    has to be changed to

    ServerName localhost:80

    0 讨论(0)
提交回复
热议问题