DD-wrt DNSMasq and Apache virtual hosts

0

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 http://cars.fox 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 http://cars.fox

What's wrong?

SaidbakR

Posted 2016-09-21T01:55:51.570

Reputation: 258

Answers

1

The solution has two parts:

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

    address=/cars.fox/192.168.2.31 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 webmaster@dummy-host2.example.com
    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 webmaster@dummy-host2.example.com
        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 http://cars.fox hosted on the Apache server on my computer.

SaidbakR

Posted 2016-09-21T01:55:51.570

Reputation: 258