Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, Apologies if this question is out of contest for this forum but I have seen some similar posting and hence taken the privilege to post it here. I have created a webpage which I have been accesing it from the same computer running the webserver (APACHE) using the address http://localhost:8080/factorScan_html/main.html Now that the construction phase is over, I wanted this to be accessed from different computer but within the organisation. Can any one please advice me how to do this. I have no experience with setting up webservers (nor do we have a sysadmin. Work in a biological lab). Any advice would be highly appreciated. Thanks NCL

2005-09-06 Retitled by Arunbear, as per Monastery guidelines
Original title: 'Webserver settings'

Replies are listed 'Best First'.
Re: (OT) Webserver settings
by pg (Canon) on Sep 06, 2005 at 03:54 UTC

    You have to somehow configure your server to listen on the ip of the server, not localhost.

    A quick testing shows that, it will not work otherwise, although you can access from localhost.

    server.pl

    use IO::Socket::INET; my $s = IO::Socket::INET->new(Proto => "tcp", LocalAddr => $ARGV[0], L +ocalPort => 8080, Listen => 10) || die "failed"; $s->accept(); print "accepted\n";

    client.pl

    use IO::Socket::INET; my $c = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $ARGV[0], Pe +erPort => 8080) ||die "failed";

    Say the name of your computer is Blah. Then:

    perl -w server.pl localhost perl -w server.pl Blah
    perl -w client.pl localhost Works Doesn't work
    perl -w client.pl Blah Doesn't Work Works
      Thanks very much for the script. I tried this with the following out come perl -w server.pl localhost outcome: failed perl -w server.pl valera outcome: failed perl -w client.pl localhost outcome: accepted perl-w client.pl valera outcome: accepted Was this an expected outcome? Thanks NLC
Re: (OT) Webserver settings
by johnnywang (Priest) on Sep 06, 2005 at 03:24 UTC
    No change on the webserver, find the ip address of your machine (ipconfig on windows, or ifconfig on linux), say 192.168.168.20, and ask people to access it as: http://192.168.168.20:8080/factorScan_html/main.html

      Not really. Looks like his web server is listening at port 8080 of localhost, not the server's IP on the network. he has to change his program, or configure it to listen on the server's network address.

      I tried this but it does not work, Thanks
        If you can access it via localhost but not via your ip address, it mostlikely means your server is binding to 127.0.0.1 instead of any. Take a look at http.conf, you probably had "Listen 127.0.0.1:8080", change that to "Listen 8080", you can then access it via your ip address.