Reputation:
How can I have my application made in Play! 2.0.4 (latest "production ready" package) exported to run on either Apache 2.2 or Tomcat 6.0.18 at a path like e.g. tomcatserver:8080/myApp/
?
The application always runs at /
under localhost:9000
on either Dev or Prod environment.
war
command but it seems unavailable for this version.stage
command, but it failed since it needs chmod
and I'm using Windows XP (although my Apache is in a FreeBSD machine and Tomcat is in a Linux one).dist
command. It made the myApp-1.0-SNAPSHOT.zip, but... I can't use it anywhere, its contents are structured in an unfamiliar way to the web servers.Please, can someone share a light here on how to get it deployed on one of those?
Upvotes: 3
Views: 517
Reputation: 21564
You should take a look at the HTTP Fronted documentation, especially the Apache integration.
It should be something like:
LoadModule proxy_module modules/mod_proxy.so
…
<VirtualHost *:80>
ProxyPreserveHost On
ServerName www.loadbalancedapp.com
ProxyPass /excluded !
ProxyPass /myApp http://127.0.0.1:9000/
ProxyPassReverse /myApp http://127.0.0.1:9000/
</VirtualHost>
You'll need to deploy the Play application in standalone mode, ie without any Java EE container (Tomcat & co). Play 2 core does not provide a way to generate a .war file.
If you want to absolutely use a Java EE container, take a look at the play2-war-plugin.
Upvotes: 3