homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Getting localhost to work when off-line
so I can develop when not connected
AnonyMouse

10+ Year Member



 
Msg#: 3689691 posted 5:15 pm on Jul 3, 2008 (gmt 0)

Hi,

This may not be the right place to post this, but it seemed the most relevant forum.

I have apache/php/mysql running on my laptop, and use it to code locally before uploading to the server.

I've edited my hosts file on Windows, so that I can connect to apache via [local.example.com...]

This works fine when I am connected to the web, but does not when I am offline! I've been frustrated by a dodgy net connection recently, and it's even more frustrating that I can't even make the most of working off-line.

Does anyone have any tips to get localhost working when off-line?

 

wsmeyer

5+ Year Member



 
Msg#: 3689691 posted 7:39 pm on Jul 3, 2008 (gmt 0)

My guess is that you inadvertently set it up so that it sends the request out to the internet and your router is routing it back to your laptop.

In your httpd.conf file the listen parameter should be set to 127.0.0.1 and then in your hosts file you should have entered

127.0.0.1 local.example.com

and that should be it.

William.

AnonyMouse

10+ Year Member



 
Msg#: 3689691 posted 8:56 pm on Jul 3, 2008 (gmt 0)

Thanks for the reply William.

I've got this in my httpd.conf:

Listen 3000
Listen 127.0.0.1

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "D:/apachedocs/"
</VirtualHost>

And this in my hosts file:
127.0.0.1 localhost

Apart from the "listen" directive, it was all there before. Adding the listen directive (which I may not have done correctly) doesn't seem to have helped :-(

I've tried it with my firewall on and off, no effect.

Any other clues?

Pico_Train

5+ Year Member



 
Msg#: 3689691 posted 6:45 pm on Jul 5, 2008 (gmt 0)

Check you tools -> options settings in your browsers if you are using IE.

IN your tools->internet options->connections - make sure "never dial a connection" is selected.

That sorted the same thing out for me in the past.

Good luck!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved