禅道 之 项目开发必备

谁都会走 提交于 2020-02-23 00:25:25

本文中禅道是直接放到网站根目录下授权直接使用的,前提是你必须有lnmp或lamp或lanmp环境呦!啦啦啦!

禅道介绍

禅道 项目管理软件 是国产的开源项目管理软件,专注研发项目管理,内置需求管理、任务管理、bug管理、缺陷管理、用例管理、计划发布等功能,实现了软件的完整生命周期管理。

禅道属于开源项目,有收费版,本次以开源版9.1.2进行搭建


禅道官网:http://www.zentao.net/

提示:本地环境我们没有安装mysql,安装禅道环境需要LNMP或者LAMP,本地以LAP进行演示 
php版本5.5.30 
nginx版本1.10.3

环境准备

 
  1. 1. 配置repo源和安装常用命令
  2. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  3. wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
  4. yum install -y net-tools vim wget lrzsz tree screen lsof tcpdump
  5. 2. 关闭防火墙selinux
  6. /etc/init.d/iptables stop
  7. sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  8. grep SELINUX=disabled /etc/selinux/config
  9. setenforce 0
  10. 3. 调整文件描述符
  11. echo '* - nofile 100000 ' >>/etc/security/limits.conf
  12. 5. 更新系统并重启
  13. yum update -y && reboot
 

一、安装nginx

 
  1. [root@abcdocker ~]# wget http://nginx.org/download/nginx-1.10.3.tar.gz
  2. [root@abcdocker ~]# yum install -y gcc glibc gcc-c++ prce-devel openssl-devel pcre-devel
  3. [root@abcdocker ~]# useradd -s /sbin/nologin www -M
  4. [root@abcdocker ~]# tar xf nginx-1.10.3.tar.gz && cd nginx-1.10.3
  5. [root@abcdocker ~]# ./configure --prefix=/usr/local/nginx-1.10.3 --user=nignx --group=nginx --with-http_ssl_module --with-http_stub_status_module
  6. [root@abcdocker ~]# make && make install
  7. [root@abcdocker ~]# ln -s /usr/local/nginx-1.10.3 /usr/local/nginx
  8. [root@localhost nginx-1.10.1]# netstat -lntp|grep nginx
  9. tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7058/nginx: master

启动脚本

 
  1. 手动启动
  2. [root@abcdocker ~]# /usr/local/nginx/sbin/nginx
  3. 脚本启动
  4. #!/bin/bash
  5. # chkconfig: 2345 20 80
  6. # description: Saves and restores system entropy pool for \
  7. ##############################################
  8. #date:2016.8.8
  9. #QQ:604419314
  10. #blog:www.abcdocker.com######################
  11. . /etc/init.d/functions
  12. path=/usr/local/nginx/sbin/nginx
  13. if [ $# -ne 1 ];then
  14. echo "please input {status|start|stop|restart|reload}"
  15. fi
  16. nginx_status(){
  17. status=`lsof -i:80|wc -l`
  18. if [ $status -gt 2 ];then
  19. echo "nginx is running "
  20. else
  21. echo "nginx no running"
  22. fi
  23. }
  24. ##################
  25. nginx_start(){
  26. $path
  27. if [ $? -eq 0 ];then
  28. action "nginx start" /bin/true
  29. else
  30. action "nginx no start" /bin/false
  31. fi
  32. }
  33. nginx_stop(){
  34. $path -s stop
  35. if [ $? -eq 0 ];then
  36. action "nginx stop" /bin/true
  37. else
  38. action "nginx no stop" /bin/false
  39. fi
  40. }
  41. nginx_restart(){
  42. $path -s stop
  43. if [ $? -eq 0 ];then
  44. action "nginx stop" /bin/true
  45. else
  46. action "nginx no stop" /bin/false
  47. fi
  48. sleep 3
  49. $path
  50. if [ $? -eq 0 ];then
  51. action "nginx start" /bin/true
  52. else
  53. action "nginx no start" /bin/false
  54. fi
  55. }
  56. nginx_reload(){
  57. $path -s reload
  58. if [ $? -eq 0 ];then
  59. action "nginx reload" /bin/true
  60. else
  61. action "nginx no reload" /bin/false
  62. fi
  63. }
  64. case "$1" in
  65. start)
  66. nginx_start
  67. ;;
  68. stop)
  69. nginx_stop
  70. ;;
  71. restart)
  72. nginx_restart
  73. ;;
  74. reload)
  75. nginx_reload
  76. ;;
  77. status)
  78. nginx_status
  79. ;;
  80. esac
 

二、安装PHP

本次php采用5.6.30

 
  1. php下载目录:http://php.net/downloads.php
  2. 安装PHP基础库
  3. yum install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel -y
  4. yum install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel -y
  5. rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
  6. 下载安装
  7. http://php.net/downloads.php
  8. 需要先安装支持的软件包
  9. wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
  10. tar zxf libiconv-1.14.tar.gz
  11. cd libiconv-1.14
  12. ./configure --prefix=/usr/local/libiconv
  13. make
  14. make install
  15. PHP相关扩展库
  16. wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
  17. yum -y install libmcrypt-devel
  18. yum -y install mhash
  19. yum -y install mcrypt
  20. yum -y install libmcrypt-devel
  21. 编译
  22. ./configure \
  23. --prefix=/usr/local/php5.6.30 \
  24. --with-config-file-path=/usr/local/php56/etc \
  25. --enable-inline-optimization \
  26. --disable-debug \
  27. --disable-rpath \
  28. --enable-shared \
  29. --enable-opcache \
  30. --enable-fpm \
  31. --with-fpm-user=nginx \
  32. --with-fpm-group=nginx \
  33. --with-mysql=mysqlnd \
  34. --with-mysqli=mysqlnd \
  35. --with-pdo-mysql=mysqlnd \
  36. --with-gettext \
  37. --enable-mbstring \
  38. --with-iconv \
  39. --with-mcrypt \
  40. --with-mhash \
  41. --with-openssl \
  42. --enable-bcmath \
  43. --enable-soap \
  44. --with-libxml-dir \
  45. --enable-pcntl \
  46. --enable-shmop \
  47. --enable-sysvmsg \
  48. --enable-sysvsem \
  49. --enable-sysvshm \
  50. --enable-sockets \
  51. --with-curl \
  52. --with-zlib \
  53. --enable-zip \
  54. --with-bz2 \
  55. --with-readline
  56. [root@abcdocker ~]# make && make install
  57. [root@abcdocker ~]# ln -s /usr/local/php5.6.30/ /usr/local/php
  58. [root@abcdocker ~]# cp php5.6.30/php.ini-development /usr/local/php/lib/php.ini
  59. [root@abcdocker ~]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

启动

 
  1. 手动启动
  2. [root@abcdocker ~]# /usr/local/php/sbin/php-fpm
  3. 脚本启动
  4. #!/bin/bash
  5. # chkconfig: 2345 20 80
  6. # description: Saves and restores system entropy pool for \
  7. ##############################################
  8. #date:2016.8.8
  9. #QQ:604419314
  10. #blog:www.abcdocker.com######################
  11. . /etc/init.d/functions
  12. path=/application/php/sbin/php-fpm
  13. status=`lsof -i:9000|wc -l`
  14. ########################
  15. if [ $# -ne 1 ];then
  16. echo "please input {status|start|stop|restart}"
  17. fi
  18. php_status(){
  19. if [ $status -lt 3 ];then
  20. echo "php no running"
  21. else
  22. echo "php is running"
  23. fi
  24. }
  25. php_start(){
  26. $path
  27. if [ $? -ne 0 ];then
  28. action "php running error" /bin/false
  29. else
  30. action "php is running" /bin/true
  31. fi
  32. }
  33. php_stop(){
  34. pkill php-fpm
  35. if [ $? -ne 0 ];then
  36. action "php stop error" /bin/false
  37. else
  38. action "php is stop" /bin/true
  39. fi
  40. }
  41. case "$1" in
  42. status)
  43. php_status
  44. ;;
  45. start)
  46. php_start
  47. ;;
  48. stop)
  49. php_stop
  50. ;;
  51. restart)
  52. php_stop
  53. sleep 3
  54. php_start
  55. ;;
  56. esac
  57. ####################################
  58. 加入开机启动
  59. chkconfig --add php
  60. chkconfig php on
 

php与nginx结合

nginx.conf配置如下

 
  1. [root@php conf]# cat nginx.conf
  2. user nginx;
  3. worker_processes 2;
  4. error_log /var/log/nginx/error.log;
  5. pid /var/run/nginx.pid;
  6. events {
  7. use epoll;
  8. worker_connections 65535;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  14. '$status $body_bytes_sent "$http_referer" '
  15. '"$http_user_agent" "$http_x_forwarded_for"';
  16. access_log /var/log/nginx/access.log main;
  17. server_tokens off;
  18. sendfile on;
  19. tcp_nopush on;
  20. keepalive_timeout 65;
  21. tcp_nodelay on;
  22. client_header_buffer_size 4k;
  23. open_file_cache max=65535 inactive=60s;
  24. open_file_cache_valid 80s;
  25. client_body_buffer_size 512k;
  26. large_client_header_buffers 4 512k;
  27. proxy_connect_timeout 30;
  28. proxy_read_timeout 60;
  29. proxy_send_timeout 20;
  30. proxy_buffering on;
  31. proxy_buffer_size 16k;
  32. proxy_buffers 4 64k;
  33. proxy_busy_buffers_size 128k;
  34. proxy_temp_file_write_size 128k;
  35. gzip on;
  36. gzip_min_length 1k;
  37. gzip_buffers 4 16k;
  38. gzip_http_version 1.1;
  39. gzip_comp_level 2;
  40. gzip_types text/plainapplication/x-javascript text/css application/xml;
  41. gzip_vary on;
  42. include /application/nginx/conf/extra/*.conf;
  43. }

server标签配置如下

 
  1. [root@php extra]# cat zentao.conf
  2. server {
  3. listen 80;
  4. server_name 域名;
  5. access_log /var/log/nginx/zentao_access.log main;
  6. root /application/php_php/zentao/www;
  7. location / {
  8. index index.php index.html index.htm;
  9. }
  10. location ~ .*\.(php|php5)?$ {
  11. fastcgi_pass 127.0.0.1:9000;
  12. fastcgi_index index.php;
  13. include fastcgi.conf;
  14. }
  15. }

因为我本次演示环境的架构属于一台没有外网的web,通过nginx代理。下面是nginx代理的server标签配置

nginx 代理节点server配置

 
  1. upstream zentao {
  2. server 10.117.215.78;
  3. }
  4. server {
  5. listen 80;
  6. server_name abcdocker.com;
  7. access_log /var/log/nginx/zentao_access.log main;
  8. location / {
  9. root html;
  10. index index.html index.htm;
  11. proxy_pass http://zentao;
  12. proxy_set_header Host $http_host;
  13. proxy_set_header X-Real-IP $remote_addr;
  14. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  15. client_max_body_size 300m;
  16. }
  17. }
 

下载禅道

 
    1. [root@abcdocker]# wget http://dl.cnezsoft.com/zentao/9.1.2/ZenTaoPMS.9.1.2.zip
    2. 将程序解压访问即可,我们nginx站点目录设置如下:php_php/zentao/www;
    3. 直接访问IP or域名 即可

配置






 

 

本文是借鉴其他网站的,每天记录有用的东西,就当做笔记了。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!