Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Uncomment (or compile with at least these modules using --enable)

Code Block

\#LoadModule proxy_module modules/mod_proxy.so

...


\#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

...


\#LoadModule ssl_module modules/mod_ssl.so

Set ServerAdmin, ServerName

Add something like

Code Block

ProxyRequests Off

...



<Proxy

...

 \*>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddDefaultCharset off
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Order deny,allow
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allow from all
</Proxy>

\# Enable/disable the handling of HTTP/1.1 "Via:" headers.

...


\# ("Full" adds the server version; "Block" removes all outgoing Via: headers)

...


\# Set to one of: Off \| On \| Full \| Block

...


ProxyVia On

...



NameVirtualHost \*:80

...



<VirtualHost \*:80>

...


&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; General setup for the virtual host
&nbsp;&nbsp;&nbsp; DocumentRoot "/usr/local/apache2/htdocs"

...


&nbsp;&nbsp;&nbsp; ErrorLog logs/error_log

...


&nbsp;&nbsp;&nbsp; TransferLog logs/access_log

...



&nbsp;&nbsp;&nbsp; ServerName lamouline.myvnc.com

...


&nbsp;&nbsp;&nbsp; ServerAdmin webmaster@les7arts.com

&nbsp;&nbsp;&nbsp; ProxyRequests Off
&nbsp;&nbsp;&nbsp; ProxyPreserveHost On
&nbsp;&nbsp;&nbsp; proxyPass / ajp://localhost:8009/

...


&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp;&nbsp; RewriteEngine On
&nbsp;&nbsp;&nbsp; RewriteRule \^/(images/.+);jsessionid=\w+$

...

 /$1&nbsp;&nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;
</VirtualHost>

...



include conf/httpd-ssl.conf
In httpd-ssl.conf

replace

Code Block

<VirtualHost \_default_:443>

...



\#&nbsp;&nbsp; General setup for the virtual host
DocumentRoot "/usr/local/apache2/htdocs"

...


ServerName www.example.com:443

...


ServerAdmin you@example.com

...


ErrorLog "/usr/local/apache2/logs/error_log"

...


TransferLog "/usr/local/apache2/logs/access_log"

by

Code Block

<VirtualHost \*:443>

...


&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; General setup for the virtual host
&nbsp;&nbsp;&nbsp; DocumentRoot "/usr/local/apache2/htdocs"

...


&nbsp;&nbsp;&nbsp; ErrorLog "/usr/local/apache2/logs/error_log"

...


&nbsp;&nbsp;&nbsp; TransferLog "/usr/local/apache2/logs/access_log"

...



&nbsp;&nbsp;&nbsp; ServerName lamouline.myvnc.com

...


&nbsp;&nbsp;&nbsp; ServerAdmin webmaster@les7arts.com

&nbsp;&nbsp;&nbsp; ProxyRequests Off
&nbsp;&nbsp;&nbsp; ProxyPreserveHost On
&nbsp;&nbsp;&nbsp; proxyPass / ajp://localhost:8009/

...


&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; RewriteEngine On
&nbsp;&nbsp;&nbsp; RewriteRule \^/(images/.+);jsessionid=\w+$

...

 /$1&nbsp;&nbsp;&nbsp;&nbsp;

It should work. On Windows the configuration is the same. Don't forget to edit url.properties file (change 8080 to 80 and 8443 to 443).

Additional notes for configuring mod_ajp_proxy

Sometime it is useful to let Apache Web Server to serve the static resources such as images, css, js etc for performance or other reasons.

In that scenario, you will need to mount the individual OFbiz application. For example:

Mounting Ofbiz application as show below will forward every request to Ofbiz including request for static resources such as images.

Code Block

    proxyPass / ajp://localhost:8009/

To mound individual application, use the below mentioned method. You will need to do this for all your application accept the one you want to be served by Apache Web Server e.g. /images

Code Block

 <Location /accounting/>
       ProxyPass ajp://localhost:9009/accounting/
 </Location>

Configure the Images folder in the Apache as shown below:

Code Block

<Directory /var/www/xxxx/images/>
       Options Indexes FollowSymLinks
       AllowOverride None
       Order allow,deny
       allow from all
    </Directory>

/var/www/xxxx/images directory is where Apache will look for your images.

Thanks to Raj Saini for this tip 

...