Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am setting up my own local development web server, mainly for theme development.

I've successfully setup LAMP in Ubuntu 13.04 64bit Desktop, apache works fine.

The machine where LAMP is installed is also my deskstop station.

So I want to access the VirtualHost both from the localhost itself and from another machine within my lan.

I've setup my first virtual host named devone.loc
I've already inserted the name inside my hosts file.
Everything is working and accessible.
It's also accessible within any machines in my lan, I have setup it up in DNSmasq in my DD-WRT router.

But then, when I disable my network connection, the virtual host is
no longer accessible. But the default virtual host is still accessible without network.

What seems to be the problem here? I also need to access the virtual host within the localhost since it's also my desktop station.

I've attached my virtual host conf file below:

  <VirtualHost *:80>
    DocumentRoot /var/www2
    ServerName devone.loc
    ServerAlias www.devone.loc
    <Directory /var/www2>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
  </VirtualHost>


You can easily recreate my problem, when you're a virtualhost user.
Disable all your Network, and using firefox (in my case, FF v23) browse your
local dev site and it will throw server not found error.

Browsing my site offline in my localhost's virtualhost is very important for me,
I use it to demo or for a project presentation for a client.

Additional Info

I forgot to mention that Webmin is also installed in my machine.


Update
I've setup another web server in another linux machine using LinuxMint 15, server is XAMPP 1.8.2-1, the end result is the same.

I try to setup wordpress while my network is disabled but It's throwing server not found error or when the directory is empty it's throwing Access Forbidden.

When I check or ticked the Work Offline menu of firefox, I get access to the wordpress installation menu, but only the index part, clicking next is no longer accessible again.

I've done several combinations of directives, but I still can't get it to work.

So, the main problem is...

My VirtualHost is not reachable/accessible when all network is disabled. I'ts only reachable/accessible when network is enabled.

Update - I got it FIXED

This issue is actually connected to Firefox Settings, changing the setting did fixed my problem.

network.dns.disableIPv6 is the Firefox's preference name that I changed it's boolean value to false

So, what I did:

  1. Opened up Firefox and typed in about:config in the address bar.
  2. I got prompted with a warning... This might void your warranty, I clicked I'll be careful, I promise!
  3. In the search bar just below the tabs, I searched for network.dns.disableIPv6, and when It appeared, I just double clicked it to change it's value to false.
  4. I rebooted my machine and browse to my project's site, and bam! Finally opened up.

For newbies like me, hope this will help you out.

I can now sleep peacefully... thanks to this post.

I had sleepless nights searching about this issue, different search strings and phrases yields different search results. I finally reached that right page. I also discovered that this issue was also asked in Super User.

share|improve this question
    
I hope someone can explain, why the default local-host site is working even when network is disabled and the created virtual-host is not. Even without the above fix/tweak. I am referring to the default apache web-page. The It works web-page. –  Gary Lising Aug 16 '13 at 22:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.