How to access my localhost from another PC in LAN?

前端 未结 4 1681
情歌与酒
情歌与酒 2020-12-06 01:10

I am using WAMP server to run my website. I am using Windows 7.

I created LAN between 2 PC and I want to access my localhost from the second PC.
Note that I am n

4条回答
  •  庸人自扰
    2020-12-06 01:33

    after your pc connects to other pc use these 4 step:
    4 steps:
    1- Edit this file: httpd.conf
    for that click on wamp server and select Apache and select httpd.conf
    2- Find this text: Deny from all
    in the below tag:

      
    
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.4/mod/core.html#options
        # for more information.
        #
        Options Indexes FollowSymLinks
    
        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   AllowOverride FileInfo AuthConfig Limit
        #
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
    #    Require all granted
    #   onlineoffline tag - don't remove
         Order Deny,Allow
        Deny from all
         Allow from 127.0.0.1
         Allow from ::1
         Allow from localhost
    
    

    3- Change to: Deny from none
    like this:

    
    
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.4/mod/core.html#options
        # for more information.
        #
        Options Indexes FollowSymLinks
    
        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   AllowOverride FileInfo AuthConfig Limit
        #
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
    #    Require all granted
    #   onlineoffline tag - don't remove
         Order Deny,Allow
        Deny from none
         Allow from 127.0.0.1
         Allow from ::1
         Allow from localhost
    

    4- Restart Apache
    Don't forget restart Apache or all servises!!!

提交回复
热议问题