zoukankan      html  css  js  c++  java
  • Centos7.6手工编译安装PHP7.2+nginx1.19.1并部署禅道

    本文是从Windows上将禅道12.3.1迁移到Centos7.6

    安装步骤如下:

    curl -o /usr/local/src/php-7.2.32.tar.gz https://www.php.net/distributions/php-7.2.32.tar.gz
    
    yum install gcc libxml2-devel openssl-devel curl-devel -y
    
    cd /usr/local/src
    tar -zxvf php-7.2.32.tar.gz
    cd php-7.2.32
    #编译安装
    ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=nobody --with-fpm-group=nobody --enable-mbstring --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-zlib --with-openssl
    
    make&&make install
    
    #配置php
    cp /usr/local/src/php-7.2.32/php.ini-production /usr/local/php/etc/php.ini
    ln -s /usr/local/php/etc/php.ini /etc/php.ini  
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf  
    cp /usr/local/src/php-7.2.32/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm  
    
    增加可执行权限  
    chmod +x /etc/init.d/php-fpm  
    修改配置文件php.ini  
    date.timezone = PRC  
    session.save_path="/var/lib/php/session"  
    记得要手动创建下这个目录  
    mkdir -p /var/lib/php/session 
    
    cd /usr/local/php/etc/php-fpm.d/*.conf
    cp www.conf.default www.conf
    
    service php-fpm start
    yum install -y gcc gcc-c++  pcre pcre-devel  zlib zlib-devel openssl openssl-devel
    
    #下载安装nginx
    curl -o /usr/local/src/nginx-1.19.1.tar.gz http://nginx.org/download/nginx-1.19.1.tar.gz
    cd /usr/local/src/
    tar -zxvf nginx-1.19.1.tar.gz
    
    #编译安装nginx
    ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --pid-path=/usr/local/nginx/conf/nginx.pid --with-pcre
    make&&make install
    
    #建立软链接
    cd /etc/
    ln -s /usr/local/nginx/conf/nginx.conf nginx.conf
    cd /usr/sbin
    ln -s /usr/local/nginx/sbin/nginx nginx
    
    #下载禅道
    #1、禅道项目管理软件源码下载
    #、一定要下载中文版,否则后面不能继续进行
    curl -o /usr/local/src/ZenTaoPMS.12.3.1.zip http://dl.cnezsoft.com/zentao/12.3.1/ZenTaoPMS.12.3.1.zip?i=1
    cd /usr/local/src
    unzip ZenTaoPMS.12.3.1.zip
    mdir /opt/zentao/
    mv zentaopms/* /opt/zentao/
    
    #配置权限
    chmod o=rwx -R /opt/zentao/tmp/
    chmod o=rwx -R /opt/zentao/www/data
    chmod o=rwx -R /var/lib/php/session
    
    
    #编辑配置
    vim /etc/nginx.conf
    
    worker_processes  4;
    pid        conf/nginx.pid;
    location / {
        root   /opt/zentao/www;
        index  index.php index.html index.htm;
    }
    location ~ .php$ {
        root           /opt/zentao/www;        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    
    chown -R nobody:nobody /var/lib/php
    service php-fpm restart
    nginx -s reload
    
    
    
    #创建禅道账户
    
    create database zentao;
    
    CREATE USER 'zentao'@'localhost' IDENTIFIED BY 'Honghu@2019-2018';
    GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, LOCK TABLES, REFERENCES ON zentao.* TO 'zentao'@'localhost';
    FLUSH PRIVILEGES;
    
    CREATE USER 'zentao'@'127.0.0.1' IDENTIFIED BY 'Honghu@2019-2018';
    GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, LOCK TABLES, REFERENCES ON zentao.* TO 'zentao'@'127.0.0.1';
    FLUSH PRIVILEGES;
    
    CREATE USER 'zentao'@'%' IDENTIFIED BY 'Honghu@2019-2018';
    GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP, INDEX, LOCK TABLES, REFERENCES ON zentao.* TO 'zentao'@'%';
    FLUSH PRIVILEGES;
    
    
    
    
    #数据迁移
    1、导出禅道表结果,远程连接过去执行
    2、将xamppzentaowwwdataupload上传到/opt/zentao/www/data/upload/
    3、给上传目设置权限sudo chmod -R 777 /opt/zentao/www/data/upload/

    本文参考:https://yq.aliyun.com/articles/645384

    安装成功后如下

    本博客文章绝大多数为原创,少量为转载,代码经过测试验证,如果有疑问直接留言或者私信我。
    创作文章不容易,转载文章必须注明文章出处;如果这篇文章对您有帮助,点击右侧打赏,支持一下吧。
  • 相关阅读:
    Ant 执行 exec cmd.exe 时路径包含空格的问题
    时区时差换算(GMT,UTC,PST,PDT)
    windows 共存多个位数不同的jdk时,eclipse的报错对应措施
    Windows下查询指定端口进程,并杀死
    关于windows的jdk
    第一阶段工作总结
    mac配置git mergetool为p4merge(2013笔记整理)
    ubuntu 14.04 安装压缩包版mysql
    关于微信公众号内嵌网页的几个meta标签
    关于js的keyCode
  • 原文地址:https://www.cnblogs.com/passedbylove/p/13397825.html
Copyright © 2011-2022 走看看