Linux

How to Install the ElkArte Forum Software on Ubuntu 20.04

How to Install the ElkArte Forum Software on Ubuntu 20.04

ElkArte is a free, open source, and powerful community development software forum based on the Simple Machines Forum. This is written in PHP and allows you to create fully responsive community forums for mobile and wireless devices. This is designed to provide all the features you need for a full featured community forum.

ElkArte is the right choice for you if you are looking for a simple and direct forum platform that is easy to customize.

In this tutorial, we will show you how to install ElkArte with Let’s Encrypt SSL on Ubuntu 20.04.

Precondition

  • Server running Ubuntu 20.04.
  • A valid domain name is shown to your server.
  • The root password is configured on your server.

Install Apache, PHP and MariaDB

ElkArte runs on a web server, based on PHP and uses MariaDB as a database backend. So, you need to install Apache, MariaDB, PHP and other PHP extensions on your server. You can install all packages with the following command:

apt-get install apache2 mariadb-server php7.4 libapache2-mod-php7.4 php7.4-common php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-mysql php7.4-gd php7.4-pgsql php7.4-xml php7.4-cli php7.4-imagick php7.4-bcmath php7.4-gmp php7.4-zip unzip -y

After all packages are installed, open the php.ini file and adjust some useful settings:

nano /etc/php/7.4/apache2/php.ini
Change the following lines:
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = Asia/Kolkata

Save and close the file then restart the Apache service to apply changes:

systemctl restart apache2

Configure the MariaDB Database

First, secure the MariaDB installation and set the MariaDB root password with the following command:

mysql_secure_installation

Answer all questions as shown below:

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Next, enter the MariaDB shell with the following command:

mysql -u root -p

After logging in, create a database and users for ElkArte:

MariaDB [(none)]> CREATE DATABASE elkdb;
MariaDB [(none)]> CREATE USER 'elk'@'localhost' IDENTIFIED BY 'password';

Next, give all privileges to elkdb with the following command:

MariaDB [(none)]> GRANT ALL ON elkdb.* TO 'elk'@'localhost' WITH GRANT OPTION;

Next, flush privileges and exit the MariaDB shell with the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

After the database is configured, you can proceed to the next step.

Download ElkArte

First, download the latest version of ElkArte from the Git repository using the following command:

wget https://github.com/elkarte/Elkarte/releases/download/v1.1.6/ElkArte_v1-1-6_install.zip

After the download is complete, unzip the file downloaded to the Apache web directory using the following command:

unzip ElkArte_v1-1-6_install.zip -d /var/www/html/elkarte

Next, give the appropriate permissions to the directory using the following command:

chown -R www-data:www-data /var/www/html/elkarte/
chmod -R 755 /var/www/html/elkarte/

After completion, you can continue to the next step.

Configure Apache for ElkArte

Next, create a new Apache virtual host configuration file for ElkArte.

nano /etc/apache2/sites-available/elkarte.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin admin@example.com
     ServerName elk.linuxbuz.com
     DocumentRoot /var/www/html/elkarte

     <Directory /var/www/html/elkarte/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
    
</VirtualHost>

Save and close the file when you are finished. Then, activate the virtual host module and rewrite Apache with the following command:

a2ensite elkarte.conf
a2enmod rewrite

Finally, restart the Apache service to implement the changes.

systemctl restart apache2

Secure ElkArte with Let’s Encrypt SSL

First, install Certbot Let’s Encrypt Client to manage SSL for your website:

apt-get install certbot python3-certbot-apache -y

After Certbot is installed, run the following command to download and install Let’s Encrypt SSL for your website:

certbot --apache -d elk.linuxbuz.com

You will be asked to provide your email address and accept the terms of service as shown below:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): hitjethva@gmail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for elk.linuxbuz.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/elk-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/elk-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/elk-le-ssl.conf

Next, choose whether to direct HTTP traffic to HTTPS as shown below:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Type 2 and press Enter to complete the installation as shown below.

Redirecting vhost in /etc/apache2/sites-enabled/elk.conf to ssl vhost in /etc/apache2/sites-available/elk-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://elk.linuxbuz.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=elk.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/elk.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/elk.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-08-19. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

At this point, your ElkArte is secured with Let’s Encrypt SSL.

Access the ElkArte Web Interface

Now, open your web browser and type the URL https://elk.linuxbuz.com. You will be directed to the ElkArte welcome page:

1

Click on the Continue button. You will see the database server settings page:

2

Provide your database details and click the Continue button. You will see the Forum settings page:

3

Give your Forum URL, Forum name and click the Continue button. You will see the following page:

4

Click on the Continue button. You will see the Admin account creation page:

5

Provide the admin username, password, e-mail, and click the Continue button. After the installation is complete, you will see the following page:

6

Click on your newly installed forum. You will see the ElkArte dashboard on the following page:

7

Conclusion

Congratulations! You have successfully installed ElkArte with Apache and Let’s Encrypt SSL on Ubuntu 20.04. You can now easily host your own community forum with ElkArte. Feel free to ask me if you have questions.

Related posts

How to Install the Open Source Computer Vision Library (OpenCV) on CentOS 8

Linux

How to Install Python on a Mac

Apple

How to create files in Python and more

Linux

How to Manage Nginx Server Blocks on Ubuntu 20.04

Linux

How to Activate Dark Mode on Ubuntu 20.04 LTS

Howto

How to integrate the ONLYOFFICE editor with the Nuxeo Platform

Linux

How to Install Docker on Ubuntu 20.04

Linux

How to open CSV files in Python – save and retrieve large data sets

Linux

How to Install R on Ubuntu 20.04

Linux