logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: VirtualHost and multi homed NIC
Author
DoctorEd



Joined: 29 Aug 2010
Posts: 2
Location: Snoqualmie, WA

PostPosted: Sun 29 Aug '10 6:52    Post subject: VirtualHost and multi homed NIC Reply with quote

I have two sites I want to serve on the same Apache 2.2 server using the VirtualHost directive. After a lot of RTFM and tinkering only one site will respond. The other site isn't even listening on the designated IP address.

The NIC on this server has two static IP's configured:
75.145.17.219
75.145.17.221

httpd.conf snippet:

Listen 80

NameVirtualHost 75.145.17.219:80
<VirtualHost 75.145.17.219:80>
ServerName www.AlisaWeir.com
ServerAdmin Ed.Weir@Weir-Inc.com
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/AlisaWeir.com"
CustomLog "logs/AlisaWeir.log" combinedio
</VirtualHost>

NameVirtualHost 75.145.17.221:80
<VirtualHost 75.145.17.221:80>
ServerName www.Weir-Inc.com
ServerAdmin Ed.Weir@Weir-Inc.com
DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/Weir-Inc.com"
CustomLog "logs/Weir-Inc.log" combinedio
</VirtualHost>

The only host responding is the one at 75.145.17.221:80; the log file is written to just fine. The other host produces NO log content at all.

error.log:
[Sat Aug 28 16:25:31 2010] [notice] Apache/2.2.14 (Win32) PHP/5.3.2 configured -- resuming normal operations
[Sat Aug 28 16:25:31 2010] [notice] Server built: Sep 28 2009 22:41:08
[Sat Aug 28 16:25:31 2010] [notice] Parent: Created child process 3048
[Sat Aug 28 16:25:31 2010] [debug] mpm_winnt.c(487): Parent: Sent the scoreboard to the child
[Sat Aug 28 16:25:32 2010] [notice] Child 3048: Child process is running
[Sat Aug 28 16:25:32 2010] [debug] mpm_winnt.c(408): Child 3048: Retrieved our scoreboard from the parent.
[Sat Aug 28 16:25:32 2010] [info] Parent: Duplicating socket 328 and sending it to child process 3048
[Sat Aug 28 16:25:32 2010] [debug] mpm_winnt.c(605): Parent: Sent 1 listeners to child 3048
[Sat Aug 28 16:25:32 2010] [debug] mpm_winnt.c(564): Child 3048: retrieved 1 listeners from parent
[Sat Aug 28 16:25:32 2010] [notice] Child 3048: Acquired the start mutex.
[Sat Aug 28 16:25:32 2010] [notice] Child 3048: Starting 64 worker threads.
[Sat Aug 28 16:25:32 2010] [notice] Child 3048: Starting thread to listen on port 80.

Note that this is after some tinkering with the VHost configurations for awhile. At one time I used two Listen directives for the two NIC addresses:80 with the same results: only one host responding.

Is Apache 2.2 capable of multihoming on Windows?
(Windows 2008 SBS)

TIA,
- Ed.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7355
Location: Germany, Next to Hamburg

PostPosted: Mon 30 Aug '10 11:53    Post subject: Reply with quote

At least from my computer on 75.145.17.219 the port 80 is not open in the firewall.
Back to top
PipoDeClown



Joined: 20 Dec 2005
Posts: 77

PostPosted: Mon 30 Aug '10 20:11    Post subject: Reply with quote

better examine the docs again http://httpd.apache.org/docs/2.2/vhosts/
you need ip based host http://httpd.apache.org/docs/2.2/vhosts/ip-based.html,
remove the NameVirtualHost thing
add some listen directives http://httpd.apache.org/docs/2.2/mod/mpm_common.html#listen

btw did you expose this server directly to the internet without firewall or router?
Back to top
DoctorEd



Joined: 29 Aug 2010
Posts: 2
Location: Snoqualmie, WA

PostPosted: Tue 31 Aug '10 10:54    Post subject: VirtualHost and multi homed NIC Reply with quote

Rolling Eyes Silly me... After reading your replies, I reviewed the firewall settings; without making any changes to the httpd.conf file, I simply opened port 80 on 219... and... bingo

sigh must've been sleepy... LOL

Thanks you guys!
- Ed.
Back to top


Reply to topic   Topic: VirtualHost and multi homed NIC View previous topic :: View next topic
Post new topic   Forum Index -> Apache