Template:ApacheAppSuiteConf: Difference between revisions

From Open-Xchange
No edit summary
No edit summary
Line 1: Line 1:
Configure the ''mod_proxy_{{#if:{{{connector|}}}|{{{connector}}}|ajp}}'' module by creating a new Apache configuration file.
Configure the ''mod_proxy_{{#if:{{{connector|}}}|{{{connector}}}|ajp}}'' module by creating a new Apache configuration file.
 
  $ vim {{#if:{{{connectorConf|}}}|{{{connectorConf}}}|{{{ajpconf}}}}}
  $ vim {{#if:{{{connectorConf|}}}|{{{connectorConf}}}|{{{ajpconf}}}}}


Line 12: Line 12:
     # Allow from 192.168 10 172.16
     # Allow from 192.168 10 172.16
  </Location>
  </Location>
 
  # the old path is kept for compatibility reasons
  # the old path is kept for compatibility reasons
  <Location /servlet/axis2/services>
  <Location /servlet/axis2/services>
Line 22: Line 22:
     # Allow from 192.168 10 172.16
     # Allow from 192.168 10 172.16
  </Location>
  </Location>
 
  {{{loadmodule}}}
  {{{loadmodule}}}
 
  <IfModule mod_proxy_{{#if:{{{connector|}}}|{{{connector}}}|ajp}}.c>
  <IfModule mod_proxy_{{#if:{{{connector|}}}|{{{connector}}}|ajp}}.c>
     ProxyRequests Off
     ProxyRequests Off
Line 46: Line 46:
         ProxyPass balancer://oxcluster/ajax
         ProxyPass balancer://oxcluster/ajax
     </Proxy>
     </Proxy>
 
     # OX frontend
     # OX frontend
     <Proxy /ajax>
     <Proxy /ajax>
Line 86: Line 86:
  <VirtualHost *:80>
  <VirtualHost *:80>
         ServerAdmin webmaster@localhost
         ServerAdmin webmaster@localhost
 
         DocumentRoot {{#if:{{{docroot|}}}|{{{docroot}}}|/var/www}}
         DocumentRoot {{#if:{{{docroot|}}}|{{{docroot}}}|/var/www}}
         <Directory {{#if:{{{docroot|}}}|{{{docroot}}}|/var/www}}>
         <Directory {{#if:{{{docroot|}}}|{{{docroot}}}|/var/www}}>
Line 95: Line 95:
                 RedirectMatch ^/$ /appsuite/
                 RedirectMatch ^/$ /appsuite/
         </Directory>
         </Directory>
 
         <Directory {{#if:{{{docroot|}}}|{{{docroot}}}/appsuite|/var/www/appsuite}}>
         <Directory {{#if:{{{docroot|}}}|{{{docroot}}}/appsuite|/var/www/appsuite}}>
                 Options None +SymLinksIfOwnerMatch
                 Options None +SymLinksIfOwnerMatch
                 AllowOverride Indexes FileInfo
                 AllowOverride Indexes FileInfo
         </Directory>
         </Directory>
 
         ErrorLog ${APACHE_LOG_DIR}/error.log
         ErrorLog ${APACHE_LOG_DIR}/error.log
 
         # Possible values include: debug, info, notice, warn, error, crit,
         # Possible values include: debug, info, notice, warn, error, crit,
         # alert, emerg.
         # alert, emerg.
         LogLevel warn
         LogLevel warn
 
         CustomLog ${APACHE_LOG_DIR}/access.log combined
         CustomLog ${APACHE_LOG_DIR}/access.log combined
  </VirtualHost><noinclude>
  </VirtualHost><noinclude>
{{Template:ApacheAppSuiteConf/doc}}
{{Template:ApacheAppSuiteConf/doc}}
</noinclude>
</noinclude>

Revision as of 09:50, 22 July 2013

Configure the mod_proxy_{{#if:|{{{connector}}}|ajp}} module by creating a new Apache configuration file.

$ vim {{#if:|{{{connectorConf}}}|{{{ajpconf}}}}}
# Please note that the servlet path to the soap API has changed:
<Location /webservices>
    # restrict access to the soap provisioning API
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    # you might add more ip addresses / networks here
    # Allow from 192.168 10 172.16
</Location>

# the old path is kept for compatibility reasons
<Location /servlet/axis2/services>
    # restrict access to the soap provisioning API
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    # you might add more ip addresses / networks here
    # Allow from 192.168 10 172.16
</Location>

{{{loadmodule}}}

<IfModule mod_proxy_{{#if:|{{{connector}}}|ajp}}.c>
   ProxyRequests Off
   {{#ifeq: {{{connector}}} | http |     # When enabled, this option will pass the Host: line from the incoming request to the proxied host.
   ProxyPreserveHost On | }}
   <Proxy balancer://oxcluster>
       Order deny,allow
       Allow from all
       # multiple server setups need to have the hostname inserted instead localhost
       BalancerMember {{#if:|{{{connector}}}|ajp}}://localhost:8009 timeout=100 smax=0 ttl=60 retry=60 loadfactor=50 route=OX1
       # Enable and maybe add additional hosts running OX here
       # BalancerMember {{#if:|{{{connector}}}|ajp}}://oxhost2:8009 timeout=100  smax=0 ttl=60 retry=60 loadfactor=50 route=OX2
      ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
      {{#ifeq: {{{connector}}} | http |
      SetEnv proxy-initial-not-pooled
      SetEnv proxy-sendchunked
      | }}
   </Proxy>
   {{#ifeq: {{{connector}}} | http |     # Define another Proxy Container with different timeout for the sync clients. Microsoft recommends a minimum value of 15 minutes.
   # Setting the value lower than the one defined as com.openexchange.usm.eas.ping.max_heartbeat in eas.properties will lead to connection
   # timeouts for clients.  See http://support.microsoft.com/?kbid=905013 for additional information.
   #
   # NOTE for Apache versions < 2.4:
   # When using a single node system or using BalancerMembers that are assigned to other balancers please add a second hostname for that
   # BalancerMember's IP so Apache can treat it as additional BalancerMember with a different timeout.
   #
   # Example from /etc/hosts: 127.0.0.1	localhost localhost_sync
   #
   # Alternatively select one or more hosts of your cluster to be restricted to handle only eas/usm requests
   <Proxy balancer://{{{syncProxyName}}}>
      Order deny,allow
      Allow from all
      # multiple server setups need to have the hostname inserted instead localhost
      BalancerMember http://localhost_sync:8009 timeout=1900 smax=0 ttl=60 retry=60 loadfactor=50 route=APP1
      # Enable and maybe add additional hosts running OX here
      # BalancerMember http://oxhost2:8009 timeout=1900  smax=0 ttl=60 retry=60 loadfactor=50 route=APP2
      ProxySet stickysession=JSESSIONID|jsessionid scolonpathdelim=On
      SetEnv proxy-initial-not-pooled
      SetEnv proxy-sendchunked
   </Proxy> | }}
   # OX AppSuite frontend
   <Proxy /appsuite/api>
       ProxyPass balancer://oxcluster/ajax
   </Proxy>

   # OX frontend
   <Proxy /ajax>
       ProxyPass balancer://oxcluster/ajax
   </Proxy>
   <Proxy /servlet>
       ProxyPass balancer://oxcluster/servlet
   </Proxy>
   <Proxy /infostore>
       ProxyPass balancer://oxcluster/infostore
   </Proxy>
   <Proxy /publications>
       ProxyPass balancer://oxcluster/publications
   </Proxy>
   # USM
   <Proxy /usm-json>
       ProxyPass balancer://oxcluster/usm-json
   </Proxy>
   # SOAP
   <Proxy /webservices>
       ProxyPass balancer://oxcluster/webservices
  </Proxy>
  {{#ifeq: {{{connector}}} | http |
   <Proxy /realtime>
       ProxyPass balancer://oxcluster/realtime
  </Proxy>
  | }}
   # OXtender{{#ifeq: {{{connector}}} | http | /EAS specific proxy container with higher timeout | }}
   <Proxy /Microsoft-Server-ActiveSync>
       ProxyPass balancer://{{#if:|{{{easProxyName}}}|oxcluster}}/Microsoft-Server-ActiveSync
   </Proxy>
</IfModule>


Modify the default website settings to display the Open-Xchange GUI

$ vim {{{apacheconf}}}
<VirtualHost *:80>
       ServerAdmin webmaster@localhost

       DocumentRoot {{#if:|{{{docroot}}}|/var/www}}
       <Directory {{#if:|{{{docroot}}}|/var/www}}>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride None
               Order allow,deny
               allow from all
               RedirectMatch ^/$ /appsuite/
       </Directory>

       <Directory {{#if:|{{{docroot}}}/appsuite|/var/www/appsuite}}>
               Options None +SymLinksIfOwnerMatch
               AllowOverride Indexes FileInfo
       </Directory>

       ErrorLog ${APACHE_LOG_DIR}/error.log

       # Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
       LogLevel warn

       CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Usage

Parameters used by this template

connector
ajp or http, fallback to ajp if empty
connectorConf
path to the configuration file of the chosen connector, fallback to ajpConf (deprecated)
loadmodule
Loadmodule directive needed for apache on RedHat based distros e.g.: LoadModule proxy_http_module modules/mod_proxy_http.so
apacheconf
path to the config file of the default apache vhost(http)
docroot
path to the apache docroot, fallback to /var/www
easProxyName
the proxyName to use for the eas specific proxy container, only when using http for the connector parameter

See also

Template:ApacheAppSuiteConf/testcases