FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how to acces my localhost from another computer





glena
hey can someone teach me for example ill run xamp in my computer i would like to access my localhost from another computer with desame network as mine.. or shall we say we are connected to each other. how can i access it...

please teach me.. h0ping for a reply... thanks/
rvec
You have to change some settings in the apache config file. You could try to do a search for 127.0.0.1 and replace that by 192.168.*.* to let all pc's with an ip starting with 192.168. connect to it. On the other pc you have to type the ip of the server instead of localhost and it should work.
glena
thanks rvec ill try it...
rvec
I searched my apache config file and I think these are the values you have to change:
Code:
Listen 127.0.0.1:80

below that add your network ip:80 to listen to all inbound connections on that ip. Or set it to 0.0.0.0:80 to let it even listen on connections from outside your network.

If you also want to be able to access phpmyadmin search for something like this:
Code:
   <Directory "${path}/phpmyadmin">
        Options FollowSymLinks Indexes
        AllowOverride None
        Order deny,allow
        allow from 127.0.0.1
        deny from all
    </Directory>

and replace 127.0.0.1 by all
and delete the line deny from all
sonam
I have big problem in past on Win with configuration of my netvork (server is not Apache). I am solved this problem trought TCP/IP file with name hosts (without extionsion) in C:\WINDOWS\system32\drivers\etc. You can open it with Notepad. Your TCP/IP where is server must have 192.168.*.* (write any number for two second numbers *). Now, open hosts file on second computer and just write there below the name of site(s) (I am using multiple names each for one site). For example:

192.168.0.1 localhost
192.168.0.1 mysite
192.168.0.1 myfriendsite
192.168.0.1 somethingelse

Save and close. That's all. Now you can start to surf on your localhost. Of course, some problems can come out if your network is not Win properly seted.

Sonam
glena
can i ask if wer can i find dat?? thank u for ur help i really appreciate it
sonam
Quote:
can i ask if wer can i find dat??


If you ask me, then I don't understand question? Very Happy

Sonam
rvec
That only makes it more complicated. It's not needed here and the info I gave should suffice. You can ofcours use the hosts file to type "mysite" in the address bar instead of the ip but first you have to get the ip working. If that's working you can try the hosts file.
glena
rvec ive tried but it sems dont work.. wat will i type n the adres bar while using another computer??
rvec
the network ip of the server

Example:
the ip in the configuration of your (server)pc is 192.168.1.1
the ip in the configuration of your other pc is 192.168.1.2

Then in the apache config add the line
Code:
Listen 192.168.1.2:80



And possibly add this line to the C:\WINDOWS\system32\drivers\etc\hosts file on the second pc (not server)
Code:
192.168.1.1      mysite


If you are on the server you should still be able to connect to the site with localhost. If you are on the other pc you should be able to connect to the server with http://192.168.1.1 or if you added the line in the hosts file you can also connect with http://mysite


Note that you shouldn't use the ip you get when visiting a site like whatsmyip.com but the internal network ip.
glena
ive tried it but there is pop up and asking for a username and a password...
rvec
glena wrote:
ive tried it but there is pop up and asking for a username and a password...

When connecting from only the second pc or also when connecting from local host?

And are you sure you gave the right ip? Not the one of a router/modem? 192.168.1.1 as used in my example is mostly used by a modem or router and was only meant as an example. You have to find out your ip yourself.
glena
thanks i made it... thanks rvec for your great help...
gidevelop
I think XAMP is CRAP. I used to use xamp but now i use WAMP 2 server. One of the features is that you can turn it nline / offline veary easy. easy to configurate and easy to plug an email server. Very easy to add extra plug-ins. So returning to your main question i personaly think that wamp2 server is the best. I know that i haved the same problem. I am curently working on a game and i am develop it on my PC at HOME.. so how to work from my job place... WAMP2 . Just turn online and access http://your_ip_address. Good Luck !
glena
how did you turn it online??? heheheh
gidevelop
if u have WAMPserver installed just go to your tray icon > left click > put online. DONE. Than open a browser page and call your IP adress. GL !
Nik5592
gidevelop wrote:
if u have WAMPserver installed just go to your tray icon > left click > put online. DONE. Than open a browser page and call your IP adress. GL !


I have WAMP turned server online, tried to access via my other computer with my ip address, nothing. PLEASE HELP.

P.S. I can only access from my server computer. With ip address or localhost. gidevelop, i can give my ip if you want to check out.
rvec
that only works internally (if you're in the same lan as the server). If you have a modem between you and the server you have to turn on port forwarding. You can do this if you login to the modem/router over the web interface with most routers.
Asap170
Go on the computer that you can access at local host. Open up Command Prompt.

Start>All Applications>Accessories>Command Prompt

The type "ipconfig" it'll list three things. I believe it's the first one. and then go on another computer and type that IP Address in.
Nik5592
Yes the one i used is the top one, 192.168.1.43.
halilibo
just find your computers ip ( in lan ), then type that ip into the browsers address bar.

Finding the ip of computer:

1. Right click on the lan icon in system tray, and click the ( i think preferences, it must be ). (Using Turkish Windows, so i don't know the words. )

search for the ip, (192.168.X.X, 10.0.X.X)
Nik5592
We use a Belkin utility to connect, we also have a router.
valjasme18
rvec wrote:
that only works internally (if you're in the same lan as the server). If you have a modem between you and the server you have to turn on port forwarding. You can do this if you login to the modem/router over the web interface with most routers.


@rvec. please give me step by step process of setting LAN for 2 pc using wamp server. where the other pc can access the system in the first pc or server pc.. this is for my thesis.. please.. thank you so much in advance..
Fire Boar
valjasme18 wrote:
this is for my thesis


Um... if you need to ask for basic networking advice on a forum... you might want to consider choosing a different subject for your thesis.
jcreus
glena wrote:
how did you turn it online??? heheheh

Online? I suppose it *is* online, but only on your home network (aka your friend cannot access it). I suppose you should open the port 80 (dangerous, btw afaik) so that people can go to your ip in the browser. For a domain name, you must pay, I suppose.
sharathhere4u
Hey...
I am using centos 6. I have a lamp running in my centos. I want to access its localhost from my computer running a windows XP. I am able to ping the ip of my centos from my XP. but not able to get the local host of my centos.

I am trying to access my local host from my windows in this format:

90.0.0.*/localhost

I dont know know if its foolishness. I am not a techie so please excuse me.. Smile

Hope to get a reply soon.

Regards
Sharath
Fire Boar
Sharath,

"localhost" just means "this computer", and is an alias for the special loopback IP address 127.0.0.1. Talking about "the localhost of X" doesn't make much sense... what you really want is "the host X". To get there, simply enter the IP address of X.

When the two computers are on the same subnet (e.g. are behind a router), you need to use the local IP address. This has one of the following forms:

192.168.*.* (most common)
172.Z.*.* (where Z is between 16 and 31 inclusive)
10.*.*.*

Here * means "any number between 0 and 255". For instance, my computer's IP address on the LAN is 192.168.0.91. If I were to use any other computer on my network, I could access the web server running on 192.168.0.91 by visiting http://192.168.0.91/ in a browser. Note that the link will only work for someone on my LAN.

So where does localhost come in? From the computer on which the web server is running, I can visit http://localhost/ to get the same results. Or equivalently, http://127.0.0.1/ also works.
beginner
rvec wrote:
the network ip of the server

Example:
the ip in the configuration of your (server)pc is 192.168.1.1
the ip in the configuration of your other pc is 192.168.1.2

Then in the apache config add the line
Code:
Listen 192.168.1.2:80



And possibly add this line to the C:\WINDOWS\system32\drivers\etc\hosts file on the second pc (not server)
Code:
192.168.1.1      mysite


If you are on the server you should still be able to connect to the site with localhost. If you are on the other pc you should be able to connect to the server with http://192.168.1.1 or if you added the line in the hosts file you can also connect with http://mysite

Note that you shouldn't use the ip you get when visiting a site like whatsmyip.com but the internal network ip.


Hi, Rvec please where can i find the apache config to add the ip of the other computer?
ogah
if we have dedicated ip. posible or not if we want make our localhost online?
ron_n_beau
glena wrote:
hey can someone teach me for example ill run xamp in my computer i would like to access my localhost from another computer with desame network as mine.. or shall we say we are connected to each other. how can i access it...

please teach me.. h0ping for a reply... thanks/

You don't need to change any settings on your machine to access it with another computer on your local network, you just have to find your IP on the local network. You may possibly have to change one setting on Apache, but likely not. If you have to, ask your network admin what you IP is. Your network monitor or network card settings may supply that answer too.
suzondas
Hi all.
I am a software developer but novish in networking. Now a days I am going to set a computer as a server and want to make a lan connection with some other pc. I will setup some software on server pc wihich will run on like -1. localhost : 80
2. localhost : 9000
3. localhost/jspui
these are properly run in server pc's browser. I want that when I enter this address of other pc's browser conneted with lan , the browser should show exact that server pc shows. Please help me in details..
Marcuzzo
The answer is alreay in this topic.

What I do is

On the serving machine:
1. Create a virtual host in apache
2. Add the virtual host to the Windows hosts file.

On the connecting machine:
1. Add the ip address of the Server and the servername of the virtual hosts to the hosts file.


That's it
Related topics
how to set up a server
Anyone use MySQL Administrator 1.1.2?
My hard drives CD-ROm cannot read
Computer won't route
Personal Web Server?
computer froze... external not working
The last foolish PHP/MySQL Question of the Year....
Problems on LAN with Apache using XAMPP
Networking question
VGA cable shielding?
Remove Log Off and Turn Off Computer from Start Menu
HDD Problem!
httpd.conf (Virtual Hosts Problem) Please help
computer freezes during boot-up
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.