Guerra
Guerra

Reputation: 2790

Share localhost on LAN, WAMP

I have a simple PHP project just php and apache, and i want to share this project on my localnetwork, how i can figure this out?

I've try some solutions founded here but can't make it work.

Someone have any ideia?

I've already change my httpd.conf from apache folder to:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

And changed:

Listen 80

to:

Listen 192.168.50.1:80

But don't work either.

Upvotes: 1

Views: 10018

Answers (1)

RiggsFolly
RiggsFolly

Reputation: 94682

Well change it all back.

This change allows access to the root directory of the drive you installed wamp onto. NOT A GOOD IDEA. S change it back to :

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

and also back to

Listen 80

Assuming you website is in c:\wamp\www and if your subnet is in fact 192.168.50 like you have used above the simple way to allow access to your site over the local network only is to change this part of httpd.conf

Look for

<Directory "c:/wamp/www/">
    #
    # 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.2/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:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1    
</Directory>

And change this part of that section

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost
    Allow from 192.168.50

the line Allow from 192.168.50 will allow access from any ip on that subnet i.e. 192.168.50.1 -> 192.168.255

If you put your site into a subfolder then do this:

<Directory "c:/wamp/www/">
    #
    # 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.2/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:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1 ::1 localhost
</Directory>

<Directory "c:\wamp\www\sitefolder">
    Options Indexes FollowSymLinks
    AllowOverride all
    Allow from 192.168.50
</Directory>

This will keep your wampserver homepage secure but allow access to the site in sitefolder to everyone in the local network.

Upvotes: 2

Related Questions