WordPress is a very popular content management system to create Blogs and websites.
If you have existing java application hosted on tomcat server then adding wordpress to same tomcat might save in terms of memory and resource utilization.
Now you can deploy wordpress on any java based application server like tomcat, thanks to Quercus.
Quercus is Caucho Technology’s 100% Java implementation of PHP 5 released under the Open Source GPL license. Quercus comes with many PHP modules and extensions like PDF, PDO, MySQL, and JSON. Quercus allows for tight integration of Java services with PHP scripts, so using PHP with JMS or Grails is a quick and painless endeavor.
It has been more simplified by bonfab.io which created a maven based WAR project that includes Quercus and wordpress.
For more updates, you can follow – bonfab.io blog but here are steps for quick reference –
- Download JWordpress war from here.
- Download mysql java connector jar from here and add it in WEB-INF/lib.
- If you are using MariaDB, then get the mariadb java connector from here.
- Deploy this WAR to tomcat and start the tomcat.
- Make sure you create one database user in mysql/mariadb with one empty database for our new wordpress.
- Access http://localhost:8080/JWordpress and you should see the famous 5 minute setup of wordpress. Configure the database and you should be all set.
You can even create this war with Maven as described on JWordpress repository.
Hope that helps!