简体   繁体   中英

Deploy Web Application to Apache Http Server and Tomcat in one go

I am looking to front apache http server infront of tomcat 7, to render my static contents for better performance and scalability.

Now using pom, I was able to deploy to tomcat complete war.

But I could not find any plugin which will start http server and deploy static content to it.

Basically I looking to filter static resources and deploy it to http server while dynamic contents in the form of .war file to tomcat.

        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat7-maven-plugin</artifactId>
          <version>2.1</version>
          <configuration>
                <path>/</path>
                <keystoreFile>../classes/.keystore</keystoreFile> 
                <keystorePass>someSecret</keystorePass>
                <httpsPort>8443</httpsPort>
                <ajpPort>8009</ajpPort>
               </configuration>
        </plugin>

I looking for something similar with embedded apache http server plugin or stuff.

Well other reason to redeploy on the fly is the static resources has a build based key, which will help to invalidate client side cache on every new build.

Some other solution which I already have is point my static resource folder inside tomcat webapp thru apache htaccess file as root and use it, but I have to manually change the static folder name every time new build is generated in this case.

A possible solution could be to use maven-antrun-plugin. You could define an Ant task that copy the static resources in the remote http server and bind it to the deploy phase of the maven lifecycle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM