Java Web server deployment

reference: 

  Ali Java cloud deployment sites and micro-channel development and debugging tips and tricks (on): https://www.imooc.com/article/20583

  Ali Java cloud deployment sites and micro-channel development and debugging tips and tricks (lower): https://www.imooc.com/article/20584

A. Operating environment to build (on centos)

  (1) JDK (selected here is JDK1.8)    

    Download address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html . Choice is jdk-8u144-linux-x64.rpm.

    After the download is complete execution: RPM -ivh the JDK-8u144-Linux-x64.rpm

  (2) Tomcat 8

    Download as http://tomcat.apache.org/download-80.cgi#8.0.46 chose apache-tomcat-8.0.46.tar.gz

    解压: tar -zxvf apache-tomcat-8.5.41.tar.gz 

      

    Start tomcat: ./ apache-tomcat-8.5.41 / bin / startup.sh

    Tomcat modify default connection port (8080): Apache Tomcat-8.5.41-/ the conf / the server.xml

    After editing restart Tomcat :( pay attention to see whether the port is open or occupied)

      Shut down the Tomcat service: ./ apache-tomcat-8.5.41 / bin / shutdown.sh

      Start Tomcat service: ./ apache-tomcat-8.5.41 / bin / startup.sh

Tomcat log to see whether a successful start

  (3) Mysql (I use Mariadb) repo source, after that comes through centos yum install

    Download address is https://dev.mysql.com/downloads/repo/yum/ . Pick mysql57-community-release-el7-11.noarch.rpm

  ( . 4) the Redis (optional, preferably pre-installed on, where the selected version 4.0.2)

    Download to https://redis.io/download options here. redis-4.0.2.tar.gz.

    Extracting: the tar-5.0.5.tar.gz the xzf Redis;

    Set redis to support remote login: vim redis-5.0.5 / redis.conf

    

     Also need to add to redis.conf configured to support redis been run as a daemon in the background daemonize yes:

      

    Installation: cd redis-5.0.5

       make

    Start Service: src / redis-server redis.conf

    redis connection test:      

      Connection to redis redis-cli server, the src / redis-cli, when the input ping pong response obtained to prove the configuration has been completed redis     

 

  将上面的软件都下载到本地,并上传到服务器(如果您的系统为MAC或LINUX,直接使用SCP命令行上传,具体指令可以查询网上,如果您的系统为WIN,推荐使用filezilla可视化上传工具上传),或者您也可以直接登录服务器,wget+ftp地址直接下载这些软件;同时需要大家注意的是,我们在服务器上部署了数据库之后,需要往数据库里面去补充数据,我们的线上数据访问的是线上的数据库而非本地的数据库。图片包也需要上传到服务器并通过配置server.xml确保能读取到这些图片(前提是docBase配置上的路径已经在服务器上创建)。

  注:可以利用xshell工具实现远程连接(rz/sz上传下载文件),xftp等工具实现可视化服务器与本地文件传输。

xshell使用

xftp工具使用

 

二.在服务器上发布并运行自己的Java web项目  

  1.将项目打包成War包:

    

  2.打包完成后,将war包上传到服务器上/apache-tomcat-8.5.41/webapps下:

上传成功后,没过几秒tomcat便会在webapps目录下自动从项目war包中解析出项目工程目录来

  3.访问目标Ip和端口成功展示:

    注:可以通过查看IP加端口查看Tomcat是否启动成功,很本机都是一样的。

 

  4.域名解析:

    由于域名比较贵,作为学生党没敢用。以后用的时候简单配置即可。

三.微信开发调试 

 

 

    

 

    

   

 

 

  

 

  

Guess you like

Origin www.cnblogs.com/lyq-biu/p/10945186.html