Cant deploy "war" file from Virtual Hosts, see a directory listing.

Posted by Kaustubh P on Server Fault See other posts from Server Fault or by Kaustubh P
Published on 2011-01-17T13:18:15Z Indexed on 2011/01/17 13:54 UTC
Read the original article Hit count: 300

This is my httpd.conf configured with Virtual hosts:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName http://foo.baz.in
DocumentRoot /var/www/foo/
</VirtualHost>

<VirtualHost *:80>
ServerName http://bar.baz.in
DocumentRoot /var/www/
</VirtualHost>

The second virtual host is a Wordpress blog, configured with .htaccess, and index.php in the root i.e. /var/www, and rest of the files in wordpress's own folder.

However, the first virtual host is a "war" file, and when I goto foo.baz.in, I see the directory listing, containing the war. I also tried changing the DocumentRoot to /var/www/foo/foo.war` but I get an error

Restarting web server: apache2Warning: DocumentRoot [/var/www/foo/foo.war] does not exist

I also changed the owner and permission of the war to www-data:www-data and changed the permissions to 755, but to no avail.

How do I make apache deploy my "war"?

Thanks.

© Server Fault or respective owner

Related posts about apache

Related posts about virtualhosts