How to access site running apache server over lan without internet connection
Asked Answered
O

11

39

I am running a server on Windows XP SP2 computer using EasyPhp. Lets call it computer_1. The ip address of computer is 192.168.1.2

Now I have another computer ( computer_2) on the lan with ip address 192.168.1.3

I want to access the site on computer_1 from computer_2.

comupter_2 can ping computer_1 (ping 192.168.1.2 works)

But when I type http://192.168.1.2 in the browser of computer_2, nothing happens.

I want to access the site on comupter_1 from computer_2.

Orvieto answered 13/5, 2009 at 12:50 Comment(2)
What port is easyphp running on? Is there a firewall on the server?Pamella
As you commented that one of the posters below sufficiently solved the issue - please mark that answer as the accepted one.Jene
O
56

In your httpd.conf make sure you have:

Listen *:80

And if you are using VirtualHosts then set them as given below:

NameVirtualHost *
<VirtualHost *>
   ...
</VirtualHost>
Olivarez answered 13/5, 2009 at 13:4 Comment(4)
@duckyflip.. I did not find httpd.conf in my configuration. Can you please tell me where can I find this file. I am having the same issue..Disinclined
@Disinclined watch out for a ports.conf in newer apache 2.4Tyne
Please where to find the virtual host after installation ? I checked through easyphp folder but could not see it.Quarterback
@Disinclined - try looking for apache2.conf insteadCelia
C
32

Open httpd.conf of Apache server (backup first) Look for the the following : Listen

Change the line to

Listen *:80

Still in httpd.conf, look for the following (or similar):

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

Change this block to :

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

Save httpd.conf and restart apache

Open port 80 of the server such that everyone can access your server.

Open Control Panel >> System and Security >> Windows Firewall then click on “Advance Setting” and then select “Inbound Rules” from the left panel and then click on “Add Rule…”. Select “PORT” as an option from the list and then in the next screen select “TCP” protocol and enter port number “80” under “Specific local port” then click on the ”Next” button and select “Allow the Connection” and then give the general name and description to this port and click Done.

Restart WAMP and access your machine in LAN or WAN.

Coff answered 3/6, 2012 at 8:3 Comment(0)
T
11

* Don't change anything to Listen : keep it as it is..

1) Open httpd.conf of Apache server (backup first) Look for the the following :

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

and also this

<Directory "cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

2) Now From taskbar :

Click on wamp icon > Apache > Apache modules > apache_rewrite (enable this module)

And Ya Also Activate "Put Online" From same taskbar icon

You need to allow port request from windows firewall setting.

(Windows 7)

Go to control panel > windows firewall > advance setting (on left sidebar)

then

Right click on inbound rules -> add new rule -> port -> TCP (Specific port 80 - if your localhost wok on this port) -> Allow the connections -> Give a profile name -> ok

Now Restart all the services of Apache server & you are done..

Tympan answered 27/10, 2012 at 12:59 Comment(0)
B
3

if you did change the httpd.conf file located under conf_files folder, don't use windows notepad, you need a unix text editor, try TED pad, after making any changes to your httpd.conf file save it. ps: if you use a dos/windows editor you will end up with an "Error in Apache file changed" message. so do be careful.... Salam

Brisesoleil answered 22/10, 2011 at 20:7 Comment(0)
T
2

nothing to be done for running your wamp sites to another computer. 1. first turn off the firewall. 2. Set Put Online in wamp by clcking in wamp icon at near to clock.

Finally run your browser in another computer and type http:\ip address or computer name e.g. http:\192.168.1.100

Thallium answered 17/2, 2012 at 7:17 Comment(2)
Suggest improvement to not to disable firewall completely as it is huge security risk.Dishwater
@SandeepGaadhe Not necessarily a risk, for example one could have a hardware firewall protecting the whole network.Orphanage
A
1

Your firewall does not allow any new connection to share information without your consent. ONLY thing to do is give your consent to your firewall.

  1. Go to Firewall settings in Control Panel

  2. Click on Advanced Settings

  3. Click on Inbound Rules and Add a new rule.

  4. Choose 'Type Of Rule' to Port.

  5. Allow this for All Programs.

  6. Allow this rule to be applied on all Profiles i.e. Domain, Private, Public.

  7. Give this rule any name.

That's it. Now another PC and mobiles connected on the same network can access the local sites. Lets Start Development.

Amylaceous answered 4/5, 2018 at 8:57 Comment(0)
S
0

Please reformulate your question. Your first sentence does not make sense. .

To address your question:

http://ip.of.server/ should work in principle. However, depending on configuration (virtual hosting) only using the correct host name may work.

At any rate, if you have a network, you should properly configure DNS, otherwise all kinds of problems (such as this) may occur.

Snavely answered 13/5, 2009 at 12:55 Comment(0)
S
0

You might also want to check your server configuration - sometimes the default for development type servers is to only accept connections from localhost.

Scutch answered 13/5, 2009 at 12:59 Comment(1)
Thats determined by the "Listen" setting (see above). Listen 127.0.0.l:80 -> only localhost Listen *:80 -> all network interfacesSnavely
E
0
  1. Open the "internet protocol properties" section on computer_2.
  2. Enter the ip address (192.168.1.2) of computer_1 in "Preferred DNS server" text box and click ok and close the dialog box.

Now try to open the website again on computer_2.

Empiricism answered 8/6, 2012 at 10:58 Comment(0)
G
0
  1. navigate to C:\wamp\alias.
  2. make file with project name and like phpmyadmin.conf
  3. add the following section and change :

    Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all

change directory to your directory path like c:\wamp\www\projectfolder

  1. make sure you make the same in httpd.conf for all directory like first directory:

    Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all

second directory:

<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.0/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
    Allow from all

</Directory>

<Directory "icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Gurnard answered 16/5, 2013 at 7:53 Comment(0)
D
0

I was trying to access my localhost website (on my pc) from my mobile (andriod). The configuration is like Windows 10, WAMP 2.4.23, PHP Website and my mobile was running on andriod. Both my mobile and pc are connected to same wifi.

I was able to open my website on my pc by using url http://localhost/mysite or http://127.0.0.1/mysite. My pc ip was 192.168.0.1 (say) and my mobile ip was 192.168.0.2 (say) and both connected on same wifi.

I tried all the setting like changing the httpd.conf, httpd-vhosts.conf only to find that all I need was to disable my firewall. Of course, disabling the firewall completely is not a good idea. I have avast antivirus running on my pc. If I check the firewall log for last one hour (or so) I can see that attempt has been made by my mobile ip to connect to website running on my pc. All it required was to add an exception by creating a new rule in avast UI which will allow connections from my mobile ip.

Hope this helps someone.

Dishwater answered 20/9, 2017 at 3:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.