Showing posts with label Drupal. Show all posts
Showing posts with label Drupal. Show all posts

Friday, August 20, 2010

Why Movable Type, Drupal, or Wordpress on GlassFish?

WordPress





The question of relevance has come up on why would you implement Movable Type, Drupal, or Wordpress on GlassFish. Is it because you can?

The answer is one of technology fundamentals and implementation strategies. I am a Java developer (if you could not figure that out from the blog title). I have access to GlassFish which I use for all of my web based application deployments. I want to be able to simplify my administration requirements by using a unified deployment platform. I also want to be able to combine the extensive libraries and frameworks that are available for Java. I want a simple intuitive administration console to handle most of my day-to-day needs. I want administration, and deployment to be scriptable. GlassFish solves a number of these issues, along with using Java, and Java based implementations of some popular languages like JRuby, and Jython.

First, GlassFish versions 2 and 3 are the reference implementations for Java Enterprise Editions (EE) 5 and 6 respectively. If you are doing enterprise software development, and want to use the latest reference versions, you should use GlassFish. I often write about Java Enterprise Edition (EE). I try to focus on the core technology since this keeps it compatible across other EE containers should you choose to move it to another container. GlassFish version 3 has made a number of positive steps in JEE 6 to make it easier to use. The new profiles in GlassFish make it easier to do web development.

Apache web server is very powerful. There is no question about that, but installing modules, and configuring it is not simple. If a module is not available in one of the pre-configured and installed versions on your system, you must compile it yourself. I am a very competent Apache administrator, and I have never had a simple download, and compile deployment. Let me contrast that with GlassFish, if you have Java 6 installed on your system, download and run it. If you are using JRuby, or Jython, GlassFish can handle it right out  of the box. In the case of JRuby, there have been a number of performance tests to show JRuby on Glassfish is faster that Ruby on WEBrick, or Mongrel. The Common Gateway Interface (CGI) servlet will allow you to take advantage of additional CGI technologies with simple configuration on a server wide basis, or on a per application basis.

Apache Web Server and GlassFish can take advantage of a number of frameworks. Apache Web Server can run Ruby applications with the appropriate module. However, it can not take advantage of other independent frameworks. Java on GlassFish allows Ruby developers to use Java frameworks like Swing within their applications. You can even create polyglot applications which use JRuby, Jython, and Clojure. This may be possible  with Apache Web Server, but I am unaware of it. This is a comment point for readers.

Simple and Intuitive administrative interface. That describes GlassFish administration console to a tee. I would even include elegant, and beautiful.

GlassFish Administration Console

Glassfish includes a very complete command-line interface. Anything you can do on the GUI based interface, you can do from the command-line. It also includes a number of advanced features which are not available in the adminstrative GUI.

Finally, as I noted above it has multiple configuration points with languages and technologies including Microsoft technologies.

I have found that GlassFish handles all of my Web based needs in a single platform. This combination of technology and integration points makes it easy to install relevant best of breed software like Drupal, Movable Type, or Redmine on the same platform and integrate functionality between them as necessary. It is very nice to have Redmine and Hudson CI running on the same platform. Combine it with Mercurial, and share a common SSO. This is not done easily on Apache Web Server, or any other platform.

I hope this clarifies my position on its relevance with Movable Type, Drupal, Wordpress, etc.

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.

Software
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

Database:
  1. Create the Drupal user in the database.


    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'drupal';

    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;
Quercus:

Download and extract the quercus-4.0.3.war file.

jar -xvf quercus-4.0.3.war WEB-INF
 
Drupal:
  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


    unzip mysql-connector-java-5.1.12.zip
  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.

NetBeans
  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.

Wednesday, February 18, 2009

Drupal on GlassFish using Quercus

I will explain how to get Drupal running on GlassFish in 10 minutes.

Requirements:
Database:
  1. Create the Drupal user in the database.
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'drupal';
    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;
Quercus:

Download and extract the quercus-3.2.1.war file.
jar -xvf quercus-3.2.1.war WEB-INF
Drupal:
  1. Download and extract Drupal 6.9
  2. Copy the WEB-INF directory and files from the Quercus into the Drupal directory.
NetBeans:

  1. Create a new project in NetBeans. Choose Java Web and Web Application with Existing Sources.


  2. Fill in the Name and location properties for the project.

    Note: Please make sure that you choose a different folder for the project files. Please see the image below as an example.


  3. Next select the application server, and set the Context Path. I renamed my context to /drupal


  4. Next select the Web Pages folder. This should be the top directory of the Drupal directory you extracted. This is the directory which contains index.php.


  5. Click Finish

  6. Open the project and navigate to the Web Pages folder. Navigate to the sites --> default directory. Right click on the default.settings.php file and copy. Paste the file back into the directory. Right click on the file it should be named something like default.settings_1.php, rename the file to settings.

    Note: NetBeans will append the .php to the end of the file.


  7. Right click on the project and select Properties. This will bring up the project properties. Select the Libraries Category. Here you will see the files that were included from Quercus 3.1.2 which were in the WEB-INF/lib directory.

  8. Click on Add Library and select MySQL JDBC Driver. Click OK.


  9. Finally Run Main Project (F6).


Drupal Configuration:

If you were successful, you should see the Drupal Configuration page.



  1. Select Install Drupal in English (You may choose differently based on your requirements).


  2. Fill in the database with the information we created earlier.

    • Check mysqli
    • Database Name: drupal
    • Database Username : drupal
    • Database Password: drupal


    Click Save and Continue.


  3. That will complete the database installation and bring up the Site Configuration Screen. Fill in the values and click Save and Continue.


  4. Finished. You should get an Installation Complete screen. Click on your new site.

    Note: My installation has an error message because I don't have SMTP configured on my Mac.



Congratulations! You have Drupal 6.9 running on Quercus 3.1.2 on GlassFish 2.1.

Popular Posts