What is MyBB?
MyBB is the free and open source forum software powering thousands of engaging, vibrant, and unique communities across the internet. - https://mybb.com/
Installation
- Log into the Linux device
- Run the following commands in a terminal:
# update software repositories
sudo apt update
# install any available software updates
sudo apt upgrade -y
# install Apache HTTPD and MySQL
sudo apt install apache2 mariadb-server mariadb-client wget zip -y
# install PHP components
sudo apt install php php-mysql php-common php-gd php-mbstring php-xml -y
# configure the MySQL database
sudo su
mysql_secure_installation - Press Enter to login as root
- Type N and press Enter to not switch to socket authentication
- Type Y and press Enter to set a root password, type the password twice to confirm
- Type Y and press Enter to remove anonymous users
- Type Y and press Enter to disallow root login remotely
- Type Y and press Enter to remove the test database
- Type Y and press Enter to reload privilege tables
- Run the following command to login into MySQL:
mysql -u root -p
- Authenticate with the root password set earlier
- Run the following commands to create the mybb database and database user
CREATE DATABASE mybb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON mybb.* TO 'mybb_rw'@'localhost' IDENTIFIED BY 'My44_rw$';
FLUSH PRIVILEGES;
EXIT;
exit - Continue with the following commands to download and extract MyBB to the webroot
# fetch the latest download URL
regex='"browser_download_url": "(https:\/\/github.com\/mybb\/mybb\/releases\/download\/[^/]*\/mybb_[^/]*\.zip)"' && response=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/mybb/mybb/releases/latest) && [[ $response =~ $regex ]] && downloadURL="${BASH_REMATCH[1]}"
# download latest mybb version
sudo wget -O /tmp/mybb.zip $downloadURL
# extract the downloaded zip archive
sudo unzip /tmp/mybb.zip -d /var/www/html
# delete the Documentation directory
sudo rm /var/www/html/Documentation -R
# rename mybb folder
sudo mv /var/www/html/Upload /var/www/html/mybb
# rename htaccess file
sudo mv /var/www/html/mybb/htaccess.txt /var/www/html/mybb/.htaccess
# set permissions
sudo chown -R www-data:www-data /var/www/html/mybb
# create a config file
sudo touch /var/www/html/mybb/inc/config.php
# make some files writable
sudo chmod 666 /var/www/html/mybb/inc/config.php /var/www/html/mybb/inc/settings.php
sudo chmod 777 /var/www/html/mybb/cache/ /var/www/html/mybb/cache/themes/ /var/www/html/mybb/uploads/ /var/www/html/mybb/uploads/avatars/ - Open a web browser and navigate to http://DNSorIP/mybb
- Click Next at the Welcome screen
- Click Next at the License Agreement
- Click Next at the Requirements Check
- Complete the Database Configuration as shown below
Database Engine: MySQL Improved
Database Server Hostname: localhost
Database Username: mybb_rw
Database Password: My44_rw$
Database Name: mybb
Table Prefix: mybb_ - Click Next after the table creation completes
- Click Next to complete the Table Population
- Click Next at the Theme Insertion screen
- Modify the Board Configuration form as needed > Click Next
- Create an administrator account by entering a Username, Password and Email Address > Click Next
- Back in the terminal, remove the /install directory with the following command
# remove the install directory
sudo rm /var/www/html/mybb/install -R - Back in the browser, navigate to http://DNSorIP/mybb/admin/index.php
- Login with the administrator username and password created earlier
- Welcome to MyBB