之前的文章《关于CentOS YAPI部署(代码分享)》中,给大家介绍了CentOS安装配置的问题。下面本篇文章给大家了解centos8中安装禅道的步骤,有一定的参考价值,有需要的朋友可以参考一下,希望对你们有所助。

浅析centos8中安装禅道的步骤(附代码)插图

环境

CentOS 8 + 禅道15.x + Nginx + Mysql + PHP

PHP配置

centos自带的有php环境

sudo dnf module list php # 查看版本,默认7.2

安装php7.2以及所需组件

sudo dnf install php php-pdo php-gd php-mbstring php-mysqlnd php-ldap php-json php-xml php-zip

重启服务

systemctl start php-fpm.service #开启
systemctl status php-fpm.service  #查看状态
systemctl enable php-fpm.service  #开机启动

权限配置,编辑www.conf

vi /etc/php-fpm.d/www.conf

找到做修改

user = (非root 用户)
group = (非root 用户)

这里没配好 503,500

注意这里使用端口和非端口的区别,和下面nignx配置对应

;listen = /run/php-fpm/www.sock
listen = 9000

配置好了重启

systemctl restart php-fpm.service

Mysql安装配置

安装mariadb

dnf -y install mariadb mariadb-server 
systemctl start mariadb.service # 开启服务 
systemctl enable mariadb.service # 开机启动 

systemctl status mariadb.service # 查看服务状态
systemctl stop mariadb.service # 关闭服务

mariadb 为mysql分支

数据库安装设置,重置数据库root账号密码,执行该命令前必须开启mariadb服务。

mysql_secure_installation 

Enter current password for root (enter for none): 输入当前root账号密码,刚安装默认为空,直接回车即可 
Set root password? [Y/n] 是否输入root密码,输入y 回车 
New password: 输入密码 
Re-enter new password: 重复输入 
Remove anonymous users? [Y/n] 删除其他用户 y 
Disallow root login remotely? [Y/n] 允许root账号远程登录 y 
Remove test database and access to it? [Y/n] 删除测试表 y 
Reload privilege tables now? [Y/n] 重新加载配置表 y

登陆测试,执行如下命令并输入密码。
mysql -uroot -p

mariadb的远程链接配置

select User, host from mysql.user;

输出

+------+-----------+
| User | host      |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1       |
| root | localhost |
+------+-----------+

允许外部ip连接

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

输出

+------+-----------+
| User | host      |
+------+-----------+
| root | %         |
| root | 127.0.0.1 |
| root | ::1       |
| root | localhost |
+------+-----------+

允许单独的ip链接

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%' IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;

最后一步还需要配置防火墙 / 安全策略组,开放3306 端口

安装禅道v15.x

wget https://www.zentao.net/dl/zentao/15.0.3/ZenTaoPMS.15.0.3.zip

dnf -y install unzip # 安装unzip解压 ,有就不装
unzip ZenTaoPMS.11.5.stable.zip # 解压禅道源码包

Nginx绑定域名

yum install nginx # 有就跳过
systemctl start nginx.service

权限

vi /etc/nginx/nginx.conf

找到

user = root

代理配置

vi /etc/nginx/conf.d/zentao.conf

server{
  server_name xxx.com;
  client_max_body_size 1000M;

  root /home/[user]/www/zentaopms/www;

  location / {
    root /home/{user}/www/zentaopms/www;
    index index.php index.html index.htm;
  }

  location ~ .*\.php$ {
    fastcgi_pass   127.0.0.1:9000; #注意这里和php 配置对应
    #fastcgi_pass  unix:/run/php-fpm/www.sock 
    fastcgi_index  index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO                $fastcgi_script_name; 
    include        fastcgi_params;    
    include fastcgi.conf;            
  } 

  # https
  #listen 443 ssl; 
  #ssl_certificate	/etc/nginx/cer/fullchain.crt;
  #ssl_certificate_key /etc/nginx/cer/private.pem;
  #ssl_protocols TLSv1.1 TLSv1.2;
  #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
  #ssl_prefer_server_ciphers on;
  #ssl_session_cache shared:SSL:10m;
  #ssl_session_timeout 10m;
}

#server{
#  if ($host = xxx.com) {
#      return 301 https://$host$request_uri;
#  } 
#  server_name xxx.com;
#  listen 80;
#  return 404; 
#}

重启服务

nginx -s reload

完工!

推荐学习:CentOS教程

以上就是浅析centos8中安装禅道的步骤(附代码)的详细内容,更多请关注亿码酷站其它相关文章!


<!–亿码酷站直播班–>浅析centos8中安装禅道的步骤(附代码)
—–文章转载自PHP中文网如有侵权请联系ymkuzhan@126.com删除

云服务器推荐