BreadcrumbsHome / JSF Tutorial #5: JavaServer Faces Tutorial (JSF 2.2) – Install Tomcat on Mac OS X
JSF Tutorial #5: JavaServer Faces Tutorial (JSF 2.2) – Install Tomcat on Mac OS X
Last Updated on Saturday, 16 May 2015 Written by Chad Darby Monday, 4 May 2015
In this video, I will show you how to install Tomcat on Mac OS X.
Please SUBSCRIBE to my YouTube channel.
Do You Need More Details?
- Do you need to connect to a database?
- Display SQL results in a HTML table?
- Perform SQL insert, updates and deletes?
- Database Integration with JDBC
- Displaying Data in Lists and Tables
- Validating HTML Forms
- Implementing Business Logic with Managed Beans
- Deploying applications with WAR Files
Follow luv2code with the links below:
JSF Tutorial Transcript:
Hey, welcome back. Let’s go ahead and get our hands dirty with setting up our development environment. In this video, I’m going to show you how to install Tomcat on the Mac operating system. All right, what we need to do is open up a web browser and visit the Tomcat website. I need to go to tomcat.apache.org. This will bring me to the main Apache Tomcat website. This is where we can actually download the software.
Over on the left-hand side, there’s a download section, and it has the different versions of Tomcat that we can download. At the time of this video recording, the current version is Tomcat 8. However, there may be a new version, and you can simply download the appropriate version. I’ll go ahead and select Tomcat 8 for this video. This will show me the Tomcat 8 downloads. I’ll just scroll down a bit and I’ll move down to the Binary Distributions, that means this is the binary code or whatever. Since I’m doing this for a Mac, I’ll go ahead and choose tar.gz. It’s simply a zip file that preserves the file permissions. I’ll select the link here. My browser’s going to prompt me for the actual file. I’ll say save the file and I’ll hit Okay. This will actually download the Tomcat file to my local computer.
All right, great. We’ve actually downloaded the file to our file system. Let me go and open up my finder. Let me move into the downloads directory. This is where I’ll find the actual file that was just downloaded, so here Apache Tomcat 8. Now what I need to do is actually unzip the file. I can just unzip it by double-clicking it. I’ll go ahead and do that now. Now I have this file or this folder here for Apache Tomcat 8. This is the unzipped version of the file. What I normally like to do is actually move this into another directory so I can make use of it. We’ll actually make use of a directory for this training class, and I’ll call it jsf for beginners.
Let me go and open up a new window here. I’ll move down to the bottom and I’ll say, “New Folder,” and I’ll call it jsf for beginners. This is really just like a little, empty scratch temp folder that we’re going to use for this training class. I’ll put all of our apps in here, all of our servers, and so forth. Just one central location, jsf for beginners. It’s empty now. I’ll just double-click and move into it. What I’d like to do is that folder that just expanded on top, Tomcat 8, I’ll just grab it, drag and drop it into this new folder, jsf for beginners. All I’ll do is just copy that expanded directory to this new folder, jsf for beginners. This looks pretty good.
All right, now that I have the file extracted, I actually want to verify the Tomcat installation by actually running the server. What I’ll do is I’ll open up the terminal window here and what I’d like to do is actually move into that Tomcat installation directory. I’ll just do a CD, I’ll move into that jsf for beginners that we just created and then the Apache Tomcat directory that we just copied over. All right, great. I’m in the directory. Now I’ll just do an “ls” just to see the contents of this directory. I’ll see that this directory has a startup.sh. This is a bin directory, startup.sh. This is what I’ll use to actually start the Tomcat server. On my command line here, I’ll type in bin/startup.sh. This will actually start the Tomcat server for me. We can see some logs and then we’ll see on the bottom left Tomcat started.
This is really good. Our server’s installed and we also started the server. At this point, Tomcat is up and running and it’s listening for a request. Great. Now that our server is running, then we can actually access our server. In my browser, I can simply type localhost:8080. This will connect to my Tomcat server. By default, Tomcat is listening on Port 8080, and that’s how we connect to it. Here we make it to a page, Tomcat with a version number. Then they’ll even tell you, “Hey, if you’re seeing this page, you successfully installed Tomcat.” We’re in a really good shape here. We downloaded the server, we installed it, and we also started the server, and then we accessed it via our web browser, so know that things are looking really good for us. Good job so far.
One final thing we want to do is actually stop the server or shut down the server because later on we’re going to use it via Eclipse. In our bin directory, we can say just bin/shutdown.sh. It’ll actually stop the Tomcat server. Don’t worry; once we install Eclipse then we’ll actually run Tomcat from the Eclipse server.
We did a lot of good things in this video. I showed you how to install the Tomcat server on the Mac operating system, we went through the process to actually start the server and also access the server, and then, finally, how to stop the server. We’re in good books now that we have successfully installed Tomcat.