Linux Learning (Jdk,tomcat,nginx reverse proxy)

Source: Internet
Author: User
Tags openssl openssl library nginx server tomcat server nginx reverse proxy

    • Recently learned in Linux, in the above to build a Tomcat server, and then use Nginx reverse proxy for a moment, I hope the article to help beginners.
    • 1. Install the JDK. (Installed with the JDK RPM package)

Before installing the JDK, you need to download the JDK package and then copy the JDK package to the Linux system, and if your Linux system is available online, you can download it directly on the official website, and we will explain the contents of the virtual machine to the local network at the end of this chapter. There is also a tool installation for VMware tools.

1. Place the jdk-8u144-linux-x64.rpm package in the OPT folder under the Linux system

  

2. Reference Blog: http://www.cnblogs.com/xuzhiwei/p/4993035.html

    • Installing Tomcat

1. Place the Tomcat unpacking package in the local folder under USR. can be renamed for easy use.

  

2. Then you don't need to configure anything, just go to boot tomcat in the bin directory located in the Tomcat directory.

  

Will find Tomcat normal startup, this time we just have to access the local address of port 8080, if the port is not customized, the default is 80 port, this way I was set to 81 port, personal habits.

  

If you do not see this page, it may be a firewall problem, it may be that your Linux system does not install the JRE, because I installed the CentOS, the default to me installed a JDK, I did not install itself, directly use, resulting in Tomcat although the boot but not access, If you enter javac on the command line and there is no message, then the JRE will be installed. Another reason is that your Linux system virtual machine Firewall open, the address to intercept, the specific operation refer to the following steps.

  

Just turn it off.

  

After that, you should be able to access it.

    • Nginx Server Installation

Installing the Nginx server requires additional environment support. Before he had this environment, my Linux system was not the default. You have to knock over the command, anyway, there will be no reconfiguration, will tell you that the environment already exists.

Nginx is a C language development, it is recommended to run on Linux, this tutorial uses Centos6.4 as the installation environment.

Gcc

Installation nginx need to download the source code to compile, compile dependent gcc environment, if there is no GCC environment, need to install GCC:

  Yum Install gcc-c++

PCRE

PCRE (perl Compatible Regular Expressions) is a Perl library that includes a Perl-compatible regular expression library. The Nginx HTTP module uses PCRE to parse the regular expression, so the Pcre library needs to be installed on Linux.

Yum install-y pcre Pcre-devel

Note: Pcre-devel is a two-time development library developed using PCRE. Nginx also needs this library.

Zlib

The Zlib library provides a number of ways to compress and decompress, and Nginx uses zlib to gzip the contents of the HTTP package, so you need to install the Zlib library on Linux.

Yum install-y zlib Zlib-devel

Openssl

OpenSSL is a strong Secure Sockets Layer cipher library that includes key cryptographic algorithms, common key and certificate encapsulation management functions, and SSL protocols, and provides a rich set of applications for testing or other purposes.

Nginx not only supports the HTTP protocol, but also supports HTTPS (that is, transmitting HTTP on the SSL protocol), so you need to install the OpenSSL library on Linux.

Yum Install-y OpenSSL Openssl-devel

After installing the above command, the Nginx installation package is placed under the Linux system.

The first step: upload the Nginx source to the Linux system

Step two: Unzip the package.

Step three: Carry out configure.

./configure \

--prefix=/usr/local/nginx \

--pid-path=/var/run/nginx/nginx.pid \

--lock-path=/var/lock/nginx.lock \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/temp/nginx/client \

--http-proxy-temp-path=/var/temp/nginx/proxy \

--HTTP-FASTCGI-TEMP-PATH=/VAR/TEMP/NGINX/FASTCGI \

--HTTP-UWSGI-TEMP-PATH=/VAR/TEMP/NGINX/UWSGI \

--http-scgi-temp-path=/var/temp/nginx/scgi

Note: The temp file directory is specified as/var/temp/nginx on the top, and you need to create a temporary and Nginx directory under/var

A. Unzip the address

  

 B. Creating a folder location

  

After the installation is complete, enter the Configure command.

Go to steps fourth and fifth.

Fourth step: Make

Fifth Step: Make install

    • Nginx start-up, stop

1, start: Enter Nginx sbin directory,./nginx can start

  

  

2. Close Nginx:

You can use the KILL command, but it is not recommended.

Recommended use:./nginx-s stop

3, refresh the configuration:./nginx-s Reload

    • Nginx's Reverse proxy

This is the play, I'll write it later, go to work.

  

Linux Learning (Jdk,tomcat,nginx reverse proxy)

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.