Problems with DirectoryIndex

Alles, was den Apache betrifft, kann hier besprochen werden.

Problems with DirectoryIndex

Postby Shining77 » 24. February 2013 14:08

Hi @ll !!

I have my URL www.test.de which is configured with Apache and a Tomcat connected bei mod_jk. On Tomcat I am running a Webapp with the Spring Security framework where the starting page is always index.htm
Therefore the browser displays www.test.de/index.htm by request. But I want to have www.test.de and want to handle this with DirectoryIndex actually.

My configurations:

sites-enabled/000-default:

<VirtualHost *:80>
ServerName www.test.de
JkMount /* worker2
DirectoryIndex index.htm
<Directory "/opt/tomcat/webapps/ROOT">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteRule ^/(.*);jsessionid=(.*) /$1 [R=301,L]
</VirtualHost>

workers.properties:

worker.worker2.port=8109
worker.worker2.host=localhost
worker.worker2.type=ajp13
worker.worker2.cachesize=10
worker.worker2.socket_keepalive=1
worker.worker2.recycle_timeout=300


Any idea and good ideas for my problem?

Thanks!
Shining77
 
Posts: 2
Joined: 24. February 2013 14:00
XAMPP Version: 5.6.3
Operating System: Linux

Re: Problems with DirectoryIndex

Postby Nobbie » 24. February 2013 15:07

Where is your DocumentRoot?
Nobbie
 
Posts: 6484
Joined: 09. March 2008 13:04

Re: Problems with DirectoryIndex

Postby Shining77 » 24. February 2013 18:41

Good question.

I would think that I do not have to define this DocumentRoot because I am using the Tomcat in the backend.

Or do the DocumentRoot should be my /opt/tomcat/webapps/ROOT ?
Shining77
 
Posts: 2
Joined: 24. February 2013 14:00
XAMPP Version: 5.6.3
Operating System: Linux

Re: Problems with DirectoryIndex

Postby Nobbie » 24. February 2013 20:51

Shining77 wrote:Good question.

I would think that I do not have to define this DocumentRoot because I am using the Tomcat in the backend.


But you want Apache to pass index.html from DocumentRoot to Tomcat, in case there is no file specified. How can Apache know which index.html from which Directory? The "DirectoryIndex" is an Apache functionality, not a Tomcat functionality.

I dont know if it works with DocumentRoot specified in VirtualHost, but i am pretty sure that i CANNOT work in anyway without DocumentRoot specification.

Shining77 wrote:Or do the DocumentRoot should be my /opt/tomcat/webapps/ROOT ?


How can I know that? It is your installation and it is your DocumentRoot. Simply provide the folder which contains the index.html you want to be loaded. If it still does not work, i am not sure that there is a simple solution to that, because (as said before) "DirectoryIndex" is an Apache functionality whereas you wanted it to be loaded by Tomcat.
Nobbie
 
Posts: 6484
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 3 guests