Forum OpenACS Q&A: Problem with OpenACS/Apache and virtual hosts


Here's the scenario. I've installed the OpenACS/Apache rpms on my system
running RH 6.2. Everything went smoothly. I can bring up the index.tcl page,
login, etc. Then I started to configure apache.conf to add a virtual host
since I have two domain names pointing at the same IP address. The problem
I'm seeing is that when I access the domain pointing at OpenACS, I get a
download dialog box asking where I want to save index.html. If I go ahead
and save the file, when I look at the contents its actually index.tcl. The
other virtual host that points to a different(non ACS) directory works just
fine.

I've re-read the Apache virtual hosting docs(Its been a couple of years)
and I believe Apache is configured correctly to do what I want it to. The
problem seems to be configuring mod_aolserver and OpenACS to do what I want.

Here's what I think are the relevant parts from the config files:

The virtual hosts and AOLServer parameters in apache.conf are set up like this...
 

#
# ACS/AOL Server configuration
#
AolServerConf nsv_shmem_file /var/opt/run/aolsrv_shmem
AolServerConf lockfile /var/opt/run/aolsrv_lock
AolServerConf config_file /etc/opt/apache/nsd.ini
AolServerConf log_file_location /var/opt/log/apache/error.log
AolServerConf tcl_modules /opt/lib/apache/tcl_modules

#
# Use name-based virtual hosting.
#
NameVirtualHost *

<VirtualHost *>
  ServerName www.indaflo.com
  DocumentRoot "/var/opt/www/nuvoetech2/www"
  <Directory "/var/opt/www/nuvoetech2/www">
    Options  Indexes FollowSymLinks MultiViews ExecCGI
    DirectoryIndex  index.tcl index.adp index.shtml index.html index.htm
    AddHandler adp adp
    AddHandler aolserver tcl
  </Directory>
</VirtualHost>

<VirtualHost *>
  ServerName www.flyingbean.com
  DocumentRoot /home/httpd/html/flyingbean
  ErrorLog  /var/opt/log/flyingbean.com/error_log
  CustomLog /var/opt/log/flyingbean.com/access_log common
</VirtualHost>
 

The server part in nsd.ini looks this...

[ns/parameters]
  Home=/opt

; You need to make sure you get this parameters correct if you are
; running ACS.
  AuxConfigDir=/etc/opt/openacs

[ns/server/nuvoetech2]
  PageRoot=/var/opt/www/nuvoetech2/www
  EnableTclPages=On
  DirectoryFile=index.tcl, index.htm, index.html
  Verbose=on
  ;DirectoryListing=fancy

[ns/server/nuvoetech2/db]
  Pools=log,main,subquery
  DefaultPool=main

[ns/server/nuvoetech2/adp]
  Map=/*.adp

[ns/server/nuvoetech2/tcl]
  AutoClose=On
  Library=/var/opt/www/nuvoetech2/tcl

[ns/servers]
  nuvoetech2=nuvoetech2 server
 

The ACS info in nuvoetech2.ini (renamed from ad.ini) looks like this...

[ns/server/nuvoetech2/acs]
SystemName=Flying Bean
; for legal pages, full corporate entity
PublisherName=Flying Bean
; who signs the average user-visible pages
SystemOwner=webmaster@indaflo.com
; URL to tell users to go to
SystemURL=http://www.indaflo.com
; who signs the admin pages, e.g., a programmer who can fix/enhance them
AdminOwner=webmaster@indaflo.com

{...snip...}
 

I've scanned through the logs but nothing jumps out as being a problem.
I've also scanned these newsgroups but I haven't seen this issue come up with
the OpenACS/Apache version.

Help would be mucho appreciated.

Collapse
Posted by finn knudsen on
Hi Steve

I was trying to get mod_aolserver working previously but has since switched to AolServer, because of the problems with getting it working correctly. I can't tell you what's wrong, but I could not get mod_perl working alongside mod_aolserver either. I'm not very strong in Apache, but I haven't heard about anyone else getting it working. So getting fancy things working might in general give you some problems.

You might want to contact Petru Paler if you are getting serious about using mod_aolserver, since he might be working on similar problems. https://openacs.org/forums/message-view?message_id=19176

Best of luck

Collapse
Posted by Os Tyler on
Hi Steve,

I'm afraid I don't have an answer to your problem, but I can tell you that openacs is working "here" as a virtual host, along with multiple "normal" hosts.

If you're still having trouble, maybe I can help suggest where *not* to look for trouble. I modificed my apache.conf virtual host directive so that it's identical to yours (really small changes, like substituting <VirtualHost *> for <VirtualHost 64.23.66.240>) and it continues to work fine.

I'm on RH7, apache1.3.19, openacs3.2.4, mod_aolserver1.1 (from source, though, not from the RPMs)

Good luck,

Os

 
Problem solved.  I moved the following AOL Server config statements inside the virtual host for OpenACS and everytyhing worked fine.

    #
    # Use name-based virtual hosting.
    #
    NameVirtualHost *

    <VirtualHost *>
      ServerName www.indaflo.com
      DocumentRoot "/var/opt/www/nuvoetech2/www"
      <Directory "/var/opt/www/nuvoetech2/www">
        Options  Indexes FollowSymLinks MultiViews ExecCGI
        DirectoryIndex  index.tcl index.adp index.shtml index.html index.htm
        AddHandler adp adp
        AddHandler aolserver tcl
      </Directory>
     #
     # ACS/AOL Server configuration
     #
     AolServerConf nsv_shmem_file /var/opt/run/aolsrv_shmem
     AolServerConf lockfile /var/opt/run/aolsrv_lock
     AolServerConf config_file /etc/opt/apache/nsd.ini
     AolServerConf log_file_location /var/opt/log/apache/error.log
     AolServerConf tcl_modules /opt/lib/apache/tcl_modules
    </VirtualHost>

Note that if you leave a copy of the AOL Server config statements in the main part of apache.conf, when you start Apache mod_aolserver will complain with the statement  "mod_aolserver can only run currently in one virtual server" and the Apache startup will fail.