Sensible Open Source

Blog Status

  • 4 yrs 48 wks 5 days old
  • Updated: 11 Mar 2010
  • 455 entries
  • 174 comments
Total: 1,213,250
since: 5 Apr 2005

LinkBlogS

Creating Vidcasts

18 June 2007, Monday 7:05 P GMT-06
Tags:      

Man, Can't Microsoft Catch A Break?

16 March 2007, Friday 12:26 P GMT-06

Viacom, Google andYou Tube, Oh My!

16 March 2007, Friday 12:25 P GMT-06

Switch to digital TV to start in October

16 March 2007, Friday 7:46 A GMT-06

Is the Ice Ready? No, Its Still To Hot To Use...

16 March 2007, Friday 7:43 A GMT-06

MIT Entire Curriculum At disposal of e-learners

6 March 2007, Tuesday 11:52 A GMT-06

A cure for e-mail attention disorder?

2 March 2007, Friday 12:51 A GMT-06
Tags:  

Windows-on-Mac software gets virtualization update

1 March 2007, Thursday 5:08 A GMT-06

EnterpriseDB is/n't Open Source

1 March 2007, Thursday 3:37 A GMT-06

BitTorrent download portal debuts

27 February 2007, Tuesday 9:05 A GMT-06

$45b TXU buyout

27 February 2007, Tuesday 9:02 A GMT-06

iPhone Competitors Got The Touch

26 February 2007, Monday 3:43 A GMT-06
Tags:        

HTC - Smart Mobility

25 February 2007, Sunday 4:22 A GMT-06

Hard to find 1-800 numbers

23 February 2007, Friday 8:35 A GMT-06

Cuba Embraces Open-Source Software

21 February 2007, Wednesday 3:10 A GMT-06

Vista at the tipping point, Err Dipping Point?

11 February 2007, Sunday 11:11 A GMT-06
Tags:  

PostgreSQL Open Source And Persistence

3 February 2007, Saturday 10:32 P GMT-06

Blackboard Pledges No Patent Blocks

3 February 2007, Saturday 10:28 P GMT-06

UVU

5 January 2007, Friday 11:58 P GMT-06

Open-source IP PBX software appliance"

4 January 2007, Thursday 3:44 A GMT-06

Asterisk an under-appreciated Open Source Success Story

4 January 2007, Thursday 3:43 A GMT-06

Open Source AJAX Tooling

4 January 2007, Thursday 3:41 A GMT-06

Google MAIL API Secuirty Alert

1 January 2007, Monday 7:37 P GMT-06
Tags:    

United States Patent Application: 0060288329

26 December 2006, Tuesday 4:00 A GMT-06

LinkBlog Popular Tags

                                       







««Mar 2010»»
SMTWTFS
  12
3
456
789
10
111213
14151617181920
21222324252627
28293031

 

August 16, 2012

Time Left

2 years 5 months 4 days

                   

RSS Add-Me








Google Related Links

Mac OS X: [JEE Environment] Installation, Configuration and Final Deployment

posted 20 February 2006, Monday

Lets get right to it! The software to download is listed below:

1. Jetty (HTTP, Servlet)
2. MySql

JETTY INSTALLATION


Jetty website can be found here. The version used here can be found here Jetty-5.1.10. Version zip file is jetty-5.1.10-all.tar.gz.

Unzip the the file in a directory, for demonstartions a staging area directory ~/Scratch/Jetty was creatted. Unzipping the jetty-5.1.10-all.tar.gz to this directory will create a directory structure as follows:

In UNIX/MAC OS X/Linux the home directory '~' or user directory is the perfect location for our staging directory and server directory. This allows the developer to launch the servers from a shell command wihtout installing in the usr/local directories. The execution is kept local at this point and provides for a better development environment. 

1. ~/Scratch/Jetty - unzipping archive
2. ~/Scratch/Jetty/jetty-5.1.10-all/jetty-5.1.10 - Directory created from unzip

NOTE:
Downloading jetty-5.1.10-all.tar.gz was chosen as not to work through the complications of compilation. If a desire to download the source archive for Jetty in order to understand the compliation process would be a very positive exsercise. However, due to the our purposes this will be considered out of scope. Future entries may consider instruction on this topic; only demand of request will be the deciding factor. :-)

Now from this point, move the contents of ~/Scratch/Jetty/jetty-5.1.10-all/jetty-5.1.10 into the ~/Scratch/Jetty and delete the directory ~/Scratch/Jetty/jetty-5.1.10-all.

In order to keep consistent in all platforms putting all servers in a consistent directory will allow consistent documentation. This may or may not be the proper setup for production, however, the idea of this setup is to promote familiarity with the installation. Once, you feel comfortable with this installation preparing this environment for production should provide a smoothier implementation.

Move the ~/Scratch/Jetty to a directory ~/Servers/Jetty. The directory contents should look like Figure 1.


Of course, it is important to peruse this directory structure and understand what each directory contains and its function as well as the function and purpose for each file. Reading the "README.TXT" can only be a good thing, my suggestion is do it.

Now lets get Jetty up and running!! First of all, insure you do not have any server hanging off port 8080. If Tomcat, Resin or any other server occupies this port stop it or change the port in the jetty.xml to a port of your choice.

Now let's launch Jetty.

The simply way is to type java -jar start.jar from a command line. However, it would be better to launch this command with the os command line background command & . This is to allow a comman window with the same environment available to execute the shutdown process of the jetty server. This effort makes it easier to keep a shell available for log viewing, stopping the server and checking the server health.

Setting up an environment variable for jetty is completed from the shell as seen below:

export JETTY_HOME=<jetty install directory>

So, execution of the Jetty server is as follows:

 java -jar /usr/local/jetty/start.jar &

In the internet browser enter the URL Enter http://localhost:8080/ and the response from the server is an Error 404 - Not Found!! as seen in Figure 2


The result is simply explained as the jetty server which was launched without a context. Explaining the context issue will follow, for now select the Template Webapp and the javadoc links. Just read them, look around and get familar with the documentation.

Now, go to the initial command prompt and type: java -jar stop.jar

This will stop the jetty engine. We will now start jetty again with a context. For expediency, we will use the demo applications that reside in the demo directory of the jetty directory structure. The demo provides a test to insure accurate installation that can establish validity across all platforms.

To launch the Jetty server with the demo context simply go to a shell, change directory to ~/servers/jettty.

Executiing the server is exactly the same as done above, however, the demo context must be given as a prameter.

The command line is as follows:

~/Servers/jetty/> java -jar start.jar etc/demo.xml &



The server is accessed by http://localhost:8080/ as you can see by the url in figure 3 is http://localhost:8080/jetty/index.html. Of course, this url is rendered by the demo.xml. Investigating how this works is extrememly valuable and it is highly sugggested and recommended.

However, this concludes the MAC OS X installation entry. The instructions to  Windows can be found here.   After your target OS is configured the next step is to install MySQL.

Once the installations are compete the review of JSP's, Servlets and Database access will be presented.





MYSQL INSTALLATION



The MySQL version we are installing is version 5.0. Version 4.X maybe more stable and more familiar to most developers, but the belief of using the newest and most competent version is the only justification for version 5.0's use in the target environment.

The installation file name for the version 5.0 is mysql-standard-5.0.18-osx10.4-powerpc.dmg.

Now that we have the download the installation steps are listed below:

  1. Launch mysql-standard-5.0.18-osx10.4-powerpc.dmg to mount the  mysql package
  2. Launch the mysql-standard-5.0.18-osx10.4-powerpc.pkg
    1. Running through the install is very straight forward
    2. The final installation creates the following files in /usr/local:
      • Directory (Mysql directory)
        • mysql-standard-5.0.18-osx10.4-powerpc
      • Symbolic Link to mysql above
        • mysql
  3. MySql requires a user account named mysql.  This is normally created for OS X 10.2 and above
    • You can verify this by entering this comman in the command shell:
      • cat /etc/passwd | grep -i "mysql"
<Helios:sparc> 0 [02-19 13:41] /usr/local (0 Mb)
! cat /etc/passwd | grep -i "mysql"
mysql:*:74:74:MySQL Server:/var/empty:/usr/bin/false
      •  cat /etc/passwd | grep -i "mysql"
<Helios:sparc> 0 [02-19 13:41] /usr/local (0 Mb)
! cat /etc/passwd | grep -i "mysql"
mysql:*:74:74:MySQL Server:/var/empty:/usr/bin/false


4. If you would like to startup MYSQL as a startup item launch MySQLStartupItem.pkg
    The following directory is created in MySQLCOM dir /Library/StartupItems/.  To disable my MySQL from system startup update the following file /etc/hostconfig's variable MYSQLCOM=-YES- to  MYSQLCOM=-NO-

5. Start MySQL command line issue the following commands

<Helios:sparc> 0 [02-20 07:04] /usr/local (0 Mb)
! cd /usr/local/mysql

<Helios:sparc> 0 [02-20 06:57] /usr/local (0 Mb)
! sudo ./bin/mysqld_safe
<Issue a CTRL-Z>


6. Connect to MySQL
<Helios:sparc> 0 [02-20 06:57] /usr/local (0 Mb)
! /usr/local/mysql/bin/mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.18-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show datanases
    -> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'datanases' at line 1
mysql> show databases;
+-----------------------------+
| Database                |
+-----------------------------+
| information_schema|
| mysql                     |
| test                        |
+-----------------------------+
3 rows in set (0.31 sec)

mysql>


You are conencted.

I have been using MySQL Admin to create database and tables, and well, general administartion. I believe to be a nice little package and would suggest using it... Its an easy install and provides a GUI for MySQL Administration.
(NOTE: My experience with MySQL Admin is Windows and Mac OS X only at this time!)

Execute the MYSQL shortcut. You'll be prompted for a password. Enter your password.

Enter show databases:

mysql> show databases;
+--------------------+
| Database
+--------------------+
| information_schema
| mysql
| test |
+--------------------+
3 rows in set (0.00 sec)


mysql> use test;

Create a table foo in Database "test"

mysql> CREATE TABLE foo (a TINYINT NOT NULL);
Query OK, 0 rows affected (0.58 sec)

mysql> show tables;
+----------------+
| Tables_in_test
+----------------+
| foo
+----------------+
1 row in set (0.00 sec)

NOTE: If you received the results above MySQL is installed correctly


MYSQL ADMIN INSTALLATION


MySQL's admin tool is a fairly new tool and provides a better interface than the standard MySQL.exe (some may argue this point with great conviction! :-). The installation is fairly simple and will require the username and password that was created in the MySQL DB installation.

Simply download the MySQL Administrator from MySQL Admin execute the DMG.  this will mount the package drag the MySQL Adminstrator.app to a directory of your choosing.

Launch it and you will be asked for some credentials, enter localhost, if you followed along leave the password and user fields balnk.


You should now be grated acces to the adminsitration tool seen below;


Goto the folder C:\Scratch\MySQLAdmin and execute the mysql-administrator-1.1.5-win.msi installation. Install the Tool in the following directory:

C:\Servers\MySQL\MySQL Administrator 1.1\

Any qestions?? Add comments or send email to SOS











tags:    

links: digg this    del.icio.us    technorati    reddit