[ic] Virtual host woes?

Pat Deegan - Psychogenic interchange-users@icdevgroup.org
Wed Aug 21 23:01:03 2002


Greetings all.

I've been trying to get this working for a while and can't seem to find 
any docs related to my troubles.

I have managed to get the foundation demo working on my home system (RH 
Linux) - on a virtual host - without any problems.

I've also managed to get it working on the target system (also RH 
Linux), albeit not for a virtual host - only for the "main" site...  

For the catalogs installed on virtual hosts, I just get 500 errors from 
/cgi-bin/shop (premature end of headers, because it simply outputs 
nothing).  I'm using INET and interchange is running and responsive:

$ telnet localhost 7786
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  GET / HTTP/1.0

  HTTP/1.0 404 Not found
  Content-type: application/octet-stream

  Not an Interchange catalog or help file.



Accessing a catalog that's not a virtual server works great

$ GET http://127.0.0.1/cgi-bin/shop/index.html
  <!-- BEGIN LEFTRIGHT_TOP -->

  <html>
  <head>

...

But after setting it up for the virtual host, I get:

$ GET http://doesnotwork.com/cgi-bin/shop/index.html
  <HTML>
  <HEAD><TITLE>An Error Occurred</TITLE></HEAD>
  <BODY>
  <H1>An Error Occurred</H1>
  500 Internal Server Error
  </BODY>
  </HTML>

and

  [Thu Aug 22 00:33:13 2002] [error] [client 127.0.0.1] Premature end of 
script headers: /home/virtual/site15/fst/var/www/cgi-bin/shop

in the error_log.


I've tried running it from the command line, that never works (for the 
virtual host installations or for the main) and looks like:

$ ./shop
$

I've attempted to increase DEBUG output by setting it to 1 in 
interchange.cfg, but hardly anything but the server startup time is 
inserted into /tmp/icdebug


To be specific, httpd.conf contains this:


# --- httpd.conf --- #

  ...

  ServerName itworks.com

  DocumentRoot /var/www/html

  ...

  <VirtualHost 66.45.39.98:80>
     Include /etc/appliance/apacheconf
  </VirtualHost>

  # Include all the virtual host config files
  Include /etc/httpd/conf/virtual

###


Apacheconf contains a few rewrite rules like

  RewriteRule ^/~([^/]+)/cgi-bin/(.*) 
/home/virtual/$1/var/www/cgi-bin/$2 [T=application/x-httpd-cgi,L]

while the files in /etc/httpd/conf/virtual contain entries like

<VirtualHost 66.45.39.98:80>
        ServerName www.doesnotwork.com
        ServerAlias doesnotwork.com
        DocumentRoot /home/virtual/site15/fst/var/www/html
        User admin15
        Group admin15
     
        SetEnv SITE_ROOT /home/virtual/site15/fst
        SetEnv SITE_HTMLROOT /home/virtual/site15/fst/var/www/html
        Include /etc/httpd/conf/site15

</VirtualHost>


The server is setup to chroot regular user to their respective homes, 
under /home/virtual/siteXXX/fst/, when connecting through ftp or ssh.  I 
have root access to the box, have installed interchange system-wide 
(tried both the tar.gz and the RPMs) and it is running as the new 
'interch' user.

 I've run ./bin/makecat at least 50 times using different approaches but 
basically I've been setting the server to the virtual host name, and the 
system paths to relevant stuff under the vhosts home (eg 
/home/virtual/site15/fst/var/www/cgi-bin).
 
 I've also tried setting up the catalog to use URLs like 
http://itworks.com/~username/cgi-bin/shop/index.html (with server set to 
'itworks.com' and the paths altered accordingly) but to no avail - I 
still get the same 500 errors.
 
 And I can never get a response when calling 
http://www.doesnotwork.com/cgi-bin/shop/index.html ...
 
Does anyone have any ideas as to what the problem is or what I can do to 
attempt to diagnose it (get some real debug output or find some useful 
logs)?

Thanks in advance.

Regards,
Pat Deegan