Skip to content

Instantly share code, notes, and snippets.

@howyay
Last active March 25, 2019 03:57
Show Gist options
  • Save howyay/d9da198b3ef7fd26120f30d568a4dd58 to your computer and use it in GitHub Desktop.
Save howyay/d9da198b3ef7fd26120f30d568a4dd58 to your computer and use it in GitHub Desktop.
This is an updated version to my old flarum setup guide on Ubuntu, now updated to php7.3 and removed some unrelated stuff

Flarum Setup Guide on Ubuntu 18.04 (PHP7.3)

Before we start, you have to create a non root user and switch over to that user

Then

sudo apt update && sudo apt upgrade -y

Install Apache server and MariaDB server

sudo apt install apache2 mariadb-server -y

Install PHP7.3 and some dependencies for later

sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
sudo apt update && sudo apt-get upgrade -y
sudo apt install php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-mysql php-gd php-xml php-cli php-zip php-curl wget zip unzip curl git -y

Some php configurations

/etc/php/7.3/apache2/php.ini

memory_limit = 2048M
upload_max_file_size = 150M
max_execution_time = 450
date.timezone = 

Start up and set startup entry for Apache server and MariaDB server

sudo systemctl start apache2
sudo systemctl start mariadb
sudo systemctl enable apache2
sudo systemctl enable mariadb

Setup MariaDB server

sudo mysql_secure_installation

Create a new database and a new user for Flarum

sudo mysql -u root -p
CREATE DATABASE dbname;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON dbname.* to 'username'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Install composer

cd ~
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Install Flarum

cd ~
mkdir flarum
cd flarum
composer create-project flarum/flarum . --stability=beta

Set the correct perms

sudo chown -R www-data:www-data /home/user/flarum
sudo chmod -R 777 /home/user/flarum/

Append webroot and mod_rewrite settings in Apache configuration

/etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>

DocumentRoot /home/user/flarum/public

<Directory "/home/user/flarum/public">
    AllowOverride All
    Require all granted
</Directory>

</VirtualHost>

Enable mod_rewrite and restart Apache server

sudo a2enmod rewrite
sudo systemctl restart apache2

After you install Flarum using its web interface, you can use the following command to install Bazaar

composer require flagrow/bazaar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment