Saturday, June 26, 2010

Drupal 6 on GlassFish 3 with Quercus using NetBeans 6.9 in less than 5 minutes

This is an update to my previous blog post on using Drupal on GlassFish with Quercus. Since I have been writing blog posts I have found that it is important to distinguish which versions of software I am using.

Mac OS X 10.6.4
MySQL 5.1.48
MySQL Connector/J 5.1.12
NetBeans 6.9
GlassFish 3.0.1
Drupal 6.17
Quercus 4.0.3

  1. Create the Drupal user in the database.


    Note: This is not secure and should only be used for demo.

  2. Create a new database in mySQL called drupal.

    create database drupal character set utf8;

Download and extract the quercus-4.0.3.war file.

jar -xvf quercus-4.0.3.war WEB-INF
  1. Download and extract Drupal 6.17
  2. Copy the WEB-INF directory and files from the Quercus into the Drupal directory.
MySQL Connector/J
  1. Extract mySQL Connector/J

  2. Copy the mysql-connector-java-5.1.12-bin.jar to the ../glassfish-3.0.1/glassfish/domains/domain1/lib/ext directory. This allows any project deployed to domain1 to connect to a mySQL server.

  1. Create a new project. Select Java Web and Web Application with Existing Sources. Click Next.

  2. Select the location of the files we previously extracted for the Location.
  3. Accept default project name.
  4. Change the project folder name to drupal. Click Next.

  5. Ensure GlassFish Server 3 is selected as the server.
  6. The Java EE version should be Java EE 6.
  7. Change the context path to /drupal. Click Next.

  8. Set the Web Pages Folder: to point to the top level of our sources. In our case it is drupal-6.17. Click Finish.

  9. Open the Web Pages -> sites -> default folder. You should see a file called default.settings.php. Copy the file and rename it to settings.php. Our application configuration is complete.

  10. Go to the Services tab. Expand the Databases tree. Select MySQL Server. Right click and select Create Database from the context menu.
  11. Create a database called drupal. Check the checkbox for Grant Full Access To:. Pick the drupal@localhost user. Press OK.

  12. Click on the deploy button. After the application is deployed to GlassFish, you should see Drupal Configuration screen below.

  13. Select Install Drupal in English
  14. Set up the database configuration. In my case, I chose the mysqli radio button and provided database name: drupal, database username: drupal, and database password: drupal.

    Note: I had to fill in the information twice. DO NOT USE MY CONFIGURATION IN PRODUCTION.

  15. Fill in the site configuration parameters.

    Note: Once the site is deployed. I received an SMTP error as noted below. It seems that it can be safely ignored.

  16. Installation Complete.

Here is an example of what my finished site looks like.

If you want to watch a 5 minute video on the whole process, please check the link below.


Unknown said...

Thanks for the information, we will add this story to our blog, as we have a audience in this sector that loves reading like this” web development

vinfotech said...

This is great to read and I appreciate it that you shared handy post . I will keep this post in mind.

Popular Posts