禅道源码部署
文章目录
- 禅道部署
- 1.环境部署
- 安装httpd和mariadb
- 安装php
- 2.安装禅道
- 首先进行httpd服务的配置
- 安装禅道
禅道部署
1.环境部署
安装lamp环境
组件 | 版本 |
---|---|
httpd | yum安装 |
mariadb | yum安装 |
php | php-7.4.33 |
选择一个php版本就行,我们这里选择的是7.4.33
安装httpd和mariadb
[root@zentao ~]# yum -y install httpd mariadb-server
##设置自启动
[root@zentao ~]# systemctl enable --now httpd
[root@zentao ~]# systemctl enable --now mariadb
##设置mariadb数据库密码
[root@zentao ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.68-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> set password = password('123456');
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
安装php
1.环境配置
[root@zentao ~]# yum -y install libxml2-devel gcc-c++ openssl-devel sqlite-devel libcurl-devel readline-devel libpng-devel freetype-devel libzip-devel libjpeg-turbo-devel bzip2-devel
##安装oniguruma
[root@zentao ~]# tar xf oniguruma-6.9.4.tar.gz
[root@zentao ~]# cd oniguruma-6.9.4
(这是安装oniguruma所需依赖)
[root@zentao oniguruma-6.9.4]# yum -y install whatprovides autoconf automake libtool
[root@zentao oniguruma-6.9.4]# ./autogen.sh
Generating autotools files.
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Run ./configure, make, and make install.
[root@zentao oniguruma-6.9.4]# ./configure --prefix=/usr --libdir=/lib64
[root@zentao oniguruma-6.9.4]# make && make install
##降级libzip
[root@zentao ~]# yum -y remove libzip
[root@zentao ~]# tar xf libzip-1.2.0.tar.gz
[root@zentao ~]# cd libzip-1.2.0
[root@zentao libzip-1.2.0]# ./configure --prefix=/usr --libdir=/lib64
[root@zentao libzip-1.2.0]# make && make install
2.安装php
[root@zentao ~]# tar xf php-7.4.33.tar.gz
[root@zentao ~]# cd php-7.4.33
[root@zentao php-7.4.33]# ls
appveyor buildconf.bat docs NEWS README.REDIST.BINS travis Zend
azure CODING_STANDARDS.md ext pear run-tests.php TSRM
azure-pipelines.yml configure EXTENSIONS php.ini-development sapi UPGRADING
build configure.ac LICENSE php.ini-production scripts UPGRADING.INTERNALS
buildconf CONTRIBUTING.md main README.md tests win32
[root@zentao php-7.4.33]# ./configure --prefix=/usr/local/php7 \
--with-config-file-path=/etc \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-openssl \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif \
--enable-ftp \
--enable-gd \
--with-jpeg \
--with-zlib \
--with-zlib-dir \
--with-freetype \
--with-gettext \
--enable-json \
--enable-mbstring \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-readline \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--with-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-pcntl \
--enable-posix
[root@zentao php-7.4.33]# make -j $(cat /proc/cpuinfo |grep processor|wc -l)
[root@zentao php-7.4.33]# make install
3.配置环境变量和安装后配置
##环境变量配置
[root@zentao php-7.4.33]# echo 'export PATH=/usr/local/php7/bin:$PATH' > /etc/profile.d/php7.sh
[root@zentao php-7.4.33]# cp php.ini-production /etc/php.ini
[root@zentao php-7.4.33]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@zentao php-7.4.33]# chmod +x /etc/rc.d/init.d/php-fpm
[root@zentao php-7.4.33]# cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
[root@zentao php-7.4.33]# cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
##编写php服务的单元文件
[root@zentao php-7.4.33]# cat > /usr/lib/systemd/system/php-fpm.service <<EOF
[Unit]
Description=php-fpm server daemon
After=network.target
[Service]
Type=forking
ExecStart=/etc/init.d/php-fpm start
ExecStop=/etc/init.d/php-fpm stop
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
EOF
##配置fpm的相关选项为你所需要的值:
[root@zentao php-7.4.33]# cat <<EOF >> /usr/local/php7/etc/php-fpm.conf
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 8
EOF
##加载配置文件并设置php开机自启
[root@zentao php-7.4.33]# systemctl daemon-reload
[root@zentao php-7.4.33]# systemctl enable --now php-fpm
Created symlink from /etc/systemd/system/multi-user.target.wants/php-fpm.service to /usr/lib/systemd/system/php-fpm.service.
[root@zentao php-7.4.33]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:9000 *:*
LISTEN 0 50 *:3306 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 100 127.0.0.1:25 *:*
LISTEN 0 128 :::80 :::*
LISTEN 0 128 :::22 :::*
LISTEN 0 100 ::1:25 :::*
2.安装禅道
首先进行httpd服务的配置
[root@zentao ~]# find / -name *vhosts.conf
/usr/share/doc/httpd-2.4.6/httpd-vhosts.conf
[root@zentao ~]# cd /etc/httpd
[root@zentao httpd]# cd conf.d
[root@zentao conf.d]# cp /usr/share/doc/httpd-2.4.6/httpd-vhosts.conf vhosts.conf
[root@zentao conf.d]# vim vhosts.conf
[root@zentao conf.d]# cat vhosts.conf
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ErrorLog "/var/log/httpd/zentao-error_log"
CustomLog "/var/log/httpd/zentao-access_log" common
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/html/$1
<Directory "/var/www/html">
Options none
AllowOverride none
Require all granted
</Directory>
</VirtualHost>
[root@zentao conf.d]# cd ..
[root@zentao httpd]# cd conf
[root@zentao conf]# vim httpd.conf
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php ;添加这一行
AddType application/x-httpd-php-source .phps ;添加这一行
[root@zentao conf]# vim httpd.conf
[root@zentao conf]# grep -C1 'index.html' httpd.conf
<IfModule dir_module>
DirectoryIndex index.php index.html ;将index.php放在index.html前面
</IfModule>
##重启httpd服务
[root@zentao conf]# systemctl restart httpd
##关闭防火墙
[root@zentao ~]# systemctl disable --now firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@zentao ~]# setenforce 0
安装禅道
[root@zentao ~]# unzip ZenTaoPMS-20.7.1-php7.2_7.4.zip
[root@zentao ~]# cp -r zentaopms/ /var/www/html/
以本机ip+指定路径访问安装界面
按照要求修改权限
[root@zentao html]# chmod 777 -R /var/www/html/zentaopms/tmp/
[root@zentao html]# chmod 777 -R /var/www/html/zentaopms/www/data
权限修改完成之后下一步即可
数据库密码为之前给mariadb设置的密码
下一步即可
出现没有生成配置文件的报错
查阅开发者社区的建议是
可以将zentaopms/config/config.php中的下面一行修改为true,开启自定义session:
$config->customSession = true;
[root@zentao html]# cd zentaopms/
[root@zentao zentaopms]# cd config/
[root@zentao config]# vim config.php
[root@zentao config]# grep -C1 'customSession' config.php
$config->customSession = true;
成功生成配置文件,安装下面黄字的提示操作即可
[root@zentao config]# vim /var/www/html/zentaopms/config/my.php
[root@zentao config]# cat /var/www/html/zentaopms/config/my.php
<?php
$config->installed = true;
$config->debug = false;
$config->requestType = 'GET';
$config->timezone = 'Asia/Shanghai';
$config->db->driver = 'mysql';
$config->db->host = '127.0.0.1';
$config->db->port = '3306';
$config->db->name = 'zentao';
$config->db->user = 'root';
$config->db->encoding = 'UTF8';
$config->db->password = '123456';
$config->db->prefix = 'zt_';
$config->webRoot = getWebRoot();
$config->default->lang = 'zh-cn';
按需选择功能
填入管理员账号和密码,按需填写公司名称
安装完成