TOMCAT+NGINX+MYSQL+JDK Environment Construction

Source: Internet
Author: User
Tags openssl library web hosting

1. Installing the JDK

Zrsz upload to server install JDK 7u55

2. Install Tomcat

Download Tomcat 7

3. Installing Nginx

Nginx installation relies on three packages

3.1 openssl-1.0.1c.tar.gz

3.2 pcre-8.36.tar.gz

3.3 zlib-1.2.8.tar.gz

3.4 Yum Install Mhash

3.5./configure/configure--prefix=/usr/local/nginx/--with-http_stub_status_module--with-http_ssl_module-- WITH-OPENSSL=/USR/LOCAL/NGINX/SOFT/OPENSSL-1.0.1C (Specify the path to the OpenSSL library)--with-pcre=: /soft/pcre-8.21--with-zlib=. /soft/zlib-1.2.8

Groupadd-r Nginxuseradd-r-G nginx-s/bin/false-m nginx# note \ There is at least one space in front./configure--sbin-path=/usr/local/nginx/nginx- -conf-path=/usr/local/nginx/nginx.conf--pid-path=/usr/local/nginx/nginx.pid--with-http_ssl_module--with-pcre=. /pcre-8.21 \  #指向解压的源码目录--with-zlib=. /zlib-1.2.8 \    #指向解压的源码目录--with-openssl=. /openssl-1.0.1 \ #指向解压的源码目录--with-http_stub_status_module \ #启用 nginx nginxstatus function, used to monitor the current status of Nginx--user=nginx-- Group=nginx

Make && make install

3.6 Start Nginx service/usr/local/nginx/nginx/sbin/nginx-c/usr/loacl/nginx/nginx/conf/nginx.conf (/usr/local/nginx/nginx is the Nginx installation directory)

Reload Nginx Service/usr/local/nginx/nginx/sbin/nginx-s Reload

------------------------------------------------------------------------------------

  

server {
Listen 80;
server_name localhost;

#charset Koi8-r;

#access_log Logs/host.access.log Main;

Location/{
Root/usr/local/tomcat/apache-tomcat-7.0.59/webapps/root; (Tomcat web hosting folder)
Index index.html index.htm index.jsp;
}

#error_page 404/404.html;

# REDIRECT Server error pages to the static page/50x.html
#
Error_page 502 503 504/50x.html;
Location =/50x.html {
root HTML;
}

# Proxy The PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# Proxy_pass http://127.0.0.1;
#}
Location ~ \.jsp$ {
Proxy_pass http://127.0.0.1:8080; (nginx proxy tomcat 8080 port)

}

---------------------------------------------------------------

/USR/LOCAL/NGINX/SBIN/NGINX-T Check that the nginx.conf configuration file is correct

4. Install MySQL

Install RPM Mysql-server 5.5; Mysql-client 5.5

/etc/init.d/mysql start (start MySQL)

/usr/bin/mysqladmin-u root password ' Create password ' create root password

/usr/bin/mysqladmin-u root-p ' old password ' password ' Create new password ' change the password;

MySQL Database initialization mysql_install_db

TOMCAT+NGINX+MYSQL+JDK Environment Construction

Related Article

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.