How to make Apache to listen to a specific interface on DHCP?

0 like 0 dislike
8 views
There is a machine with Apache under win7.


If to httpd.specify conf Listen *:80 , then Apache is listening to port 80 on all interfaces you can find. If you specify a specific IP address, Listen 209.85.349.147:80, then he only listens to the correct interface, leaving the rest free (and I do from time to time).


The problem is that this IP is issued by DHCP, and rewrite every time httpd.conf — somehow not comme Il faut.

Listen 127.0.0.1:80 is not an option, because sometimes you need to access some virtual hosts to view the outside.
by | 8 views

4 Answers

0 like 0 dislike
Well, that's just told — habrahabr.ru/blogs/webdev/112193/
\r
Add script to rc.local, restarting network and enjoy.
by
0 like 0 dislike
scnr.net/blog/index.php/archives/65
Suitable for *nix. I'm not sure what Windows firewall can do that.
by
0 like 0 dislike
Attribute to listen to domen.EN:80
by
0 like 0 dislike
Yes I see no problem nifiga :-)
\r
Split the config into two parts — before and after Listen.
\r
Make a batch file.
I will write syntax verify yourself.
\r
from ipconfig to get current IP on the interface.
further
\r
type preconfig > httpd.conf
echo "Listen $IP:80" >> httpd.conf
type postconfig >> httpd.conf
\r
A lot of ways, revolve around the pattern and modifier.
by
110,608 questions
257,186 answers
0 comments
28,707 users