Sreeni's Weblog

Apache to front end a set of IPS repository daemons

Wednesday May 07, 2008

To allow reverse proxying, so that apache could front end the pkg.depotd daemons, perform the following:

  • Enable the following modules in <apache-install>/etc/httpd.conf.

    LoadModule proxy_module libexec/mod_proxy.so LoadModule proxy_http_module libexec/mod_proxy_http.so

  • Add proxy entries to <apache-install>/etc/httpd.conf corresponding to the pkg.depotd ports.

    # Reverse Proxy Setup
    ProxyRequests off
    # sparc
    ProxyPass /dev/solaris-sparc/gf3000_2000/ http://localhost:10000/
    ProxyPassReverse /dev/solaris-sparc/gf3000_2000/ http://localhost:10000/
    # linux
    ProxyPass /dev/linux/gf3000_2000/ http://localhost:10001/
    ProxyPassReverse /dev/linux/gf3000_2000/ http://localhost:10001/
    # mac
    ProxyPass /dev/mac/gf3000_2000/ http://localhost:10002/
    ProxyPassReverse /dev/mac/gf3000_2000/ http://localhost:10002/
    # solaris x86
    ProxyPass /dev/solaris-x86/gf3000_2000/ http://localhost:10003/
    ProxyPassReverse /dev/solaris-x86/gf3000_2000/ http://localhost:10003/
    # windows
    ProxyPass /dev/windows/gf3000_2000/ http://localhost:10004/
    ProxyPassReverse /dev/windows/gf3000_2000/ http://localhost:10004/
    # default
    ProxyPass / http://localhost:10000/
    ProxyPassReverse / http://localhost:10000/
    
  • Change the custom log to combined format.

    Comment the following line

    # CustomLog var/log/access_log common
    

    Uncomment the following line

    CustomLog var/log/access_log combined
    

The apache httpd can be setup as Solaris SMF service so that the process is monitored by SMF. Here are the steps:

  • Create service manifest /var/svc/manifest/application/apache2/httpd.xml. Replace the location of apache httpd script appropriately.

    Download httpd.xml

  • Validate and import the service manifest using svccfg(1M).

    bash-3.00# svccfg
    svc:> validate /var/svc/manifest/application/apache2/httpd.xml
    svc:> import /var/svc/manifest/application/apache2/httpd.xml
    svc:> quit
    
  • Enable the service using the svcadm command.

    svcadm enable -t svc:/application/apache2/httpd

  • Verify that the service is online.

    bash-3.00# svcs -a | grep -i apache online May_02 svc:/application/apache2/httpd:default

    Like this post? del.icio.us | furl | slashdot | technorati | digg
Comments:

Hi Sreeni,

I don't have any httpd.conf file on my host (S10 u4 x86) so started with an empty file and zero directives, but looking to the documentation in apache.org helped me to go further and have the apache server up and running.
My pkg.depots runs on ports 10021,10022,10023,10024,10025 so did the suitable mapping for the os-arch.

I have problem with setting the default value for ProxyPass and ProxyPassReverse, any recommendation ?

Connect via the mapped URI using my mozilla firefox (2.0.0.8), I cannot see the icon of the pkg.depotd, any additional settings are needed to be done ?

Many thanks for the clear instructions.
thanks.

Posted by nouar garcia on May 28, 2008 at 03:19 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed