...
You need to use a 2.2+ version of HTTPD. I used 2.2.6.
In httpd.conf (or in a file in sites-available on Debian/Ubuntu using a2ensite)
Uncomment (or compile with at least these modules using --enable or on Debian/Ubuntu use a2enmod)
...
Code Block |
---|
ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow 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> # General setup for the virtual host. ### JLR note : this block may be useless on Debian/Ubuntu since these parameters already defined in apache2.conf (but you may want to specialize logs by instances...)ServerName www.example.com:443 ServerAdmin you@example.com ProxyRequests Off ProxyPreserveHost On DocumentRootproxyPass "/usr ajp:/local/apache2/htdocs"localhost:8009/ ErrorLog "/usr/local/apache2/logs/error_log"RewriteEngine On TransferLogRewriteRule "^/usr/local/apache2/logs/access_log" ServerName www.example.com:443 ServerAdmin you@example.com ProxyRequests Off ProxyPreserveHost On proxyPass / ajp://localhost:8009/ RewriteEngine On RewriteRule ^/(images/.(images/.+);jsessionid=\w+$ /$1 </VirtualHost> include conf/httpd-ssl.conf (notor but in same file include ../apache2/httpd-ssl.conf if using a file in sites-available on Debian/Ubuntu using a2ensite) |
In httpd-ssl.conf
...
replace (according to your setup, ie. keeping the right pathes)
Code Block |
---|
<VirtualHost _default_:443> # 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
|
by
Code Block |
---|
<VirtualHost *:443> |
Code Block |
<VirtualHost *:443>
### JLR note : this block may be useless on Debian/Ubuntu since these parameters already defined in apache2.conf (but you may want to specialize logs by instances...)
DocumentRoot "/usr/local/apache2/htdocs"
ErrorLog "/usr/local/apache2/logs/error_log"
TransferLog "/usr/local/apache2/logs/access_log"
ServerName www.example.com:443
ServerAdmin you@example.com
ProxyRequests Off
ProxyPreserveHost On
proxyPass / ajp://localhost:8009/
RewriteEngine On
RewriteRule ^/(images/.+);jsessionid=\w+$ /$1
|
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.
...
Thanks to Raj Saini for this tip
I you need to use an svn repository on the same server the tip is to add
Code Block |
---|
proxyPass /svn ! |
just before
Code Block |
---|
proxyPass / ajp://localhost:8009/ |
in the 443 VirtualHost. This will give acces to your svn repsoitory (supposed to be declared as <Location /svn>) only through https. If you need also access through https, do the same in the 80 VirtualHost.
Anchor | ||||
---|---|---|---|---|
|
...