Skip to content

Instantly share code, notes, and snippets.

@mortenbra
Last active April 27, 2023 10:47
Show Gist options
  • Save mortenbra/faf34058914947487d1c to your computer and use it in GitHub Desktop.
Save mortenbra/faf34058914947487d1c to your computer and use it in GitHub Desktop.
Apache custom configuration for Apex, ORDS and Tomcat
# customized Apache configuration
# add this to the end of /etc/httpd/conf/httpd.conf
# or put it in a separate file such as /etc/httpd/conf.d/apex.conf
# disable sensitive version info
ServerSignature Off
ServerTokens Prod
# standard alias for Apex image files
Alias /i/ "/var/www/apex/images/"
# forward dynamic (ORDS) requests to Tomcat
<VirtualHost *:80>
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /ords ajp://localhost:8009/ords
ProxyPassReverse /ords ajp://localhost:8009/ords
</VirtualHost>
# enable compression of static content
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css text/javascript
</IfModule>
# enable client caching of static content
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 7 days"
ExpiresByType image/jpeg "access plus 7 days"
ExpiresByType image/png "access plus 7 days"
ExpiresByType text/css "access plus 7 days"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType application/x-javascript "access plus 7 days"
</IfModule>
@ChaosEngine
Copy link

ChaosEngine commented Nov 30, 2021

Mine tweak was donw with location /ords/ and here goes:

<VirtualHost _default_:443>
    ....
   #various ssl cert and ports and servername stuff

        # Apex-Ords reverse proxy
        <Location "/ords/">
                ProxyPass http://127.0.0.1:8888/ords/
                ProxyPassReverse http://127.0.0.1:8888/ords/
                ProxyPreserveHost On
                RequestHeader unset Origin
        </Location>
        <Location "/i/">
                ProxyPass http://127.0.0.1:8888/i/
                ProxyPassReverse http://127.0.0.1:8888/i/
        </Location>
</VirtualHost>

Big chunk of it was taken from here: https://tedstruik-oracle.nl/ords/f?p=25384:1095::::::
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment