Virtual hosts not working on MAMP

后端 未结 8 1509
被撕碎了的回忆
被撕碎了的回忆 2021-01-12 04:25

I am running into virtual hosts setup issues on MAMP. Here is my vhosts config

8条回答
  •  感情败类
    2021-01-12 05:05

    When I first test virtual host (example.dev) I added two slightly different index.php files its directry and to localhost directory (/htdocs). My virtual host would redirect to locahost, I would know because the index.php would be the one in /htdocs. Similar to what user6166 said, I changed the code below to match the 8888 and it worked! I test example.dev:8888 and it works.

     NameVirtualHost *:8888
    
    
        ServerName dev.local.com
        DocumentRoot /Applications/MAMP/htdocs/local
        ServerAlias dev.local.com
    
    
    
        DocumentRoot /Applications/MAMP/htdocs
        ServerName localhost
    
    

    Then to remove 8888 change above back to 80 and MAMP preferences to:

    Apache Port:80
    Nginx Port:8888
    mySQL Port:3306
    

    Then inside httpd.conf change below to 80:

    Listen 8888
    ServerName localhost:8888
    

    Hope that helps someone, it definely fixed my problem!

提交回复
热议问题