zoukankan      html  css  js  c++  java
  • 项目部署

    练手项目

    停车场系统

    1. 安装centos7
    2. 解压安装python3 tar -xf Python-3.5.6.tar.xz 解压缩xz压缩包
    3. 源码编译安装
      1. yum groupinstall 'Development Tools'
      2. yum install -y ncurses-libs zlib-devel mysql-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
      3. mkdir /usr/local/python3
      4. cd Python-3.5.6
      5. 编译配置 ./configure --prefix=/usr/local/python3 --enable-optimizations
      6. 编译和安装 make && make install
      7. 在/usr/bin创建python3的快捷方式链接,方便在系统任何目录运行python3
        1. ln -s /usr/local/python3/bin/python3 /usr/bin/python3
        2. ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
      8. 查看版本号 python3 -V
    4. mysql安装
      1. 安装命令 yum -y install mariadb mariadb-server
      2. 安装完成MariaDB,首先启动MariaDB systemctl start mariadb
      3. 设置开机启动 systemctl enable mariadb
      4. 取消开机启动 systemctl disable mariadb
    5. 项目包处理
      1. 切换到/opt
      2. 解压ParkingSys-master.zip代码包到当前目录
      3. 进入源码目录 /opt/ParkingSys-master/ParkingSysApi
    6. 安装程序依赖包
      1. pip3 install -r requirements.txt
      2. pip3 install -r requirements.txt --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
    7. 创建数据库
      1. 进入数据库使用mysql -u root -p CREATE DATABASE parking CHARSET=UTF8
      2. 找到config.py 数据的密码设定好,如果没有密码把 :123456 去除掉
    8. 启动停车场系统
      1. 切换目录 cd /opt/ParkingSys-master
      2. 启动停车场系统 执行 python3 apprun.py &
    9. navicat客户端连接数据库,更改mysql数据权限表
      1.进入数据库 mysql -u root -p
      2. use mysql;
      3. update user set Host = '%' where User = 'root' and Host = 'localhost.localdomain';
    10. 重新启动数据库 systemctl restart mariadb
    11. 关闭防火墙(已经关闭的时候可以忽略) systemctl stop firewalld systemctl disable firewalld

    国家电网

    1. 安装centos7操作系统
    2. 检查网络,配置网络参数
      1. ip addr 查看IP地址
      2. /etc/sysconfig/network-scripts/ifcfg-ens33网卡配置文件,将onboot=no改为yesIPV6开头的配置项全部#注释掉
      3. 重启操作系统reboot systemctl restart network
      4. 改为桥接模式继续重启 systemctl restart network
    3. /opt目录下安装JDK
      1. tar -zxvf jdk-8u144-linux-x64.tar.gz
      2. vi /etc/profile,在profile下添加如下:
        1. export JAVA_HOME=/opt/jdk1.8.0_144
        2. export PATH=(JAVA_HOME/bin:)PATH
        3. export CLASSPATH=.:(JAVA_HOME/lib/dt.jar:)JAVA_HOME/lib/tools.jar
        4. source /etc/profile
        5. java -version 检查jdk安装是否完好
      3. 在添加环境的时候,执行之后,导致vi命令不能使用的时候使用如下命令 export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/us
    4. /opt 安装tomcat中间件
      1. tar zxvf apache-tomcat-7.0.82.tar.gz
      2. 目录apache-tomcat-7.0.82名称修改为tomcat
      3. 命令关闭防火墙(先查看是否关闭,已经关闭忽略此步骤) systemctl stop firewalld #停止firewall systemctl disable firewalld #禁止firewall开机启动
      4. 启动tomcat tomcat/bin/startup.sh
      5. 用浏览器访问,http://:8080 测试tomcat安装是否完好
    5. 安装mysql数据库
      1. yum -y install mariadb mariadb-server
      2. 启动MariaDB systemctl start mariadb
      3. 设置开机启动 systemctl enable mariadb
      4. 修改数据库密码(可以不做)mariadb root用户,密码默认为空 mysql_secure_installation
    6. 部署应用
      1. 将KBMS.war拷贝到tomcat/webapps/目录下
      2. 使用脚本创建数据库以及表 mysql -u root -p 以root用户登录数据库 mysql
      3. source /opt/KBMS.sql
    7. 配置数据库连接
      1. 将KBMS.xml数据库配置文件拷贝到tomcat/conf/Catalina/localhost/并且打开修改数据库密码为空 vi tomcat/conf/Catalina/localhost/KBMS.xml→password=""
      2. 打开/etc/my.cnf 在[mysqld]下添加skip-grant-tables
    8. 重新启动mysql
      1. systemctl stop mariadb
      2. systemctl start mariadb
    9. 重新启动tomcat
      1. tomcat/bin/shutdown.sh
      2. tomcat/bin/startup.sh
    10. 浏览器打开应用 http://{ip地址}:8080/KBMS
    11. 修改tomcat默认端口号(8080)tomcat/conf/server.xml 将8080修改为80
    12. 浏览器再次打开应用 http://{ip地址}/KBMS
    13. 查看tomcat日志
      1. 日志所在位置在 tomcat/logs/catalina.out
      2. 根据error/excption 去查找错误内容
    14. mysql默认端口号是3306 oracle 默认端口号是1521
  • 相关阅读:
    Python超级篇-机器学习
    python高给篇-爬虫
    机器学习之-sklearn
    luogu3384 【模板】树链剖分
    bzoj3884 上帝与集合的正确用法
    luogu2765 魔术球问题
    poj2976 Dropping tests 01分数规划
    luogu2764 最小路径覆盖问题
    luogu2763 试题库问题
    luogu2762 太空飞行计划问题
  • 原文地址:https://www.cnblogs.com/wp950416/p/13997867.html
Copyright © 2011-2022 走看看