I put WordPress on GFv2 a while ago; this is a rerun on
GlassfishV3 and Quercus 4(other appservers are available; nothing about Quercus is GF specific. but Glassfishs’ asadmin command beats them all for scriptability).
I’m using JDK6 on OSX Leopard, but the drill is essentially the same on any UNIX.
install GFv3
Get the latest promoted build.
cd ~/Applications
curl -O http://download.java.net/glassfish/v3/promoted/glassfish-v3-b74.zip
unzip glassfish-v3-b74.zip
# add ~/Applications/glassfishv3/bin to your PATH
create a DB for wordpress
WordPress wants mySQL (no abstraction layer in PHP land).
We can at least get it to take advantage of a JNDI connection pool.
mysqladmin -u root -p create wordpress
echo "grant all on wordpress.* to 'wordpress'@'localhost' identified by 'wordpress'; " | mysql -u root -p
# create a connection pool / JNDI resource for the DB
cp mysql-connector-java-5.1.10-bin.jar ~/Applications/glassfishv3/glassfish/domains/domain1/lib/
asadmin start-domain
asadmin create-jdbc-connection-pool --datasourceclassname \
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource \
--restype javax.sql.DataSource --property \
User=wordpress:Password=wordpress:URL=jdbc\\:mysql\\://localhost/wordpress \
wordpress_pool
# check it works
asadmin ping-connection-pool wordpress_pool
asadmin create-jdbc-resource --connectionpoolid=wordpress_pool jdbc/wordpress
create a WordPress WAR file
mkdir -p /tmp/wordpress
cd /tmp/wordpress
# open up the Quercus WAR
curl -O http://caucho.com/download/quercus-4.0.2.war
unzip quercus-4.0.2.war
# install wordpress into it
cd ..
curl http://wordpress.org/latest.tar.gz | tar xzv
cd wordpress/
# point WordPress at the JNDI connection pool
curl http://files.hellooperator.net/glassfish/php/web.xml -o WEB-INF/web.xml
# pack up the WAR file.
jar cvf ../wordpress.war .
deploy the WAR file
asadmin deploy --contextroot '/' /tmp/wordpress.war
open http://localhost:8080/
Run through the usual wordpress installer – (DB settings don’t matter, this is just to create the schema). It should be pretty familiar.
exercise for the reader.
For a multi-hosting environment, it’d be good to do some kind of hands-off
install.


Hello,
thank, ist not easy to see how did yo to install quercus, please can you explain a bit more to understand.
thanks a lot.
March 29, 2010 @ 2:34 pm
Hi Jorge
Quercus ships as a standalone WAR file. All I did was unzip it, copy my PHP code into the top-level (where index.jsp would normally live), and then zip it back up.
March 29, 2010 @ 2:52 pm
If i have more than one php project i need package every project with Quercus inside?
March 29, 2010 @ 3:11 pm
With this approach yes – I prefer ‘fat WARs’ personally, it’s easier to deploy when you know you’re shipping everything you need.
If you want to enable Quercus in your appserver, then you wouldn’t need to bundle it in each WAR – it’s pretty easy.
See Arun Guptas article for details.
March 29, 2010 @ 3:21 pm
Thanks,
it works. thanks again for your help.
March 29, 2010 @ 5:03 pm
I have other question, when try to run my code i get the next error:
Fatal Error: ‘RecursiveDirectoryIterator’ is an unknown class name.
what i must be do it work.
March 29, 2010 @ 5:29 pm
can’t help with that one, sorry. maybe something to do with the app you’re running?
March 30, 2010 @ 7:27 pm