Phorum is a PHP and MySQL primarily based Open Supply discussion board software program. On this information, we’ll information you step-by-step by the Phorum set up course of on the Fedora 30 working system utilizing Nginx because the internet server, MariaDB because the database, and acme.sh and Let’s Encrypt for HTTPS.
Necessities
Necessities for working Phorum are:
- Nginx
- PHP model 5.2 or higher
- MySQL model 5.Zero or higher
Stipulations
- Fedora 30 working system.
- A non-root consumer with
sudo
privileges.
Preliminary steps
Verify your Fedora system model:
cat /and many others/fedora-release
# Fedora launch 30 (Thirty)
Arrange the timezone:
timedatectl list-timezones
sudo timedatectl set-timezone 'Area/Metropolis'
Replace your working system packages (software program). This is a crucial first step as a result of it ensures you may have the most recent updates and safety fixes on your working system’s default software program packages:
sudo dnf improve -y
Set up some important packages which are mandatory for fundamental administration of the Fedora working system:
sudo dnf set up -y curl wget vim git sudo unzip socat bash-completion
Step 1 – Set up PHP
Set up PHP, in addition to the mandatory PHP extensions:
sudo dnf set up -y php php-cli php-fpm php-common php-mysqlnd
To indicate PHP compiled in modules, you possibly can run:
php -mctype
curl
exif
fileinfo
. . .
. . .
Verify the PHP model:
php --version# PHP 7.3.5 (cli) (constructed: Apr 30 2019 08:37:17) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Applied sciences
Begin and allow PHP-FPM service:
sudo systemctl begin php-fpm.service
sudo systemctl allow php-fpm.service
Step 2 – Set up MariaDB and create a database
Set up MariaDB database server:
sudo dnf set up -y mariadb-server
Verify the MariaDB model:
mysql --version
# mysql Ver 15.1 Distrib 10.3.12-MariaDB, for Linux (x86_64) utilizing readline 5.1
Begin and allow MariaDB service:
sudo systemctl begin mariadb.service
sudo systemctl allow mariadb.service
Run mysql_secure set up
script to enhance MariaDB safety and set the password for MariaDB root
consumer:
sudo mysql_secure_installation
Reply every of the questions:
Would you wish to setup VALIDATE PASSWORD plugin? N
New password: your_secure_password
Re-enter new password: your_secure_password
Take away nameless customers? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Take away check database and entry to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Hook up with MariaDB shell as the basis consumer:
sudo mysql -u root -p
# Enter password
Create an empty MariaDB database and consumer for Phorum and bear in mind the credentials:
mysql> CREATE DATABASE dbname;
mysql> GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
Exit from MariaDB:
mysql> exit
Exchange dbname
, username
and password
with your individual names.
Step 3 – Set up acme.sh
consumer and procure Let’s Encrypt certificates (non-compulsory)
Securing your discussion board with HTTPS shouldn’t be mandatory, however it’s a good apply to safe your web site visitors. So as to get hold of TLS certificates from Let’s Encrypt we’ll use acme.sh consumer. Acme.sh is a pure UNIX shell software program for acquiring TLS certificates from Let’s Encrypt with zero dependencies.
Obtain and set up acme.sh:
sudo su - root
git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install --accountemail [email protected]
supply ~/.bashrc
cd ~
Verify acme.sh model:
acme.sh --version
# v2.8.0
Receive RSA and ECC/ECDSA certificates on your area/hostname:
# RSA 2048
acme.sh --issue --standalone -d instance.com --keylength 2048
# ECDSA
acme.sh --issue --standalone -d instance.com --keylength ec-256
If you would like faux certificates for testing you possibly can add --staging
flag to the above instructions.
After working the above instructions, your certificates and keys might be in:
- For RSA:
/dwelling/username/instance.com
listing. - For ECC/ECDSA:
/dwelling/username/instance.com_ecc
listing.
To checklist your issued certs you possibly can run:
acme.sh --list
Create a listing to retailer your certs. We are going to use /and many others/letsencrypt
listing.
mkdir -p /and many others/letsecnrypt/instance.com
sudo mkdir -p /and many others/letsencrypt/instance.com_ecc
Set up/copy certificates to /and many others/letsencrypt listing.
# RSA
acme.sh --install-cert -d instance.com --cert-file /and many others/letsencrypt/instance.com/cert.pem --key-file /and many others/letsencrypt/instance.com/personal.key --fullchain-file /and many others/letsencrypt/instance.com/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"
# ECC/ECDSA
acme.sh --install-cert -d instance.com --ecc --cert-file /and many others/letsencrypt/instance.com_ecc/cert.pem --key-file /and many others/letsencrypt/instance.com_ecc/personal.key --fullchain-file /and many others/letsencrypt/instance.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"
All of the certificates might be mechanically renewed each 60 days.
After acquiring certs exit from root consumer and return again to regular sudo consumer:
exit
Step 4 – Set up and configure NGINX
Set up NGINX:
sudo dnf set up -y nginx
Verify the NGINX model:
nginx -v
# nginx model: nginx/1.16.0
Begin and allow NGINX service:
sudo systemctl begin nginx.service
sudo systemctl allow nginx.service
Configure NGINX for Phorum. Run sudo vim /and many others/nginx/conf.d/phorum.conf
and add the next configuration.
server {
hear 80;
hear 443 ssl;
server_name instance.com;
root /var/www/phorum;
ssl_certificate /and many others/letsencrypt/instance.com/fullchain.pem;
ssl_certificate_key /and many others/letsencrypt/instance.com/personal.key;
ssl_certificate /and many others/letsencrypt/instance.com_ecc/fullchain.pem;
ssl_certificate_key /and many others/letsencrypt/instance.com_ecc/personal.key;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php$ {
embody default.d/php.conf;
try_files $uri $uri/ /index.php?$query_string;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
embody fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Verify NGINX configuration for syntax errors:
sudo nginx -t
Reload NGINX service:
sudo systemctl reload nginx.service
Step 4 – Set up Phorum
Create a doc root listing for Phorum:
sudo mkdir -p /var/www/phorum
Change possession of the /var/www/phorum
listing to [jour_user]:
sudo chown -R [your_user]:[your_user] /var/www/phorum
Navigate to the doc root listing:
cd /var/www/phorum
Obtain the most recent steady Phorum distribution from the official web site:
wget https://www.phorum.org/downloads/phorum-5.2.23.tar.gz
Unpack the downloaded archive and transfer information to the doc root:
tar xvzf phorum-5.2.23.tar.gz
rm phorum-5.2.23.tar.gz
mv Core-phorum_5_2_23/* . && mv Core-phorum_5_2_23/.* .
rmdir Core-phorum_5_2_23
Configure the database entry:
cp embody/db/config.php.pattern embody/db/config.php
Configure database settings by modifying embody/db/config.php
file:
vim embody/db/config.php
Change possession of the /var/www/craft
listing to nginx:
sudo chown -R nginx:nginx /var/www/phorum
Run sudo vim /and many others/php-fpm.d/www.conf
and set the consumer and group to nginx
. Initially, they are going to be set to apache:
sudo vim /and many others/php-fpm.d/www.conf
# consumer = nginx
# group = nginx
To complete the set up, run the web-based installer by visiting http://forum.example.com/admin.php
in your internet browser.
Comments