Create two separate WAR packagings
Define security constraints in the web.xml files of both war submodules
Provide JDBC jars in the standalone server WAR