搭建lnmt环境


nginx安装
mysql安装

tomcat项目部署

java环境安装
[root@localhost ~]# yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel
.....安装过程略

//查看安装的版本
[root@localhost ~]# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
tomcat部署
//下载tomcat
[root@localhost ~]# wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.29/bin/apache-tomcat-9.0.29.tar.gz


//创建安装目录,解压软件到目录
[root@localhost ~]# mkdir /opt/tomcat
[root@localhost ~]# tar xf apache-tomcat-9.0.29.tar.gz -C /opt/tomcat/


//进入安装目录
[root@localhost ~]# cd /opt/tomcat/
[root@localhost tomcat]# ls
apache-tomcat-9.0.29


//创建软链接
[root@localhost tomcat]# ln -sv /opt/tomcat/apache-tomcat-9.0.29/ /opt/tomcat/tomcat
"/opt/tomcat/tomcat" -> "/opt/tomcat/apache-tomcat-9.0.29/"
[root@localhost tomcat]# ls
apache-tomcat-9.0.29  tomcat
[root@localhost tomcat]# cd tomcat/
[root@localhost tomcat]# ls
bin  BUILDING.txt  conf  CONTRIBUTING.md  lib  LICENSE  logs  NOTICE  README.md  RELEASE-NOTES  RUNNING.txt  temp  webapps  work


//创建测试网页
[root@localhost tomcat]# cd webapps/
[root@localhost webapps]# ls
docs  examples  host-manager  manager  ROOT
[root@localhost webapps]# mkdir test
[root@localhost webapps]# vim index.jsp
[root@localhost webapps]# cat test/index.jsp 
<html>
<head>
        <title>test page</title>
</head>
<body>
        <%
            out.println("Hellow World");
        %>
</body>
</html>
[root@localhost webapps]# mv index.jsp /opt/tomcat/tomcat/webapps/test/


//重启tomcat
[root@localhost test]# /opt/tomcat/tomcat/bin/catalina.sh stop
[root@localhost test]# /opt/tomcat/tomcat/bin/catalina.sh start


//配置nginx反向代理
[root@localhost ~]# vim /opt/nginx/conf/nginx.conf
    #gzip  on;
    upstream test {
    server 192.168.26.156:8080;
    }

    server {
        listen       80;
        server_name  www.tomcattest.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
        proxy_pass http://test;
        }

        #error_page  404              /404.html;



//重启nginx
[root@localhost ~]# nginx -s stop
[root@localhost ~]# nginx
[root@localhost ~]# ss -tanl
State       Recv-Q Send-Q                                       Local Address:Port                                                      Peer Address:Port              
LISTEN      0      128                                                      *:80                                                                   *:*                  
LISTEN      0      128                                                      *:22                                                                   *:*                  
LISTEN      0      100                                              127.0.0.1:25                                                                   *:*                  
LISTEN      0      100                                                     :::8080                                                                :::*                  
LISTEN      0      128                                                     :::22                                                                  :::*                  
LISTEN      0      100                                                    ::1:25                                                                  :::*                  
LISTEN      0      1                                         ::ffff:127.0.0.1:8005                                                                :::*                  
LISTEN      0      100                                                     :::8009                                                                :::*                  
LISTEN      0      80                                                      :::3306                                                                :::*                  

在这里插入图片描述
在这里插入图片描述

发布jenkins

//下载jenkins
[root@localhost ~]# wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
[root@localhost ~]# ls
anaconda-ks.cfg  apache-tomcat-9.0.29.tar.gz  jenkins.war


//将jenkins拷贝到tomcat安装目录下的webapps
[root@localhost ~]# cd /opt/tomcat/tomcat/webapps
[root@localhost webapps]# cp /root/jenkins.war ./
[root@localhost webapps]# ls                //拷贝过来后会自动解压安装包
docs  examples  host-manager  jenkins  jenkins.war  manager  ROOT  test

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值