DD-wrt DNSMasq and Apache virtual hosts

I have changed my LinkSys wrt54g router's firmware to DD-WRT v24-sp2 (07/22/09) micro. I'm trying to make local dns on the router to allow all machines on my LAN to be able to access my computer's Apache server virtual hosts by there domain name. I have the following data facts:

  1. Router IP is 192.168.2.1, subnet mask is 255.255.255.0
  2. My computer's IP is 192.168.2.31
  3. There is an Apache virtual host named: cars.fox and it is accessible from my computer as by the help of hosts file

The following screen shot shows the settings that I have tried on Serveices Tab of the router's web configurations, my reference for that settings could be found in this link:

enter image description here

However, I could not able to access the virtual host from a machine on the LAN, a smart phone, as

What's wrong?

1 Answer

The solution has two parts:

  1. Adding the following line in "Additional DNSMasq options":

    address=/ and the current value of "LAN Domain" is "/"

  2. Adjust the Apache virtual host settings conf/extra/httpd-vhost.conf from:

Notice the internal loop IP -127.0.10.44-

<VirtualHost 127.0.10.44:80> ##ServerAdmin DocumentRoot "C:/Users/user/path/to/cars/web" ServerName cars.fox ErrorLog "logs/cars.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

To

<VirtualHost *:80> ##ServerAdmin DocumentRoot "C:/Users/user/path/to/cars/web" ServerName cars.fox ErrorLog "logs/cars.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common </VirtualHost>

Then restart the Apache server, and reboot the router. Now any local machine in my LAN will be able to access hosted on the Apache server on my computer.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like