...
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 |
...
\*> 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 DocumentRoot "/usr/local/apache2/htdocs" |
...
ErrorLog logs/error_log |
...
TransferLog logs/access_log |
...
ServerName lamouline.myvnc.com |
...
ServerAdmin webmaster@les7arts.com ProxyRequests Off ProxyPreserveHost On proxyPass / ajp://localhost:8009/ |
...
RewriteEngine On RewriteRule \^/(images/.+);jsessionid=\w+$ |
...
/$1 </VirtualHost> |
...
include conf/httpd-ssl.conf |
In httpd-ssl.conf
replace
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
Code Block |
---|
<VirtualHost \*:443> |
...
# General setup for the virtual host DocumentRoot "/usr/local/apache2/htdocs" |
...
ErrorLog "/usr/local/apache2/logs/error_log" |
...
TransferLog "/usr/local/apache2/logs/access_log" |
...
ServerName lamouline.myvnc.com |
...
ServerAdmin webmaster@les7arts.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.
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
...