Pages

Thursday 5 September 2019

Setting up a phpBB forum

phpBB is one of the more commonly used forum software packages. I used it on a Linux Fedora box, and it was fairly easy to set up.

But I wanted to move the whole thing to a Raspberry Pi, as part of my electricity economy drive. I had a Pi 2 that wasn't being used, and that has 1 gb of memory, so that was my intention.

First, I tried to set it up with Fedora. That's not what most people use on a pi, but I thought it might be easier since I was moving the phpBB from a Fedora box.

Fedora version 30 is available for the pi (and version 29). But when I set it up, I discovered that it occupies a couple of gb, and there seemed to be no way to tell it to use the whole 64gb on the SD card. It said that it did; the partition was expanded to 64gb, but the partition wasn't being fully used. It was only after I realised that, since it was using the xfs file system, you can't use fsck to fix it, you have to use the xfs equivalent, "xfs_growfs /". And that expanded it to 64gb, but really the install process should have done that for me.

And then I found that there were four processes running continuously, which meant that the loading of the pi was 4, and that was before I was running anything.

And when I installed PHP, it gave me version 7.3.8, and phpBB won't use such a recent version of PHP, and at that point I gave up on Fedora on the pi.

So, on to Raspbian, which is what most people use on the pi. I tried the latest version of Raspbian first, "Buster". That didn't work, because it also gave me a too-recent version for PHP, so I tried using the previous version , "Stretch". Whatever happened to good old-fashioned version numbers?

I had a lot of false start with that too, but I eventually got it to work. Here's hw.

First, I installed Raspbian Lite. Then:
raspi-config
apt-get update
apt-get install network-manager -y
        Then I used nmtui change ip to 10.11.0.37
        Then I edited /etc/ssh/sshd_config to allow rootlogin
reboot

Then I installed some more stuff:

apt-get -y install rdate
apt-get -y install rsync
apt-get -y install dcfldd
apt-get -y install apache2
apt-get -y install php7.0
apt-get -y install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0-xsl
apt-get -y install mysql-server
apt-get -y install libxml2-dev
apt-get -y install php-xml

Then I added a user, and edited the apache configuration, so it would run using https.
And then I copied over the ssl certificates

And now phpBB
bunzip2 phpBB-3.2.7.tar.bz2
tar -xf phpBB-3.2.7.tar
rm phpBB-3.2.7.tar

Then, as root, I created the database.
mysql
CREATE DATABASE db;
use db; 
UPDATE mysql.user SET authentication_string = PASSWORD('****') where user = 'db' AND Host = 'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'db'@'localhost' IDENTIFIED BY 'db';
exit






Then I could do the install of phpBB, which was only what really needed to be done, because I was going to copy the already-existing phpBB. So to do that, on the old forum, I did a backup. I copied the file to the raspberry, and tried to do a restore.

It didn't work.

So I tried to do a backup of the newly created database, and that worked, and I tried to restore that backup, and the restore didn't work.

Oh, great. Millions of people are using this system, and if you do a backup, you can't do a restore.

So I googled some more.

cd /home/rd/pub/phpBB3/includes/acp
acp_database.php on line 219
line 219 incorrectly tries to reference "extensions", instead of "extension"
So I edited that line, and then the restore worked.


I would estimate that doing this job took about a week, and it should have taken an hour. Partly because there are so many things that don't work as they should, and partly because there are so many things that don't work with each other.

But, I got it done in the end.

So now I can try out my new Raspberry Pi 4, which I want to use as a workstation with a 4K monitor.

No comments:

Post a Comment