How to setup virtual host using Wamp Server properly?

前端 未结 6 2162
名媛妹妹
名媛妹妹 2020-12-06 00:43

I need your help here in creating a virtual host in wampserver. In office I can create a virtual hosts but when I try to create in my laptop it doesn\'t work. I still can\'t

6条回答
  •  温柔的废话
    2020-12-06 01:13

    Method 1:

    in hosts file

    127.0.0.1   mysite
    ::1 mysite
    

    in C:\wamp64\bin\apache\apache2.4.23\conf\extra\httpd-vosts.conf file add your virtual host as follows

    
        ServerName mysite
        DocumentRoot ""
        ">
            Options +Indexes +Includes +FollowSymLinks +MultiViews
            AllowOverride All
            Require local
        
    
    

    Make sure vhost configuration is enable in httpd.conf file is enabled as follows C:\wamp64\bin\apache\apache2.4.23\conf\httpd.conf

    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf
    

    After you have changed configuration as above, restart all service in wamp and load website as follows http://mysite your local site should open.

    Method 2:

    In latest versions of wamp, you can do this configuration via webpage. Open localhost in your browser. You would see wamp welcome page.

    Down below under Tools, there is option to add virtual host. click on the link which would take you to add virtual host page.

    In Name of the host, enter your site name eg: mysite Under Complete absolute path of the VirtualHost folder, enter the path of your site.

    Save the config and restart all services. you should be able to open mysite with the link http://mysite

    As pointed in another answer, in newer versions of wam

提交回复
热议问题