Apache VirtualHost and localhost

后端 未结 11 1048
广开言路
广开言路 2020-12-07 09:48

I\'m working with XAMPP on Mac OS X.

I\'m trying to run a Symfony website properly for a client, and I really don\'t know Symfony (yet). I just want to install and la

11条回答
  •  旧时难觅i
    2020-12-07 10:27

    I had the same issue of accessing localhost while working with virtualHost. I resolved it by adding the name in the virtualHost listen code like below:

    In my hosts file, I have added the below code (C:\Windows\System32\drivers\etc\hosts) -

    127.0.0.1   main_live
    

    And in my httpd.conf I have added the below code:

    
        DocumentRoot H:/wamp/www/raj/main_live/
        ServerName main_live
    
    

    That's it. It works, and I can use both localhost, phpmyadmin, as well as main_live (my virtual project) simultaneously.

提交回复
热议问题