how to enable/disable directory browsing Red5 app - streaming

I have developed red5 app. How do I enable/disable directory browsing for the streams.

Open the config file : /conf/web.xml and modify the part related to "listings" :
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
By default the param-value was set to true on my instance. Changing it to false did the trick.
Important note : You need to restart Red5 for the changes to take effect.

Related

How to check that `undertow-handlers.conf` is read/used?

I have a Jboss 7.4.
I added into my war application a undertow-handlers.conf file in the WEB-INF folder.
Content is :
path(/)->samesite-cookie(mode=LAX, case-sensitive=false, enable-client-checker=false, add-secure-for-none=false)
But I can not see anything in the logs when Jboss is starting about that file. Except when the syntax of the file is not correct.
Is there a setting I can change to see if that handler is set and read/used?
Actually, setting LAX using this method for Samesite is not working at all and I wonder if this file is currently used/read at start.
Many thanks,

updating .properties files without a restart?

I updated some properties files (some i18n messages) on a running keycloak. But nothing happens. Do I need to restart keycloak to see the changes? That would be odd, as I instantly see changes to (freemarker) template files.
You can disable theme caching by modifying standalone.xml as follows:
<theme>
<!-- Change the lines:
<staticMaxAge>2592000</staticMaxAge>
<cacheThemes>true</cacheThemes>
<cacheTemplates>true</cacheTemplates>
to: -->
<staticMaxAge>-1</staticMaxAge>
<cacheThemes>false</cacheThemes>
<cacheTemplates>false</cacheTemplates>
<dir>${jboss.home.dir}/themes</dir>
</theme>

Why do I get a blank page while loading CGI in tomcat 7?

I am using tomcat to run CGI. I did all required configuration as per tomcat-CGI docs.
Deleted the comments in web.xml and adding <Context privileged="true">. In web.xml, I gave the "cgiPathPrefix" the value "cgi-bin", and I added this cgi-bin folder in the webapps/mycgiproject directory.
When I deploy it tomcat it shows me a blank page. couldn't find a reason since no error or log is generating.
Generally CGI files starts from -
#!/usr/bin/perl -T
But when i give space it works.
#! /usr/bin/perl -T
I am curious though I may find a way for this issue, but want a real solution to this problem ?
Also anyone knows how should be the folder structure inside tomcat.
My configuration is as follows -
tomcat/webapps/myperlproject/cgi/"cgi files"
in tomcat/conf/web.xml -
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>cgi\</param-value>
</init-param>
is it right ?

Access HTML within WAR file

I cannot access my index.html from my .war file. I placed the index.html in the root war file path. This is also where the META-INF and WEB-INF folders are located. When I try and access it from my url http://localhost:8080/Test/index.html i get
"JBWEB000065: HTTP Status 404 - Could not find resource for relative : /index.html of full path: http://localhost:8080/Test/index.html"
On my server.log I see that the server started successfully without any errors. Also, when I try and access the page I do not get any stack traces on the server.log. I also have a web service built within the war file and when I test the RESTful service (http://localhost:8080/Test/Query?key=Hello%20World) I get a successful response.
What am I doing wrong that I cannot access the web page?
"Could not find resource for relative : /index.html" indicates your app is trying to dig up index.html as a RESTful resource and not as a static file.
Without seeing your web.xml, I'm guessing you have a <servlet-mapping> entry that's handling all URL patterns; something like this:
<servlet-mapping>
<servlet-name>My RESTful servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
To address this issue, this SO looks helpful, which essentially suggests adding an additional token to the path to your resources, such as:
<url-pattern>/service/*</url-pattern>
This means you'll have to access your Query resource as http://localhost:8080/Test/service/Query?key=Hello%20World.

Logging for application in different environment Log4j

I am developing a logging framework using Log4j. I am not able to figure out how to maintain separate log files for different environment, i.e., development, testing, staging and production.
Firstly you'll need a different copy of your log4j.xml for each environment.
Lets call it log4j-dev.xml, log4j-test.xml, log4j-stage.xml and log4j-prod.xml each having their own settings like log file name and log levels.
You then pass in the corresponding file at the the server startup as a system property like below -
-Dlog4j.configuration=log4j-dev.xml
This URL has the example on how to pass this for Tomcat. The concept is the same for whichever server you are deploying on.
On Windows, I have used "set CATALINA_OPTS=-Dlog4j.configurationFile=log4j2-dev.xml" instead of log4j.configuration