Home Backend Development PHP Tutorial Linux Notes (65) - nginx agent tomcat

Linux Notes (65) - nginx agent tomcat

Jul 29, 2016 am 08:57 AM
nginx tomcat usr

nginx is a reverse proxy server, it can proxy php, and it can also proxy tomcat

First of all, you need to install nginx, jdk, tomcat

The installation of tomcat is very simple, just unzip it and run it.

Then enter the directory where the ngxin configuration file is located. Mine is in /usr/local/nginx/conf

Create a configuration file. Try to avoid modifying the original configuration file. Just use the configuration file we created when opening it

<code>vim jsp<span>.conf</span></code>
Copy after login

The content is as follows:

<code>user nobody;
worker_processes <span>4</span>;
events{
        worker_connections <span>1024</span>;
}
http{

    <span>server</span> {
        listen <span>80</span>;
        server_name localhost;
        location ~ \.jsp$ {
            root /usr/local/tomcat/webapps;
            <span>index</span><span>index</span>.jsp;
            proxy_pass http:<span>//localhost:8080;</span>
        }
    }
}</code>
Copy after login

The above configuration indicates that port 80 is monitored, and all addresses ending with .jsp are forwarded to localhost:8080, which is tomcat. The project directory is deployed under /usr/local/tomcat/webapps

Then start tomcat

<code><span>cd</span> /usr/local/tomcat/bin
./startup.sh</code>
Copy after login

Start ngxin and use the configuration file we just created

<code>/usr/<span>local</span>/nginx/sbin/nginx <span>-c</span> /usr/<span>local</span>/nginx/conf/jsp<span>.</span>conf</code>
Copy after login
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces Linux Notes (65) - nginx agent tomcat, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to deploy multiple projects in tomcat How to deploy multiple projects in tomcat Apr 21, 2024 am 09:33 AM

To deploy multiple projects through Tomcat, you need to create a webapp directory for each project and then: Automatic deployment: Place the webapp directory in Tomcat's webapps directory. Manual deployment: Manually deploy the project in Tomcat's manager application. Once the project is deployed, it can be accessed by its deployment name, for example: http://localhost:8080/project1.

Where is the root directory of the tomcat website? Where is the root directory of the tomcat website? Apr 21, 2024 am 09:27 AM

The Tomcat website root directory is located in Tomcat's webapps subdirectory and is used to store web application files, static resources, and the WEB-INF directory; it can be found by looking for the docBase attribute in the Tomcat configuration file.

How to run two projects with different port numbers in tomcat How to run two projects with different port numbers in tomcat Apr 21, 2024 am 09:00 AM

Running projects with different port numbers on the Tomcat server requires the following steps: Modify the server.xml file and add a Connector element to define the port number. Add a Context element to define the application associated with the port number. Create a WAR file and deploy it to the corresponding directory (webapps or webapps/ROOT). Restart Tomcat to apply changes.

How to generate URL from html file How to generate URL from html file Apr 21, 2024 pm 12:57 PM

Converting an HTML file to a URL requires a web server, which involves the following steps: Obtain a web server. Set up a web server. Upload HTML file. Create a domain name. Route the request.

Reasons for garbled characters in tomcat Reasons for garbled characters in tomcat Apr 21, 2024 am 10:18 AM

Reasons for Tomcat garbled characters: 1. Character set mismatch; 2. HTTP response header is not set correctly; 3. Filter or encoder configuration error; 4. Web page encoding is incorrect; 5. Other reasons (including server-side language, database encoding and proxy server issues).

How to run html and jsp on tomcat How to run html and jsp on tomcat Apr 21, 2024 am 09:04 AM

Tomcat can run HTML and JSP. The method is as follows: copy the HTML file to the corresponding subdirectory of the Tomcat directory and access it in the browser. Copy the JSP file to the corresponding subdirectory of the Tomcat directory, and use the <%@ page %> directive to specify the Java code and access it in the browser.

How to add a server in eclipse How to add a server in eclipse May 05, 2024 pm 07:27 PM

To add a server to Eclipse, follow these steps: Create a server runtime environment Configure the server Create a server instance Select the server runtime environment Configure the server instance Start the server deployment project

How to run war file in tomcat How to run war file in tomcat Apr 21, 2024 am 09:06 AM

Steps to deploy a WAR file using Tomcat: Unzip the WAR file into Tomcat's webapps directory. Create a directory with the same name as the WAR file and move the unzipped files to that directory. Start the Tomcat service. The WAR file is automatically deployed at startup and can be accessed through the browser. The URL format is: http://localhost:8080/WAR_file_directory name/

See all articles