Enabling browser caching in wildfly 8 - browser-cache

How can I configure Wildfly to Leverage browser caching? I know this can be done in apache through htaccess, but how to achieve same in wildfly.
I tried to create .htaccess file and place it in both the wildfly's deployement folder and in my project directory one by one but nothing worked.

We need to add the cache control filter in the standalone.xml file.
The following link explains it all.
Leaverage browser caching

Related

How do you disable "/controlpanel" directory redirect to :2083 in WHM?

I've used WHM and cpanel for years but recently noticed that after an update the "/controlpanel" directory has been automatically added allowing domain.com/controlpanel to redirect to domain.com:2083
How do you disable this redirect that is public facing?
The /controlpanel and /securecontrolpanel are controlled by ScriptAliasMatch in httpd.conf which cannot by modified directly as WHM/cPanel will rebuild it again as it where before the manual modifications. So it will be better if modifications done through one of the following options:
SSH access is needed to apply any one of these
Modify the yaml file which used in the rebuild apache configuration process, the file can be found under /var/cpanel/conf/apache/local or /var/cpanel/conf/apache/main then rebuild apache configuration by running /scripts/rebuildhttpdconf then restart apache by running /usr/local/cpanel/scripts/restartsrv_httpd
Modify the template file which used to parse the previous yaml file in order to generate the configuration file. First copy this file /var/cpanel/templates/apache2_4/ea4_main.default to /var/cpanel/templates/apache2_4/ea4_main.local then start modifying it then rebuild and restart apache.
And my vote goes to the first option to keep it clean and simple as possible but it worth knowing both ways so you can extend the functionality as much as you can.
For more details:
Apache Global Configuration docs
Apache Custom Templates docs

Trac on shared server

I'm facing an odd problem with Trac's authentication. I have it installed in other servers and never had problem to install it, but now I'm trying to install it on a shared linux server where:
don't have access to httpd.conf;
only available scripts are php and python (wsgi);
no dev tools at all (so no chance to use gcc to compile something);
.htaccess is okay.
Well, trac is installed and working in anonymous mode and I can not find a way to make it private. It looks like it only relies on Apache basic authentication but I can not do this without httpd.conf access.
On my other instalations I use <Location> inside httpd.conf, but I can't use this tag inside .htaccess. I know that I can simply put <Location>'s content inside a .htaccess file and put this file in any www subdirectory to protect it. But since this is a wsgi script in another directory outside www I have no place to put that .htaccess.
I'm looking for a way to solve this by:
still using apache auth with any other .htaccess configuration that I've missed;
any other way Trac could be used in privative besides relying on apache;
any other issue/project tracking similar to trac is an option too.
I'm using AccountManagerPlugin on a shared Linux server machine of mine without issues.

Trying to Properly configure the mod alias in Apache

I'm running apache 2.2.24 on Max OS X 10.9.1. Currently, we have a network drive that we access all of our Git repos on at /Volumes/GitWebsites. I would like to configure Apache to serve our PHP based repos from that directory. So, localhost (or 127.0.0.1)/phpsite1/ or /phpsite2? etc. will serve sites from /Volumes/GitWebsites/phpsite1/ or /phpsite2/ in the browser. My two questions are:
Do I simply modify the server root or do I need to use the mod-alias in the httpd.conf file?
What are the permission setting I need to in order for apache to access /Volumes/GitWebsites ?
I've done configuration changes like this in IIS 7.5 and set up a NodeJS dev environment but still new to make large scale changes to Apache. Thanks for any help given.
If you are happy with serving the contents of /Volumes/GitWebsites as it is then it should be fine to point the document root at it. It's also makes it easy to add sites later.
However this could be troublesome later if you want to manage php configuration later on for the sites separately.

Apache like Rewrite Rules in Openshift

I have configured Jboss7 on Openshift yesterday. All I need to have an internal rewrite rule to have /members.html -> members.jsp.
This requires user to see members.html while the actual file(members.jsp) is served by Jboss itself.
Dont know correctly how to setup mod_jk if required but surely I would like this thing to work anyways as I have urls submitted in google and shifting site on openshift should not require me to change the URLs.
I don't think you have access to the Apache configuration on the server. You would need root permissions for that. Have you considered an alternative approach via a web application filter. There is UrlRewriteFilter - http://tuckey.org/urlrewrite/ - which might solve your problem.

serve a GWT application from the app server root

I have a GWT application, which I deploy as a WAR file to a Jetty 8 server.
I want it to be accessible via
http://<myserver>/
instead of
http://<myserver>:8080/MyApp/MyApp.html
I understand I can configure Jetty to run on port 80 instead of 8080 or have an apache instance running on port 80 and forwarding requests to Jetty running on 8080 (don't see a benefit of the latter, though).
but how can I deploy the GWT app to be accessible at the server ROOT?
so far I see I can create myapp.xml in Jetty/contexts folder and put
<Set name="contextPath">/</Set>
there. I can also rename MyApp.html to index.html. but I'm not sure this is the "recommended" approach
I think you pretty much answered your own question:
The application server (e.g. Jetty) is responsible for the context path, so you must set it somehow in the application server. This is different for each server, e.g. in Tomcat one possibility to achieve this is renaming the war file to ROOT.war. (I don't know all the possible ways how to do this in Jetty off-hand.)
Note: The file that is served when going directly to the context URL can be determined in your web.xml, using
<welcome-file-list>
<welcome-file>MyApp.html</welcome-file>
</welcome-file-list>
So you don't have to rename it to index.html.
ok, accepting my own answer:
create myapp.xml in Jetty/contexts folder
thank you, Chris!