Mac OS X Snow Leopard
This tutorial will teach you how to create a JSP server running environment under the apple snow leopard system.
Step 1: Download Apache Tomcat for jsp development. A server that compiles JSP files is required, which is equivalent to IIS on windows. Apache Tomcat is a good choice. You can download and install Apache Tomcat from the official website for free. I downloaded version 6.0.35, you can find the relevant chain (tar.gz) IN THE http://tomcat.apache.org/download-60.cgi, download and decompress it to local.
Step 2: install Apache Tomcat and open the Terminal shell, that is, the "Terminal" in the utility. Enter the following command:
Cd/Library
Mkdir Tomcat
Create a Tomcat folder in the Library, and move the decompressed Apache Tomcat folder (apache-tomcat-6.0.35) to the Tomcat folder you just created:
Mv ~ /Downloads/apache-tomcat-6.0.35/Library/Tomcat
Create a shortcut named Home for this folder. You do not need to enter a large string of folder names every time:
Cd/Library/Tomcat
Ln-sfhv apache-tomcat-6.0.35 Home
If the version you downloaded is different, change the folder name in the command as needed. Create two environment variables:
Export JAVA_HOME =/Library/Java/Home
Export CATALINA_HOME =/Library/Tomcat/Home
Then, check whether the environment variable is successfully created:
Env
You will see all the environment variables. Normally, JAVA_HOME and CATALINA_HOME are available.
Next, modify the configuration file:
Cd/Library/Tomcat/Home/conf
Pico tomcat-users.xml
Modify the configuration:
Then press control + o to save and Press control + x to exit the editor. Of course, you can also use vi for editing. The results are the same.
Step 3: Start a very simple command of Tomcat to complete this task:
/Library/Tomcat/Home/bin/startup. sh
To stop Tomcat, enter the following command:
/Library/Tomcat/Home/bin/shutdown. sh
Then, the environment is built here.
Next, you can test whether the installation is successful. Enter http: // localhost: 8080/in the address bar of the browser, and confirm. If the installation is successful, you will see the welcome page of Apache Tomcat. To view the sample code of jsp, visit the following address: http: // localhost: 8080/examples/jsp
To test your website, copy the source code to the following folder:/Library/Tomcat/Home/webapps