title: Setting spring active profiles in amazon AWS EC2 instance
body: <p>I have setup Amazon AWS EC2 instance and have installed tomcat8 and jdk 1.8.
  I have deployed Spring/Hibernate based web-app war file in my tomcat's webapps directory and so far everything works fine. Its Spring Web MVC.</p>
  
  <p>But I want to implement <strong>spring.active.profiles</strong> with my existing configuration which never works.</p>
  
  <p>Below is my JPAConfig file's content which works well on local server but just not on <strong>AWS EC2</strong>. I feel there's some misconfiguration on my EC2 instance.</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @PropertySources({ 
      @PropertySource("classpath:application.properties"),
  
         @PropertySource("classpath:application-${spring.profiles.active}.properties"),
          @PropertySource("classpath:api.properties"),
          @PropertySource("classpath:mailer.properties") })
      public class JPAConfiguration {
  
          @Autowired
          private Environment environment;
  
      //rest or codes    
  </code></pre>
  
  <p><strong>If I comment <code>@PropertySource("classpath:application-${spring.profiles.active}.properties"),</code> line then things work fine on EC2 but it picks up <code>application.properties</code> file contents for obvious reasons. And when I uncomment it, my EC2 URL returns 404 NOT found.</strong></p>
  
  <p>Please help in implementing spring.active.profiles feature on EC2 instance so that my EC2 instance uses my <code>application-prod.properties</code> file</p>
  
  <p>Also, <strong>please note that for some unknown reason, I cant see any other directory except "webapps" in my tomcat8's directory</strong></p>