tomcat ng mysql 集成_tomcat+nginx+mysql+jdk 环境搭建

1、安装JDK

rzsz 上传到服务器安装 jdk 7u55

2、安装tomcat

下载tomcat 7

http://apache.fayea.com/tomcat/tomcat-7/v7.0.61/bin/apache-tomcat-7.0.61.tar.gz

3、安装nginx

nginx 安装依赖一下三个包

3.1  openssl-1.0.1c.tar.gz

http://www.openssl.org/source/openssl-1.0.2a.tar.gz

3.2  pcre-8.36.tar.gz   需要安装依赖包  yum install -y gcc gcc-c++

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz

3.3  zlib-1.2.8.tar.gz

http://zlib.net/zlib-1.2.8.tar.gz

3.4  yum install mhash、yum install zlib-devel

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 (指定openssl 库的路径) --with-pcre=../soft/pcre-8.21 --with-zlib=../soft/zlib-1.2.8

groupadd -r nginx

useradd -r -g nginx -s /bin/false -M nginx

#注意 \ 前面至少一个有空格

./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 功能,用来监控 Nginx 的当前状态

--user=nginx \

--group=nginx

make && make install

3.6 启动nginx  服务   /usr/local/nginx/nginx/sbin/nginx -c /usr/loacl/nginx/nginx/conf/nginx.conf (/usr/local/nginx/nginx 是nginx的安装目录)

重新加载nginx 服务 /usr/local/nginx/nginx/sbin/nginx -s reload

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

nginx 下载地址:http://nginx.org/download/nginx-1.7.12.tar.gz

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存放文件夹)

index index.html index.htm index.jsp;

}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html

#

error_page 500 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 代理tomcat 8080 端口)

}

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

/usr/local/nginx/sbin/nginx -t  检查 nginx.conf 配置文件是否正确

4、安装mysql

安装rpm Mysql-server 5.5 ; Mysql-client 5.5

http://mirrors.sohu.com/mysql/MySQL-5.5/MySQL-devel-5.5.41-1.linux2.6.x86_64.rpm

http://mirrors.sohu.com/mysql/MySQL-5.5/MySQL-server-5.5.41-1.linux2.6.x86_64.rpm

http://mirrors.sohu.com/mysql/MySQL-5.5/MySQL-client-5.5.41-1.linux2.6.x86_64.rpm

/etc/init.d/mysql start (启动mysql)

/usr/bin/mysqladmin -u root   password 'create password' 创建root 密码

/usr/bin/mysqladmin -u root  -p 'old password' password 'create new password' 更改新密码;

mysql 数据库初始化  mysql_install_db

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值