Practice: installing Tomcat 7.0.x on OS X

Source: Internet
Author: User
Tags apache tomcat java se

My Mac is the 1.6 SDK. After downloading Tomcat 8.0 and running it, the following error occurs when accessing http: // 127.0.0.1: 8080 and disabling the script:

Unsupported Major. Minor version 51.0

It seems that at least JDK 8.0 or JDK 1.7 is required to install Tomcat 1.8, but I will not update it if there is no prompt on my Mac.


Therefore, download Tomcat 6.0 again and follow the steps below. Everything is normal and you can access port 8080 to open the page.

Download Tomcat 7.0 again. Repeat the following operations. Everything is normal and you can access port 8080 to open the page.


However, note that the/library/tomcat generated by link must be unlinked first:

Sudo unlink/library/tomcat


1. mvDownload and decompress the Tomcat directory/Usr/local

In this step, I first enter a music video, then drag the directory from the Finder to the console, automatically display the path string, then enter/L, and then press the tab key to automatically complete the library, if your directory contains multiple files or directories starting with L, you can enter a few more characters to ensure that the unique one can be automatically completed, and then enter/t, continue to press tab to automatically complete

2. sudo unlink/library/tomcat

Cancel the/library/tomcat link created during previous installation

3. sudo ln-S/usr/local/Apache-Tomcat-7.0.56// Library/tomcat

4. sudo chown-RCurrent User/Library/tomcat

5. sudo chmod + x/library/tomcat/bin/*. Sh

Modify the. Sh script in the Tomcat directory to executable.

6./library/tomcat/bin/startup. Sh

Start tomcat, which version of Tomcat is currently linked to, and which version of Tomcat is started

7. http: // 127.0.0.1: 8080

Open the address port in the browser. The welcome page of Tomcat is displayed, indicating that Tomcat is deployed successfully.

8./library/tomcat/bin/shutdown. Sh

Disable Tomcat Service

9. Download and install Tomcat controller, and start and stop Tomcat on the UI

Note that the default Tomcat home directory directs to/usr/local/tomcat, which can be changed to a specific version of Tomcat or specified, then, use the link above to change the current tomcat version.

I feel that the former is more convenient, and I am not allowed to create a link.



Tomcat 6.0 download link: http://mirrors.hust.edu.cn/apache/tomcat/tomcat-6/v6.0.41/bin/apache-tomcat-6.0.41.zip

Tomcat 7.0 download link: http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.56/bin/apache-tomcat-7.0.56.zip

Tomcat 8.0 download link: http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.0.14/bin/apache-tomcat-8.0.14.zip

Tomcat controller download link: http://www.activata.co.uk/downloads_files/TomcatController_1_2.dmg.zip



Next, we will study the spring MVC Framework and mybatis to operate MySQL Databases and use spring to manage database connection transactions.

Step-by-step study:

1. Spring MVC Framework + sqlhelper to read and write MySQL databases;

It is said that spring MVC is more efficient than structs2, and the recruitment website currently searches for similar recruitment, basically all of which are spring MVC frameworks,

Don't get it wrong. I am not looking for a job on the recruitment website, but I am not looking for a job. The recruitment website is a technical trend. The statistical results over a period of time are representative;

2. mybatis for MySQL operations

3. Spring controls the mybatis database connection pool

4. Integration of the three elements


Different people have different research processes and understandings with the same technology, but the results are the same and can be used.

It may not be useful, but at least it is enough to know what others are doing right and where the problem is.






_____________________________________________________

Installing Tomcat 7.0.x on OS X

By wolf Paulus | dec 14,201 3 | Mac OS X | 281 comments


While Tomcat 8 is close to be released (Tomcat 8.0.0-RC5 (alpha) is released already), Tomcat 7 was the first Apache Tomcat release to support the servlet 3.0, JSP 2.2, and El 2.2 specifications. please note that Tomcat 7 requires Java 1.6 or better, which shouldn't be a problem, if you are running OS X 10.5 or 10.6.


On OS X 10.7, 10.8 (mnt Lion), and 10.9 (mavericks) However, Java is not installed anymore, at least not initially. the easiest way to get Java onto your Mac is probably to open the terminal app and enter Java. you will be asked if you want to install it and OS X takes care of the rest-You wowould end up with Java 6.

Prerequisite: Java

On 10.9 (mavericks), Apple changed this once again, now sending you to Oracle's Java SE web page, where you can download the JDK, (currently 7 jdk-7u45-macosx-x64.dmg ). while at Oracle, I usually also download the Java SE Development Kit 7 Documentation, allowing me to stay away from their site for months.



The JDK installer package come in an DMG and installeasily on the Mac; and after opening the terminal app again,

Java-version

Now shows something like this:

Java version "1.7.0 _ 45"

Java (TM) se Runtime Environment (build 1.7.0 _ 45-b18)

Java hotspot (TM) 64-bit server VM (build 24.45-b08, mixed mode)

Whatever you do, when opening terminal and runningJava-version, You shoshould see something like this, with a version of at least 1.6.x

SudoIs a program for Unix-like operating systems, allowing you to run programs with the security privileges of another user (normally the superuser, or root ). since we are creating directories, outside of your home folder, administrator right are required. i. E ., when executingSudoYou will be asked to enter your password; and your Mac user account needs to be an 'admin' account.

Installing Tomcat

Here are the easy to follow steps to get it up and running on your Mac

  1. Download a binary distribution of the core module: apache-tomcat-7.0.47.tar.gz from here. I picked the tar.gz in binary distributions/core section.
  2. Opening/unarchiving the archive will create a folder structure in yourDownloadsFolder: (BTW, this free unarchiver app is perfect for all kinds of compressed files and superior to the built-in archive utility. app)
  3. ~ /Downloads/Apache-Tomcat-7.0.47.
  4. Open to terminal app to move the Unarchived distribution to/usr/local
  5. Sudo mkdir-P/usr/local
  6. Sudo mv ~ /Downloads/Apache-Tomcat-7.0.47/usr/local
  7. To make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Tomcat (after removing the old link, you might have from installing a previous version ):
  8. Sudo Rm-F/library/tomcat
    Sudo ln-S/usr/local/apache-tomcat-7.0.47/library/tomcat
  9. Change ownership of the/library/tomcat folder hierarchy:
  10. Sudo chown-r <your_username>/library/tomcat
  11. Make all scripts executable:
  12. Sudo chmod + x/library/tomcat/bin/*. Sh





Instead of using the start and stop scripts, like so:

Last login: Sun Aug 14 15:20:38 on ttys000
Wpbookpro :~ Wolf $/Library/tomcat/bin/startup. Sh
Using catalina_base:/library/tomcat
Using catalina_home:/library/tomcat
Using catalina_tmpdir:/library/tomcat/temp
Using jre_home:/library/Java/home
Using classpath:/library/tomcat/bin/Bootstrap. jar:/library/tomcat/bin/tomcat-juli.jar
Wpbookpro :~ Wolf $/Library/tomcat/bin/shutdown. Sh
Using catalina_base:/library/tomcat
Using catalina_home:/library/tomcat
Using catalina_tmpdir:/library/tomcat/temp
Using jre_home:/library/Java/home
Using classpath:/library/tomcat/bin/Bootstrap. jar:/library/tomcat/bin/tomcat-juli.jar
Wpbookpro :~ Wolf $

You may also want to check out activata's tomcat controller, a tiny freeware app, providing a UI to quickly start/stop tomcat. it may not say so, but Tomcat controller works on OS X 10.8 and 10.9 just fine.




Finally, after your started tomcat, open your Mac's Web browser and take a look at the default page: http: // localhost: 8080

. Entry-content you can start editing here.


Practice: installing Tomcat 7.0.x on OS X

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.