Access xampp from other computers within LAN

Alles, was den Apache betrifft, kann hier besprochen werden.

Access xampp from other computers within LAN

Postby amagrace » 11. August 2009 04:47

Hi,
I know a similar question (http://community.apachefriends.org/f/viewtopic.php?f=16&t=35928&start=0&hilit=host+name)has been asked but I have a different concern.

I have a similar situation as described in the above thread. I am running xampp in one of my computer (hostname = mypc) and would like to access the web from another computer within the local network. I can http://mypc/ to access it without problem.

However, somewhere in the application (Gallery2) it is coded a global constant
Code: Select all
$storeConfig['hostname'] = 'localhost';
. Here and there the application use this value to construct the url to its components and this gives http://localhost/gallery2/....

This creates no problem when I test run it on the server machine. But when I am accessing it over the network, such address gives error. However, I do not want to modify the application configuration file to change 'localhost' to 'mypc' because it becomes less portable, and creates headache during application upgrade.

Is there a way to recognize the xampp server both by hostname as well as 'localhost'?

Thanks in advance

Fred
amagrace
 
Posts: 1
Joined: 11. August 2009 04:25

Re: Access xampp from other computers within LAN

Postby Wiedmann » 11. August 2009 08:40

Is there a way to recognize the xampp server both by hostname as well as 'localhost'?

No. "localhost" is always, like the name says, the own pc. (a basic tcp/ip rule, and nothing wie can change in XAMPP)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Access xampp from other computers within LAN

Postby Nobbie » 11. August 2009 10:48

Why not simply replacing the config for Gallery2 by

Code: Select all
$storeConfig['hostname'] = 'mypc';


and thats it?

However, I do not want to modify the application configuration file to change 'localhost' to 'mypc' because it becomes less portable, and creates headache during application upgrade.


As you see, it's just vice verse. Leaving "localhost" in your configuration makes it less portable, as localhost is a reserved name which is bound to the local PC.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 99 guests