Installing Everything

Installing Everything

APPENDIX A Installing Everything To be able to develop and run web applications, you need to download and install several packages from the Internet. They will occupy at least 300MB of disk space for Java and Tomcat alone, and twice as much if you want to install the Eclipse IDE. We successfully tested our code on at least four different systems, including a Windows XP with 512MB of memory and a 1.8GHz Pentium 4, and a Windows Vista with 1GB of memory and a 2.6GHz AMD Athlon 64 X2. We also tested on a virtual Windows XP system installed on a VMware Server 1.0.2 with only 256MB of memory. All the instructions contained in this appendix are for Windows XP, because at the moment of writing (mid 2007), XP is still more widely used than Vista. In any case, the differ- ences between the two systems concerning installation are minimal. By the time you’re reading this book, there probably will be newer releases of everything we describe. Nevertheless, you should be able to adapt our instructions to the latest versions without any problem. In fact, in most cases, we expect that our instructions will apply to the latest releases without any change (apart from the version numbers!). To avoid clogging up the instructions with obsessive warnings, we won’t mention this issue again in the rest of this appendix. We recommend that you install the various packages in the order in which we list them in the following sections. This appendix is exclusively about standard packages. Therefore, you won’t find here anything concerning the examples that we’ve developed for this manual. You can down- load our examples from the Source Code/Download area of the Apress web site (http:// www.apress.com). Together with the code, you’ll also find a readme file with the necessary installation instructions. Java Nothing runs without Java, and you need two different packages: the runtime environment, which lets you execute Java, and the JDK, which lets you compile Java sources into executable classes. You can download these packages together from Sun Microsystems’ web site. Here’s what you need to do: 1. Go to http://java.sun.com/javase/downloads/index.jsp. 2. Click on the Download button beside JDK 6 Update 1. 3. Select Accept License Agreement and wait for the page to reload itself. 251 252 APPENDIX A ■ INSTALLING EVERYTHING 4. Click on the Windows Offline Installation, Multi-language link, which downloads the file jdk-6u1-windows-i586-p.exe (56MB). 5. Execute the file. 6. Accept the license agreement when requested. 7. The installation wizard opens a dialog named Custom Setup. Click on the Next > button without changing the default settings. It will probably take a few minutes to install the JDK. 8. Another Custom Setup dialog appears, this time for the runtime environment. Again, click on the Next > button without changing the default settings. At this point, you should have the folder C:\Program Files\Java\ with two subfolders: jdk1.6.0_01 and jre1.6.0_01. In order to be able to compile Java from the command line, you need to add the JDK path to the PATH environment variable. From the Windows Start menu, select Settings, Control Panel, and System. When the System Properties dialog opens, click on the Advanced tab. Figure A-1 shows what you’ll see. Figure A-1. The System Properties dialog APPENDIX A ■ INSTALLING EVERYTHING 253 Click on the Environment Variables button to open the dialog shown in Figure A-2. Figure A-2. The Environment Variables dialog As you can see, there are two “path” variables: one in the user’s list and one in the system’s list. You have to add the JDK path to one of them. If you’re the only user who needs to compile Java classes, you should update the PATH variable in the upper list. In any case, the procedure to update a variable is the same for both lists: by double-clicking the entry you need to update, you’ll open the edit dialog shown in Figure A-3. Figure A-3. The Edit User Variable dialog Figure A-3 shows the text that we added at the very beginning: C:\Program Files\Java\jdk1.6.0_01\bin; 254 APPENDIX A ■ INSTALLING EVERYTHING The semicolon at the end is essential, because it separates the new path from the existing ones. Do not insert additional spaces before or after. Click on the OK button to save the changes. Do it another couple of times until the System dialog closes. Tomcat Tomcat is the Java web server—that is, the servlet container that lets you run JSP pages and documents. If you’ve already installed an older version of Tomcat, you should remove it before installing a new version. Here’s how you install Tomcat 6 correctly: 1. Go to http://tomcat.apache.org/download-60.cgi. Immediately below the second heading (Quick Navigation), you’ll see three links: KEYS, 6.0.13, and Archives. 2. By clicking on 6.0.13, you’ll be taken toward the bottom of the same page to a heading with the same version number. Below the version heading, you’ll see the subheading Core and, below that, three links as follows: Windows Service Installer (pgp, md5). 3. Click on Windows Service Installer to download the file apache-tomcat-6.0.13.exe (approximately 5MB). 4. Before launching the installer file, you have to check its integrity. To do so, you need a small utility to calculate its checksum. One freeware utility that works just fine is MD5, of mst software GmbH. Download the file mstMD520e.exe from http:// www.mstsoftware.com/cFreeware.aspx, execute it, accept the license agreement, and select the normal installation (instead of the custom one). Then launch the program C:\Program Files\mst software\mst MD5\mstMD5.exe and drag the Tomcat installer file on the little window that appears. You’ll see a checksum string of 32 hex digits, such as d5322de3e2adada0dc569bb4cc7c1153. 5. Go back to the page with the links Windows Service Installer (pgp, md5) and click on md5. This opens a page containing a single line of text that should begin with the check- sum calculated by the mstMD5.exe utility. 6. Now that you’ve verified the correctness of the Tomcat installer, launch it. 7. After you agree to the terms of the license, you’ll see the dialog shown in Figure A-4. Click on the plus sign before the Tomcat item and select Service and Native before clicking on the Next > button. 8. Click on Next > once more without changing the install location. 9. You’ll be asked to specify the connector port and user ID plus password for the admin- istrator login. Leave the port set to 8080, because all the examples in this manual refer to port 8080. If you want, you can always change it later to the HTTP standard port (which is 80). For the user ID and password, you might as well use your Windows user- name and password. It is not critical. 10. At this point, you’ll be asked to provide the path of a JRE. This is the path you saw when installing Java (in the previous section). With the version of Java we have, the correct path is C:\Program Files\Java\jre1.6.0_01. APPENDIX A ■ INSTALLING EVERYTHING 255 Figure A-4. The Choose Components dialog MySQL To support a web application, you need a DBMS. MySQL is the most widely used DBMS, and you can install it as follows: 1. Go to http://dev.mysql.com/downloads/mysql/5.0.html. 2. Scroll down until you arrive to the two headings, Windows Downloads and Windows x64 Downloads. Here you should choose the version to download depending on whether you have a 32-bit or a 64-bit CPU. A 32-bit MySQL version running on a 64-bit CPU works less efficiently. Therefore, we would normally advise you to download the 64-bit package if you have a 64-bit CPU. To find out what CPU you have, you only need to click on the Start menu and select Settings, then Control Panel, and finally System. Unless you see a 64 mentioned somewhere, you can conclude that you have a 32-bit CPU. However, MySQL only provides the 64-bit version of the full package without the installation wizard. You probably don’t want to be bothered with a manual installation, so we suggest that you download the 32-bit version labeled Windows (x86) ZIP/ Setup.EXE (5.0.41, 47.0MB). Right-click on the Pick a mirror link and open it in a new tab or window. 3. Before you can download the file mysql-5.0.41-win32.zip, you can register with MySQL, although this isn’t strictly necessary. In any case, if you scroll down the page, you’ll see a series of mirror sites from which you can download the software. Click on one of the links marked HTTP or FTP to download. 256 APPENDIX A ■ INSTALLING EVERYTHING 4. Before you proceed with the installation, you should verify that its checksum is correct. To do so, launch C:\Program Files\mst software\mst MD5\mstMD5.exe, drag the mysql-5.0.41-win32.zip file to its window, and check that the calculated checksum matches that shown on the page http://dev.mysql.com/downloads/mysql/5.0.html immediately below the Pick a mirror link you clicked on in step 2.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    194 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us