| Home | Register a Domain Name >> | |
|
Step 1. Get a free application server such as Apache Tomcat. I prefer to use Apache Tomcat as my application server. Apache Tomcat is an open source project - meaning that anyone can download it, its source code, and use it. At the time this book was written the latest version of Tomcat was 6.0.10. To download Tomcat go to the Apache Tomcat download page. You can download Apache Tomcat from http://tomcat.apache.org/. You will probably only need the Binary Distribution unless you plan on modifying the source behind the application server. Click on the link to the Core Download that is appropriate for you. I use Windows to host my websites so I downloaded the zip version. You may also use the Windows Service Installer. Once the download has completed successfully unzip/untar the file.
I recommend unzipping to a location on your computer that does not
include spaces such as To verify that your instance of Tomcat is working correctly, go to
the bin directory under the file structure to which you extracted the
files. Then select the Tomcat executable file by double clicking on it
in Windows. If a command prompt window flashes but you do not see a message,
assume that there was an error. To view the error message you will
need to open a command prompt and run the startup command by hand. In the above example the Java JRE is not defined so Tomcat will not
run. So, what does this mean? You will need to install a Java JDK and
set your If you did not have an error, skip to the next section. To install a JDK go to Sun’s Java Download site. Look for a J2SE JDK (Java SE Developer’s Kit). You should see this:
The Environment Variables Window will open. Under the System
variables make sure that you have a variable called Under Variable name type Click OK until you are completely out of the System Properties window. Now try running the startup command again. ![]() You have downloaded a Sun JRE not a JDK. A JDK is a Developer’s Kit which may be used to compile Java code. For Tomcat to work, JDK is essential, as it must know how to compile Java Servlets and JSP pages.Go back to the download page and try again. You should see something like this when Tomcat starts up successfully: Verify that your server is up and running by opening a web browser and typing: http://localhost:8080 into the URL field. You should see: Congratulations! You have successfully downloaded and installed your application server! Step 2.Getting your content ready for the world to see. style="background: red;Grab your files whether html files, images, or an entire web application complete with JSP pages and Java Servlets and put them in the webapps\ROOT directory. Notice that this directory will already have some files in it. These are the default Apache Tomcat files that render the page shown above. Now refresh the browser and you should see your files. style="background: red;You may need to navigate directly to the URL field if you do not have an index.html page. For example if you had a file named test.html style="background: red;type http://localhost:8080/test.html into the URL field. Note: The default port for Tomcat is 8080.You can change it in the
config/server.xml file by changing it from: This would allow you to simply type: http://localhost/test.html instead of the port. |
|
| Home | Register a Domain Name >> | |