MantisBT/CentOS7/FastCGI/Caddy
This ended up written up for use on GCP

Dependencies

Need epel-release package installed.
1
sudo yum install php php-pgsql php-mbstring php-fpm postgresql-server postgresql
Copied!

Database Server

In the trial environment I am using postgresql on the VM
1
sudo postgresql-setup initdb
2
sudo systemctl enable postgresql
3
sudo systemctl start postgresql
Copied!
Setup the postgres password
1
$ sudo passwd postgres
2
# enter new password
3
$ su - postgres
4
$ psql
5
postgres=# \password
6
# enter same password
7
postgres=# \q
8
$ exit
Copied!
As the postgres user also modify /var/lib/pgsql/data/pg_hba.conf to set md5 method for all IPv4 local connections.
1
host all all 127.0.0.1/32 md5
Copied!

Mantis Install

Grab the source
1
curl -O "https://kent.dl.sourceforge.net/project/mantisbt/mantis-stable/2.6.0/mantisbt-2.6.0.tar.gz"
Copied!
Make a /srv/www directory and extract the contents into a folder mantisbt .
1
semanage fcontext -a -t httpd_sys_content_t "/srv/www(/.*)?"
2
restorecon -R -v /srv/www
Copied!

Caddy Install

Grab the tarball
1
curl -O caddy.tar.gz "https://caddyserver.com/download/linux/amd64?license=personal"
Copied!
Follow the installation instructions in caddy/dist/init/linux-systemd at master · mholt/caddy · GitHub to enable systemd support, substituting /var/www for /srv/www .
The /etc/caddy/Caddyfile is as simple as:
1
192.168.124.20:8080
2
root /srv/www/mantisbt
3
gzip
4
fastcgi / 127.0.0.1:9000 php
5
log stdout
Copied!
Allow web server to connect to database.
1
sudo setsebool -P httpd_can_network_connect_db on
Copied!
Enable firewall rule
1
sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent
2
sudo firewall-cmd --reload
Copied!

Configure PHP-FPM

By default php-fpm is configured to use the apache user on CentOS. Caddy and the mantisbt files use www-data so update this in /etc/php-fpm.d/www.conf by changing the user and group directives.
Last modified 2yr ago