[us...@httpd] access from LAN to virtual hosts

2010-10-24 Thread Stormy
Apache 2.2 on ubuntu server 10.10 [LAN only, no WAN] all running well, 
except that virtualhosts is not functional as expected. All other LAN boxes 
are Win XP Pro SP2 and can see the ubuntu server2 (hard coded IPs for LAN, 
no DHCP.) 192.168.0.20 is NameVirtualHost on the ubuntu server2.


Set up 4 websites (sdb/www/site1, sdb/www/site2, etc, not using 
public_html) and the corresponding entries in hosts and sites-enabled - all 
accessible from Firefox on server2. HOWEVER, from the XP boxes on the LAN 
they were not directly visible using http://site1 (they were visible for a 
request http://server2/site1 but this was bypassing virtualhosts and going 
straight to the directory - proved it by adding a fully functional site5 
with no corresponding VirtualHost in sites-enabled). After modifying the 
Win hosts file to add lines 192.168.0.20 site1, 192.168.0.20 site2, etc all 
functioned as expected but is probably still finding the directory rather 
than the VirtualHost.


This to me appears to be Win forcing the address at http request level, 
rather than apache resolving via virtualhosts. Am I correct? and if so how 
do I get apache to resolve correctly? or conversely is there an http 
request (similar to ~site1 using public_html) that should be used.


The reason for this request is that I am trying to differentiate between 
two entries to a single app on different ports (koha on 80 and koha.admin 
on 8080) and cannot get it to work. Snipped version of VirtualHost file in 
sites-enabled as follows:


# Koha Apache Configuration Directives

# NameVirtualHost 192.168.0.20:80 - see ports.conf
NameVirtualHost 127.0.0.1:80

## OPAC
VirtualHost 127.0.0.1:80 192.168.0.20:80
   ServerAdmin  webmas...@server2
   DocumentRoot /usr/share/koha/opac/htdocs
   ServerName koha
   ServerAlias *.koha
   ScriptAlias /cgi-bin/koha/ /usr/share/koha/opac/cgi-bin/opac/
   ScriptAlias /index.html /usr/share/koha/opac/cgi-bin/opac/opac-main.pl
   ScriptAlias /opac-search.pl /usr/share/koha/opac/cgi-bin/opac/search
   ScriptAlias /search /usr/share/koha/opac/cgi-bin/opac/search
   ErrorLog /var/log/koha/koha-opac-error_log
   SetEnv KOHA_CONF /etc/koha/koha-conf.xml
   SetEnv PERL5LIB /usr/share/koha/lib
/VirtualHost

NameVirtualHost 192.168.0.20:8080

VirtualHost 127.0.0.1:8080 192.168.0.20:8080
   ServerAdmin webmas...@server2
   DocumentRoot /usr/share/koha/intranet/htdocs
   ServerName server2:8080
   ServerAlias koha.admin:8080 koha.admin http://koha.admin
   ScriptAlias /cgi-bin/koha/ /usr/share/koha/intranet/cgi-bin/
   ScriptAlias /index.html /usr/share/koha/intranet/cgi-bin/mainpage.pl
   ScriptAlias /search /usr/share/koha/intranet/cgi-bin/search.pl
   ErrorLog /var/log/koha/koha-error_log
   SetEnv KOHA_CONF /etc/koha/koha-conf.xml
   SetEnv PERL5LIB /usr/share/koha/lib
/VirtualHost

The server aliases in the second VirtualHost do not work.

Many thanks - Paul
[first post to this list]


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] access from LAN to virtual hosts

2010-10-24 Thread Eric Covener
 HOWEVER, from the XP boxes on the LAN they were not
 directly visible using http://site1

None of your name-based vhosts know about site1.

Was your result from the browser just the contents of the default
(first-listed) vhost for the 192.168.0.20 vhost?  Or something else?
-- 
Eric Covener
cove...@gmail.com

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] access from LAN to virtual hosts

2010-10-24 Thread Stormy

At 06:03 PM 10/24/2010 -0400, Eric Covener wrote:

 HOWEVER, from the XP boxes on the LAN they were not
 directly visible using http://site1

None of your name-based vhosts know about site1.


Thanks for the reply. I did not want to overload my original post, so did 
not paste the relevant VirtualHost entries - but they are in the 
sites-available (and therefore in sites-enabled), and after modifying the 
C:\$win\system32\drivers\etc\hosts in the Win boxes, they work perfectly.


My problem is differentiating between the two koha sites, one on port 80, 
the other on port 8080 - that is why I included just those two vhost 
entries (the listen and VirtualHostName entries are - I think sufficient.) 
The workstation Win boxes 'hosts' files will not take a port# as an argument.


I could add an IP address on eth0 (I believe as eth0:1 ???) - would this be 
the easiest work around?


Thanks - Paul


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] access from LAN to virtual hosts

2010-10-24 Thread Eric Covener
 My problem is differentiating between the two koha sites, one on port 80,
 the other on port 8080 - that is why I included just those two vhost entries
 (the listen and VirtualHostName entries are - I think sufficient.) The
 workstation Win boxes 'hosts' files will not take a port# as an argument.

They shouldn't take a port number.  You must include the port number
when you put the link in your browser.

Once Apache finds the best match for the IP:PORT, it will worry about
hostnames and all that from virtualhosts that contained the best
match.

-- 
Eric Covener
cove...@gmail.com

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org