Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Tomcat to build a local server

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use Tomcat to build a local server, the article is very detailed, has a certain reference value, interested friends must read it!

Application background

I believe many people have used webpack to build small servers, so how to start a project without webpack configuration and dependency management? There are many ways, such as PHPnow,WampServer, this article focuses on how to use Tomcat to build a local server.

What is Tomcat?

Tomcat server is a free and open source Web application server, which is a lightweight application server. It is widely used in small and medium-sized systems and not many concurrent access users. It is the first choice for developing and debugging JSP programs. For a beginner, it can be thought that when an Apache server is configured on a machine, it can be used to respond to requests for access to HTML (an application under the standard general markup language) pages. Tomcat is actually an extension of the Apache server, but at run time it runs independently, so when you run tomcat, it actually runs as a separate process from Apache.

Installation steps

1. Before installing Tomcat, please confirm whether java jdk has been installed locally. If not, please go to: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html to download. It is recommended to install Java SE Development Kit 8u161, and download accordingly according to the system environment.

two。 After downloading jdk, click next to install, and after installing jdk, you also need to configure environment variables: right-click my computer-> Properties-> Advanced-> Environment variables-> user variables, click "New (N)" to add the following environment variables:

a. Configure JAVA_HOME

Create a new JAVA_HOME

Variable name JAVA_HOME

Variable value C:\ Program Files\ Java\ jdk1.8.0_161 your jdk installation address

b. Configure PATH

Variable name Path

Variable value% JAVA_HOME%\ bin

c. Configure CLASSPATH

Create a new CALSSPATH

Variable name CLASSPATH

Variable value.;% JAVA_HOME%\ lib\ dt.jar;%JAVA_HOME%\ lib\ tools.jar; (note that the first ".;" because the default search order of WINDOWS is to search the current directory first, then the system directory, and then the PATH environment variable)

d. Test whether the configuration is successful

Window+R opens a cmd window and enters javac. The following indicates that the configuration is successful.

3. After installing jdk, please go to: https://tomcat.apache.org/download-80.cgi to download the tomcat installation package (tomact8.0 version is recommended).

4.Tomcat installation package can be unzipped according to your needs, no special requirements, and then open the software directory:

Bin-- the folder is mainly used to store the execution files and settings related to the startup of Tomcat services.

Conf-folder is mainly used to store settings related to Tomcat server

Webapps-the folder is mainly where the Tomcat management website and the JSP website developed in the future are stored.

Logs-folder is mainly the place where Tomcat log files are stored.

5. Of course, it cannot be run directly after downloading, and you also need to configure environment variables:

a. Select "add" and select the above addition for a user. Select the additions under the system for all users. It is recommended to select the new under the system, and the variable value is the path of the bin folder under the Tomcat file directory. As shown below:

b. Add or edit "variable name: CLASSPATH". The value of the variable is% TOMCAT_HOME%\ BIN, which actually specifies the path of the tomcat.

The 6.Tomcat environment variable configuration is complete. Now you can start tomcat. Run the tomcat directory / bin/startup:

7. After my initial configuration is completed, I prompt Tomcat to show that the specified service is not installed at startup, mainly because service.bat has not been implemented, and the corresponding solution is attached:

Right-click shift+ in the bin file directory, open a command window here, type service.bat install, and OK!

The above is all the contents of the article "how to use Tomcat to build a local server". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report