• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Steps On How To Install Flarum On Ubuntu 16.04

By Abhishek Ghosh June 1, 2017 9:27 am Updated on June 1, 2017

Steps On How To Install Flarum On Ubuntu 16.04

Advertisement

Flarum is a new type of simple design discussion fora which is currently in beta version. Although beta, you can use for production purpose if you are not going to test new extensions. Here are the steps on how to install Flarum on Ubuntu 16.04 with Apache2 with required permissions, configuring SendGrid as SMTP Mail Server. We covered the parts which peoples commonly face as problems. Minimum 1 GB RAM need for practical reasons.

Steps On How To Install Flarum On Ubuntu 16-04

 

Steps On How To Install Flarum On Ubuntu 16.04 : First Create LAMP Server

 

Essentially we will build a LAMP Server with HTTP/2 support, then install Composer, then install Flarum. Skip to next sub header if you already running a LAMP or LEMP server. First update, upgrade and install Percona MySQL Server (we prefer Percona, you can use MariaDB or MySQL) :

Vim
1
2
3
4
5
6
7
8
apt update
apt upgrade
apt-get install software-properties-common python-software-properties
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install percona-server-server-5.6
mysql_secure_installation

Act accordingly to the options which will prompt you. Now login to MySQL server :

Advertisement

---

Vim
1
mysql -u root -h localhost -p

Then run the commands :

Vim
1
2
3
CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so';
CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so';
CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so';

Now we need to create a database, we are showing with root user, you should create a user in production server :

Vim
1
2
3
4
5
CREATE DATABASE flarum2017;
GRANT SELECT,DELETE,INSERT,UPDATE ON *.* TO 'root'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
SHOW DATABASES;

Now install Apache2 :

Vim
1
2
3
4
5
6
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get install apache2
a2enmod http2
sudo apt-get install curl git
git

Now we need to install PHP :

Vim
1
2
3
4
5
6
apt-get -y install php7.0 libapache2-mod-php7.0
systemctl restart apache2
apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php7.0-bcmath
systemctl restart apache2
apt-get -y install php7.0-opcache php-apcu
systemctl restart apache2

Let us perform additional steps to configure Apache2 and Let’s Encrypt :

Vim
1
2
3
4
5
6
a2enmod ssl
systemctl restart apache2
a2ensite default-ssl
systemctl restart apache2
apt-get -y install python-letsencrypt-apache
apt-get -y install python-certbot-apache

If your domain name is abhishekghosh.pro, then run this :

Vim
1
letsencrypt --apache -d abhishekghosh.pro -d www.abhishekghosh.pro

Create a cron :

Vim
1
crontab -e

Add this entry at bottom to auto renew letsencrypt :

Vim
1
0 1 * * * /usr/bin/letsencrypt renew &> /dev/null

Now, perform minimum tweaks :

Vim
1
nano /etc/apache2/mods-available/mpm_prefork.conf

Change the config in this way :

Vim
1
2
3
4
5
6
7
8
<IfModule mpm_prefork_module>
 
        StartServers              5
        MinSpareServers           20
        MaxSpareServers           40
        MaxRequestWorkers         256
        MaxConnectionsPerChild   4500
</IfModule>

Open :

Vim
1
nano /etc/php/7.0/apache2/php.ini

At minimum change few settings like these :

Vim
1
2
3
max_input_time = 30
error_reporting = E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR
error_log = /var/log/php/error.log

Activate these modules :

Vim
1
2
3
4
5
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
sudo a2enmod headers
sudo a2enmod rewrite
sudo a2enmod expires

Then run config test :

Vim
1
2
apachectl -t
sudo systemctl restart apache2.service

Vim
1
2
sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html/ -type d -exec chmod g+s {} \;

Your website should be accessible by HTTPS URL and able to process PHP.

 

Steps On How To Install Flarum On Ubuntu 16.04 : Next Install Composer

 

We need to install Composer to install, update Flarum and extensions of Flarum. If you are not used with Composer, only know that it is a tool to manage PHP dependencies and some PHP based web softwares and not going to disturb your existing running web application. Run these :

Vim
1
2
3
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

You should get Installer verified message. Now run :

Vim
1
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

If you run the command :

Vim
1
composer

You’ll understand that Composer is ready.

 

Install Flarum With Composer

 

Almost done, change directory to where you want to install Flarum, like :

Vim
1
/var/www/html

as on root with Apache2’s default FTP root or subdirectory like :

Vim
1
/var/www/html/forum

For new, fresh installation you must delete the default Apache2 file :

Vim
1
rm /var/www/html/index.html

Then run this command :

Vim
1
composer create-project flarum/flarum . --stability=beta

Create an .htaccess file :

Vim
1
nano .htaccess

Unless it is subdirectory, you possibly will need :

Vim
1
2
3
        <Directory "/var/www/html">
            AllowOverride All
        </Directory>

You should have proper permission, if /var/www/html is your location of Flarum run these :

Vim
1
2
3
4
5
6
7
8
sudo chgrp www-data /var/www/html
sudo chgrp -R www-data /var/www/html/assets
sudo chgrp -R www-data /var/www/html/extensions
sudo chgrp -R www-data /var/www/html/storage
sudo chmod 775 /var/www/html
sudo chmod -R 775 /var/www/html/assets
sudo chmod -R 775 /var/www/html/extensions
sudo chmod -R 775 /var/www/html/storage

Now, if you point towards the URL on browser, you’ll get a Web UI where you will be instructed to CHMOD some directories with more open permission. Run those commands, fill the web form with database details and run the installer script. If you are getting error, they will be out of need more liberal permission.

Ask on Flarum about your error (if any) :

Vim
1
https://discuss.flarum.org/

 

Configuring Mail Like With SendGrid

 

If you use service like SendGrid, these are correct settings :

Vim
1
2
3
4
5
6
Driver : smtp
Host : smtp.sendgrid.net
Port : 587
Encryption : tls
Username : apikey
Password :

Username will be apikey and password is your real API key copied from SendGrid account.

Tagged With install flarum ubuntu , https://thecustomizewindows com/2017/06/steps-install-flarum-ubuntu-16-04/ , installing flarum on ubuntu 16
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Steps On How To Install Flarum On Ubuntu 16.04

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • How to Install WordPress : Ubuntu 16.04, Nginx, PHP7-FPM

    Here is Step by Step Guide on How to Install WordPress on Ubuntu 16.04, Nginx, PHP7-FPM, memcached & Percona MySQL 5.7 on Cloud Server or VPS.

  • Install Elastic Stack on Ubuntu 16.04, CentOS 7 Single Cloud Server

    Here is How to Install Elastic Stack on Ubuntu 16.04, CentOS 7 on Single Cloud Server Instance For Server Log Analysis, Big Data Processing.

  • Install PHP 7.2 on Ubuntu 18.04 LTS Running Apache2, Percona MySQL

    We Will Install PHP 7.2 on Ubuntu 18.04 LTS Running Apache2, Percona MySQL. That will create a typical LAMP server setup, enough to run PHP-MySQL web applications like WordPress.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy