Enabling JBoss AS 7 Directory Lists

I have the following directory structure deployed in JBoss AS 7.1.1.Final (under standalone/deployments ):

 doc.war -> module1 -> index.html -> module2 -> index.html 

As you can see, doc.war does not have index.html. When I look at localhost: 8080 / doc / module1 / , the correct index.html is displayed, but when I look at localhost: 8080 / doc / , JBoss shows an error message (404 - requested resource is unavailable).

I think this is because directory lists are disabled by default in JBoss AS 7. How do I enable directory lists, both globally and more specifically for this application?

Edit

Based on Mukul Goel's answer, I ran a CLI command to add the static resource function, restarted the server, and retried the request, but it did not work.

Here is the corresponding snippet from standalone.xml . Please note that I have a built-in connector.

 <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="true"> <configuration> <static-resources listings="true"/> </configuration> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https"/> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem> 

The error message displayed by JBoss is displayed here:

JBoss Error Message

Update

So, the conclusion is that there is a problem with the official JBoss 7.1.1.Final ( http://www.jboss.org/jbossas/downloads ) download. I was unable to get Directory Listings to work with this version. After trying a later version (from the JBoss CI server to https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/ ), I was able to see the directory lists after applying the configuration change that Mukul Goel suggested below.

A potential source of this problem may be the version of JBossWeb that is used in JBoss. Official 7.1.1. The final packages of JBossWeb 7.0.13. Mukul (see below) was able to get him to work on a version of JBoss that integrates JBossWeb 7.0.16.

I accept Mukul Goel's answer as a solution to this problem, but remember that it probably won't work with the official 7.1.1.Final download.

+4
source share
1 answer

Yes, you're right, directory lists are disabled by default (security measure)

To include a directory listing in JBOSS

Try the following CLI command to enable the dialect list:

In domain mode

/ profile = complete / subsystem = Web / configuration = static-resources /: attribute records (name = lists, value = true)

.

Offline

/ = web subsystem / configuration = static-resources /: attribute records (name = lists, value = true)

It will generate the following configuration:

  <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false"> <configuration> <static-resources listings="true"/> </configuration> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> </virtual-server> </subsystem> 

UPDATE: I tried this myself, as the user is facing problems.

RAN CLI Command Offline

This was generated, please note that the native one is disabled and the HTTPS connector has not been created for me (don’t you know why it is displayed for you?) Are you using openSSL somewhere?)

relevant code from standalonex.ml

I created a webprojet sample (client-side project) with two htmls, published it in jboss and hit url

 http://localhost:8080/sample/ 

and this is a screenshot of the directory listing

Directory listing screenshot

The team worked for me, so this includes a list of directories on JBOSS AS7.1.1 Final (I also use the same version) Thus, the question comes down to the rest of your server configuration, the structure of your application, the technologies you use, sources, etc. . And also if you use some ssl library.

UPDATE 2 Proposed a new boot and reconfiguration environment and looked nwinkler still ran into problems even with fresh distribution (JbossWeb 7.0.13). So it was suggested to take nightly assemblies from

ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest

Just follow the link and upload something to the last successful artifact

And the problem is solved. Looks like an error with jbossWeb 7.0.13

Go through the comments, the discussion may be helpful.

+8
source

Source: https://habr.com/ru/post/1438818/


All Articles