0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CentOS Stram 9 に TestLink を導入

Posted at

特に意味は無いが、CentOS Stream 9 に TestLink の導入を試みてみる。

導入先OSのバージョン

$ uname -r
5.14.0-319.el9.x86_64
$ cat /etc/redhat-release 
CentOS Stream release 9

動かすTestLinkのソース

TestLink と httpの導入

$ sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
$ sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
$ sudo dnf install -y httpd git php82
$ sudo firewall-cmd --permanent --add-service=http
$ sudo systemctl start httpd
$ sudo systemctl start php82-php-fpm
$ sudo dnf install -y git
$ sudo git clone it clone https://github.com/TestLinkOpenSourceTRMS/testlink-code.git -b 2.0.0-20220827-PHP8.1 /var/www/html/testlink

ブラウザでアクセス

http://localhost/testlink/

スクリーンショット 2023-10-21 22.33.18.png
「New Installation」を選択
スクリーンショット 2023-10-21 22.34.32.png
「I agree to〜」をチェックし「Continue」を押下。
スクリーンショット 2023-10-21 22.36.56.png
スクリーンショット 2023-10-21 22.39.05.png
いくつかエラーが出て次に進めず。

Read/write permissionsについて解消していく

  • /var/www/html/testlink/gui/templates_c directory パーミッションを設定する必要がありそう。
  • /var/testlink/logs/ directory ディレクトリを作成する必要がありそう。
  • /var/testlink/upload_area/ ディレクトリを作成する必要がありそう。
$ sudo chown -R apache:apache /var/www/html/testlink
$ sudo /usr/sbin/semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/testlink/gui/templates_c
$ sudo /sbin/restorecon -R /var/www/html/testlink/gui/templates_c

DBの導入

  • MySQL/Mariadb/PostgresqlいずれかのDBが必要そう
$ yum install -y postgresql-server
$ postgresql-setup initdb
$ systemctl start postgresql
$ yum install -y php82-php-pgsql

再度チェック画面

スクリーンショット 2023-10-21 23.13.59.png
スクリーンショット 2023-10-21 23.14.38.png

DB接続で何かエラーが発生

スクリーンショット 2023-10-21 23.15.22.png

selinux関連のエラー?

type=AVC msg=audit(1697897966.028:124): avc:  denied  { name_connect } for  pid=2887 comm="php-fpm" dest=5432 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:postgresql_port_t:s0 tclass=tcp_socket permissive=0
type=SYSCALL msg=audit(1697897966.028:124): arch=c000003e syscall=42 success=no exit=-13 a0=7 a1=5650e11b4630 a2=1c a3=7ffecfae3320 items=0 ppid=2885 pid=2887 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="php-fpm" exe="/opt/remi/php82/root/usr/sbin/php-fpm" subj=system_u:system_r:httpd_t:s0 key=(null)ARCH=x86_64 SYSCALL=connect AUID="unset" UID="apache" GID="apache" EUID="apache" SUID="apache" FSUID="apache" EGID="apache" SGID="apache" FSGID="apache"
type=PROCTITLE msg=audit(1697897966.028:124): proctitle=7068702D66706D3A20706F6F6C20777777
type=AVC msg=audit(1697897966.028:125): avc:  denied  { name_connect } for  pid=2887 comm="php-fpm" dest=5432 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:postgresql_port_t:s0 tclass=tcp_socket permissive=0
type=SYSCALL msg=audit(1697897966.028:125): arch=c000003e syscall=42 success=no exit=-13 a0=7 a1=5650e110feb0 a2=10 a3=7ffecfae3320 items=0 ppid=2885 pid=2887 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="php-fpm" exe="/opt/remi/php82/root/usr/sbin/php-fpm" subj=system_u:system_r:httpd_t:s0 key=(null)ARCH=x86_64 SYSCALL=connect AUID="unset" UID="apache" GID="apache" EUID="apache" SUID="apache" FSUID="apache" EGID="apache" SGID="apache" FSGID="apache"
type=PROCTITLE msg=audit(1697897966.028:125): proctitle=7068702D66706D3A20706F6F6C20777777
$ getsebool -a | grep "httpd_can_network_connect "
httpd_can_network_connect --> off
$ setsebool -P httpd_can_network_connect 1
$ getsebool -a | grep "httpd_can_network_connect "
httpd_can_network_connect --> on

/var/log/audit/audit.logのエラー出力は無くなったが、画面のFailedは変わらず。

$ tail -f /var/lib/pgsql/data/log/postgresql-Sat.log 
2023-10-21 23:39:01.362 JST [3258] LOG:  アドレス"::1"、ポート113のIdentサーバに接続できませんでした: 接続を拒否されました
2023-10-21 23:39:01.362 JST [3258] FATAL:  ユーザ"root"のIdent認証に失敗しました
2023-10-21 23:39:01.362 JST [3258] 詳細:  接続はpg_hba.confの行88に一致しました: "host    all             all             ::1/128                 ident"
^C

idnet認証からpassword認証に変更

#/var/lib/pgsql/data/pg_hba.conf
host    all             all             ::1/128                 ident
↓
host    all             all             ::1/128                 password
$ sudo systemctl restart postgres

色々と調べてみたが結局うまくいかず。

php81に入れ替えても同様。以下のURLでもうまくいかないスレッドを見つけた。php/postgresのバージョンがサポートされていないということなのだろうか。スレッドにはPHP8がまだサポートされないと記載がある。1.9.20はPHP8をサポートしないが、今回のブランチはPHP8.1で動作するのかと思ったが違うのか。postgresは一度諦めてMySQLかMariaDBで導入を続けてみる。

  • PHP Version 8.2.11
  • postgresql-server-13.11-1.el9.x86_64
  • 2.0.0-20220827-PHP8.1

# /var/opt/remi/php81/log/php-fpm/www-error.log 
[22-Oct-2023 19:09:34 UTC] PHP Fatal error:  Uncaught TypeError: pg_close(): Argument #1 ($connection) must be of type ?PgSql\Connection, bool given in /var/www/html/testlink/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php:903
Stack trace:
#0 /var/www/html/testlink/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php(903): pg_close()
#1 /var/www/html/testlink/vendor/adodb/adodb-php/adodb.inc.php(2901): ADODB_postgres64->_close()
#2 /var/www/html/testlink/lib/functions/database.class.php(490): ADOConnection->Close()
#3 /var/www/html/testlink/install/installNewDB.php(240): database->close()
#4 {main}
  thrown in /var/www/html/testlink/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php on line 903

スクリーンショット 2023-10-23 4.18.52.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?