Forum

One port for each virtualHost

channel_zero
27 October 2012, 20:16


Hiawatha version: 8.4
Operating System: Debian Testing

I'm trying to set up a dev environment where hiawatha listens on two port and serves two different VirtualHost configurations. One virtualhost is a dev environment that could be in various states of broken, the other a testing environment. I've got hiawatha listening on two ports, and two virtualHost configurations, but hiawatha only serves one site when I point to either port. For example, from my dev box, I enter http://webship.local:1100 and hiawatha serves the same page as http://webship.local:8880.

What may, or may not complicate matters is I use avahi to provide LAN dns.

How do I get :8880 to serve one VirtualHost and :1110 to serve another?
Hugo Leisink
27 October 2012, 20:49
Have you tried the RequiredBinding option?
channel_zero
28 October 2012, 01:54
Yeah, I tried the RequiredBinding see below for the config snippets.

Can I get away with no Hostname stanza in the VirtualHost config? e.g. any request on port 8880 is served by /var/www/port8880/drupal_dev?

There is unexpected behaviour as well in that it serves the drupal installer page the very first time, clicking "next" on Drupal's installer forwards to apache2 running on port 80.
Binding {
Port = 8880
BindingID = port8880
Interface = 192.168.15.33
# MaxKeepAlive = 30
# TimeForRequest = 3,20
}

Binding {
Port = 100
BindingID = port100
Interface = 192.168.15.33
MaxKeepAlive = 30
TimeForRequest = 3,20
}

VirtualHost {
Hostname = 192.168.15.33
RequiredBinding = port8880
WebsiteRoot = /var/www/port8880/drupal_dev
StartFile = index.php
AccessLogfile = /var/log/hiawatha/drupal-access.log
ErrorLogfile = /var/log/hiawatha/drupal-error.log
TimeForCGI = 5
UseFastCGI = PHP5
# UseToolkit = banshee
}

VirtualHost {
Hostname = spaceship.local
WebsiteRoot = /var/www/port100
RequiredBinding = port100
ShowIndex = yes
UseFastCGI = PHP5
ExecuteCGI = yes
# StartFile = mythweb.php
Setenv db_server = 192.168.15.33
Setenv db_name = mythconverg
Setenv db_login = mythtv
Setenv db_password = mythtv
Setenv PATH_INFO = /var/www/port100/mythweb
Setenv PATH = /usr/share/mythweb
# Setenv hostname = spaceship.local
Setenv include_path = /usr/share/mythweb


AccessLogfile = /var/log/hiawatha/port100-access.log
ErrorLogfile = /var/log/hiawatha/port100-error.log
}
Hugo Leisink
28 October 2012, 08:01
Besides the BindingId, the hostname should also match. In your first message, you use webship.local in both URL's. But I don't see that hostname in your configuration.

But, why all the trouble with different ports? Just use webship.local and, for example, dev.webship.local?
channel_zero
28 October 2012, 20:48
Yeah, sorry about posting the wrong hostname. Assume the hostname matches what I have in the posted config, I still have the same problem.

Using the same hostname in both VirtualHost containers I get a warning that the same hostname is being used more than once. It doesn't fix the problem either. I still have something, either Drupal's installer or Hiawatha forwarding me off of either non-standard port to an Apache2 installation running on port 80.

I can't use a prefix on the hostname, avahi can't resolve that. Sure, I could edit /etc/hosts, but it makes avahi redundant.
channel_zero
28 October 2012, 20:55
I think I can make it work setting up a virtual IP off the network device address and then have Hiawatha listen on that virtual IP with a /etc/hosts entry on top. But it's the long way around the problem.

Does this qualify as a feature request?
This topic has been closed.