# iCatch **Repository Path**: hute-information/iCatch ## Basic Information - **Project Name**: iCatch - **Description**: No description available - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-19 - **Last Updated**: 2022-02-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # iCatch部署说明 # 使用vagrant部署说明(开发环境) ## 初始化启动vagrant 第一次启动项目需加provision选项 ```sh vagrant up --provision ``` ## 启动vagrant ```sh vagrant up ``` # centos7部署详细步骤(生产、测试环境) ## 安装MySQL ### 更新yum源 ```sh sudo rpm -Uvh https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm ``` ### yum安装mysql-community-server ```sh sudo yum install mysql-community-server sudo yum install mysql-community-client ``` ### 不生成密码 ```sh sudo mysqld --initialize-insecure ``` ### 赋予目录权限 ```sh sudo chown -R mysql:mysql /var/lib/mysql ``` ### 向/etc/my.cnf中写入'sql_mode',解决GROUP BY报错 ```sh sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' ``` ### Mysql服务 ```sh # 启动 # sudo systemctl start mysqld # 停止 # sudo systemctl stop mysqld # 开机启动 sudo systemctl enable mysqld # 关闭开机启动 # sudo systemctl disable mysqld ``` ## 安装PHP7 ### 安装epel-release ```sh sudo yum install epel-release sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # 国内https可能无法访问 # sudo rpm -Uvh http://mirror.webtatic.com/yum/el7/webtatic-release.rpm ``` ### 安装PHP7 ```sh sudo yum install php70w php70w-common php70w-mysql php70w-pdo php70w-mbstring php70w-gd php70w-fpm php70w-mcrypt php70w-xml php70w-bcmath ``` ### 安装poppler ```sh sudo yum install poppler-utils ``` ### php-fpm服务 ```sh # 启动 # sudo systemctl start php-fpm.service # 停止 # sudo systemctl stop php-fpm.service # 开机启动 sudo systemctl enable php-fpm.service # 关闭开机启动 # sudo systemctl disable php-fpm.service ``` ## 安装nginx ### 安装nginx-release ```sh sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm sudo yum install nginx-release ``` ### 安装官方最新release的版本 ``` sudo yum install nginx ``` ### nginx服务 ```sh # 启动 # sudo systemctl start nginx.service # 停止 # sudo systemctl stop nginx.service # 开机启动 sudo systemctl enable nginx.service # 关闭开机启动 # sudo systemctl disable nginx.service ``` ## 安装redis ### 安装 ```sh sudo yum install redis ``` ### redis服务 ```sh # 启动 # sudo systemctl start redis # 停止 # sudo systemctl stop redis # 开机启动 sudo systemctl enable redis # 关闭开机启动 # sudo systemctl disable redis ``` ## 关闭SELinux 修改/etc/selinux/config文件中设置SELINUX=disabled ,然后重启服务器。 ```sh sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config sed -i 's/SELINUX=permissive/SELINUX=disabled/' /etc/selinux/config ``` ## 打开防火墙端口 打开端口:80、443、8888、9999 ```sh firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=443/tcp --permanent firewall-cmd --zone=public --add-port=8888/tcp --permanent firewall-cmd --zone=public --add-port=9999/tcp --permanent ``` ## 部署应用 将iCatch.zip解压到/web目录 ## 初始化应用 ```sh tar zxvf web.tar.gz -C / /web/conf/init.sh ``` ## 添加定时任务 ```sh cp /web/conf/crontab-List /var/spool/cron/root ``` ## 覆盖 php.ini ```sh cp /web/conf/php.ini /etc/php.ini ```