How to setup httpd.conf to use domain/opac instead of opac.domain or domain:port
Hi all I would like to have the opac served from the URL http://nsw.royalsoc.org.au/opac instead of from a port say http://nsw.royalsoc.org.au:8000 The reason is that I have the Intranet being served from 8080 and although I can setup opac at say :8000 it's blocked from my work here and other ports such as 9000 and many others are blocked. I know 80 and 8080 seem OK. Hence I have setup the Intranet from :8080 and it works fine. I'm having problems in working out how to get http://nsw.royalsoc.org.au/opac working. Note: I don't want to use http://opac.royalsoc.org.au/ as I'm using http://www.royalsoc.org.au/ and http://qld.royalsoc.org.au/ and so opac.royalsoc.org.au does not "fit in". I thought that maybe an "Alias /opac /home/koha/koha/opac/htdocs" might work but I'm getting very confused with virtual domains, virt name hosting etc. Some help in the config would be appreciated. # Ports to listen to for Koha Listen 80 Listen 8080 Listen 8000 <--- this is blocked so can't really use it NameVirtualHost 300.200.100.111 ############################## # nsw.royalsoc.org.au ############################## <VirtualHost 300.200.100.111> <-- my real IP addr is here. ServerName nsw.royalsoc.org.au ServerAlias nsw.royalsoc.org.au DocumentRoot /home/rsnsw/web/nsw ErrorLog /var/log/apache/nsw-error.log CustomLog /var/log/apache/nsw-access.log combined </VirtualHost> # Koha OPAC settings # I want to move this to be available from: # http://nsw.royalsoc.org.au/opac <VirtualHost nsw.royalsoc.org.au:8000> ServerName nsw.royalsoc.org.au ServerAlias nsw.royalsoc.org.au DocumentRoot /home/koha/koha/opac/htdocs ScriptAlias /cgi-bin/koha/ /home/koha/koha/opac/cgi-bin/ Redirect permanent index.html http://nsw.royalsoc.org.au:8000/cgi-bin/koha/opac-main.pl ErrorLog /var/log/apache/nsw-error.log CustomLog /var/log/apache/nsw-access.log combined SetEnv PERL5LIB "/home/koha/koha/intranet/modules" SetEnv KOHA_CONF "/home/koha/koha/etc/koha.conf" </VirtualHost> # Koha Intranet settings # This is sworking fine. <VirtualHost nsw.royalsoc.org.au:8080> ServerName nsw.royalsoc.org.au ServerAlias nsw.royalsoc.org.au DocumentRoot /home/koha/koha/intranet/htdocs ScriptAlias /cgi-bin/koha/ "/home/koha/koha/intranet/cgi-bin/" Redirect permanent index.html http://nsw.royalsoc.org.au:8080/cgi-bin/koha/mainpage.pl ErrorLog /var/log/apache/koha-error.log TransferLog /var/log/apache/koha-access.log SetEnv PERL5LIB "/home/koha/koha/intranet/modules" SetEnv KOHA_CONF "/home/koha/koha/etc/koha.conf" </VirtualHost> Mike -- Michael Lake Science Faculty, UTS Ph: 9514 8232 Fx: 9514 1460
On Fri, Jun 16, 2006 at 03:51:32PM +1000, Michael Lake said:
Hi all
I would like to have the opac served from the URL http://nsw.royalsoc.org.au/opac instead of from a port say http://nsw.royalsoc.org.au:8000
Hi Michael The trick here is that all the scripts, and html templates, point to /cgi-bin/koha/. So if you set it up under /opac/ all the links will break. So unfortunately there is no easy way to do it. There are ways to do it though, the way id do it is with mod_proxy http://httpd.apache.org/docs/1.3/mod/mod_proxy.html or http://httpd.apache.org/docs/2.0/mod/mod_proxy.html
# Ports to listen to for Koha Listen 80 Listen 8080 Listen 8000 <--- this is blocked so can't really use it
NameVirtualHost 300.200.100.111
############################## # nsw.royalsoc.org.au ##############################
<VirtualHost 300.200.100.111> <-- my real IP addr is here. ServerName nsw.royalsoc.org.au ServerAlias nsw.royalsoc.org.au DocumentRoot /home/rsnsw/web/nsw ErrorLog /var/log/apache/nsw-error.log CustomLog /var/log/apache/nsw-access.log combined
# for apache 1.3 ProxyRequests Off ProxyPass /opac http://nsw.royalsoc.org.au:8000/cgi-bin/koha/ ProxyPassReverse /opac http://nsw.royalsoc.org.au:8000/cgi-bin/koha/ # for apache 2.0 the same as above plus <Proxy *> Order deny,allow Allow from all </Proxy>
</VirtualHost>
# Koha OPAC settings # I want to move this to be available from: # http://nsw.royalsoc.org.au/opac <VirtualHost nsw.royalsoc.org.au:8000> ServerName nsw.royalsoc.org.au ServerAlias nsw.royalsoc.org.au DocumentRoot /home/koha/koha/opac/htdocs ScriptAlias /cgi-bin/koha/ /home/koha/koha/opac/cgi-bin/ Redirect permanent index.html http://nsw.royalsoc.org.au:8000/cgi-bin/koha/opac-main.pl ErrorLog /var/log/apache/nsw-error.log CustomLog /var/log/apache/nsw-access.log combined SetEnv PERL5LIB "/home/koha/koha/intranet/modules" SetEnv KOHA_CONF "/home/koha/koha/etc/koha.conf" </VirtualHost>
# Koha Intranet settings # This is sworking fine. <VirtualHost nsw.royalsoc.org.au:8080> ServerName nsw.royalsoc.org.au ServerAlias nsw.royalsoc.org.au DocumentRoot /home/koha/koha/intranet/htdocs ScriptAlias /cgi-bin/koha/ "/home/koha/koha/intranet/cgi-bin/" Redirect permanent index.html http://nsw.royalsoc.org.au:8080/cgi-bin/koha/mainpage.pl ErrorLog /var/log/apache/koha-error.log TransferLog /var/log/apache/koha-access.log SetEnv PERL5LIB "/home/koha/koha/intranet/modules" SetEnv KOHA_CONF "/home/koha/koha/etc/koha.conf" </VirtualHost>
And leave the rest That will mean a person can go to http://nsw.royalsoc.org.au/opac/opac-main.pl And it will be fetching it from nsw.royalsoc.org.au:8000 and sending it to the user over port 80. Hope this helps Chris -- Chris Cormack Programmer 027 4500 789 Katipo Communications Ltd chris@katipo.co.nz www.katipo.co.nz
Chris Cormack wrote:
The trick here is that all the scripts, and html templates, point to /cgi-bin/koha/. So if you set it up under /opac/ all the links will break. So unfortunately there is no easy way to do it.
There are ways to do it though, the way id do it is with mod_proxy http://httpd.apache.org/docs/1.3/mod/mod_proxy.html or http://httpd.apache.org/docs/2.0/mod/mod_proxy.html ..... # for apache 1.3 ProxyRequests Off ProxyPass /opac http://nsw.royalsoc.org.au:8000/cgi-bin/koha/ ProxyPassReverse /opac http://nsw.royalsoc.org.au:8000/cgi-bin/koha/
Ah :-) It's a little more complex than I thought. Thanks for that I'll try that on Monday. I don't have mod_proxy in my modules.conf file so I might have fidgit a bit to try it. Mike -- Michael Lake Science Faculty, UTS Ph: 9514 8232 Fx: 9514 1460
participants (2)
-
Chris Cormack -
Michael Lake