Environmental configuration has always been a more annoying job! The purpose of this article is to easily set up and configure the execution environment of Servlet and JSP for you. First, go to java.apache.org to download a Tomcat3.1, Tomcat3.2. The author used Tomcat3.1. Download a zip file. Let it extract below a directory. For example, C: / below. A Jakatar-Tomcat directory will appear under the C drive. You can change this directory to your name. I change the name of the directory to Tomcat. Open the server.xml file in the C: / Tomcat / Conf directory now. Find ContextManager this tag, you will be able to see:
Go to java.apache.org to download a JSERV, I use Jservev1.1.1. Install Apache Web Server first (such as below the C: / Apache directory). After installation, you need to modify the c: /apache/conf/httpd.conf file, find ServerName, modify the name you like, find the port, and modify the port that is not occupied. Install JSERV (for example, installed below the C: / Jserv directory). Install JSERV Need to specify the directory where JVM is located, you can specify the JDK_HOME / BIN directory. I need to specify the directory where JSDK is located, I specified is the directory after the JSDK installed from java.sun.com. (In fact, it is going to find servlet.jar file, you can specify Tomcat / lib / servlet.jar to try again, I didn't try this) this time actually Apache has supported servlet, but I don't support JSP . So you need to modify the c: /apache/conf/httpd.conf file. Use the text editor to open httpd.conf, in the final plus: include "Tomcat_home / conf / tomcat-apache.conf" (note that tomcat-apache.conf This file is automatically generated by Tomcat after Tomcat. So To open Tomcat first, open Apache. Now start Tomcat (c: /tomcat/bin/startup.bat), after another window appears, start apache (c: /apache/bin/apache.exe or by start menu à program à apache web serverà start apache start up). If you start Apache by the latter, there is a DOS window to flash after flash, indicating that there is a problem with the configuration of Apache Jserve Tomcat, and you should start Apache through the first method. You can on the screen. See the specific error message. If the error message is: Apj *: can't be specified more Than'. Once Per host. (* Represents some strings, such as APJSERVLOGLEVEL, etc.), you have to modify the C: /JSERV/CONF/JServ.conf file, you can remove the related line of the APJ *, you may need to note 5-6. If Apache is also started, now you can type http: // localhost: apache_port / example debug servlet in the address bar, here apache_port is the port number of Apache, can be modified C: / Apache / Conf / httpd.conf This file modifies the port number; Type http: // localhost: Apache_port / Examples / JSP / to debug JSP in the address bar. If the reader is careful, it will find that the previous test is an Examples / JSP directory. Tell you now how to create your own directory. Create a TestDir directory below in the C: / Tomcat / WebApps directory. Create a JSP directory and a classes directory under the TestDir directory. Now open the server.xml below the C: / Tomcat / Conf directory with a text editor.