Tutorial-9122023

How to Install ElkArte Forum Software on Ubuntu 20.04

p1 108

How to Install ElkArte Forum Software on Ubuntu 20.04

ElkArte is a free, open-source and powerful community forum building software based on Simple Machines Forum. It is written in PHP and allows you to create a community forum fully responsive to mobile and wireless devices. It is designed to provide all the features you need for a full-featured community forum right out of the box.

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

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

Prerequisites

  • A server running Ubuntu 20.04.
  • A valid domain name pointed with your server.
  • A root password is configured on your server.

Install Apache, PHP and MariaDB

ElkArte runs on the webserver, based on the PHP and uses MariaDB as a database backend. So you will need to install the Apache, MariaDB, PHP and other PHP extensions in your server. You can install all the 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

Once all the packages are installed, open the php.ini file and tweak 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 the changes:
systemctl restart apache2

Configure MariaDB Database

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

Answer all the 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, log in to the MariaDB shell with the following command:
mysql -u root -p

After login, create a database and user for ElkArte:
MariaDB [(none)]> CREATE DATABASE elkdb;
MariaDB [(none)]> CREATE USER 'elk'@'localhost' IDENTIFIED BY 'password';

Next, grant all the privileges to the elkdb with the following command:
MariaDB [(none)]> GRANT ALL ON elkdb.* TO 'elk'@'localhost' WITH GRANT OPTION;

Next, flush the privileges and exit from the MariaDB shell with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

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

Download ElkArte

First, download the latest version of the 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

Once the download is completed, unzip the downloaded file to the Apache web root directory using the following command:
unzip ElkArte_v1-1-6_install.zip -d /var/www/html/elkarte

Next, give proper permissions to the elkarte directory using the following command:
chown -R www-data:www-data /var/www/html/elkarte/
chmod -R 755 /var/www/html/elkarte/

Once you are finished, you can proceed 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 [email protected]
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, enable the Apache virtual host and rewrite module 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 the Certbot Let’s Encrypt Client to manage the SSL for your website:
apt-get install certbot python3-certbot-apache -y

Once the 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 term 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): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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, select whether or not to redirect 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 hit Enter to finish 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 ElkArte Web Interface

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

Elkarte installer

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

Database settings

Provide your database details and click on the Continue button. You should see the Forum setting page:

Forum settings

Provide your Forum URL, Forum name and click on the Continue button. You should see the following page:

populate database

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

Create an admin account

Provide your admin username, password, email and click on the Continue button. Once the installation has been finished, you should see the following page:

Finalize installation

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

ElkArte Forum Software on Ubuntu 20.04

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 any questions.

Đăng ký liền tay Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !

Add Comment

Click here to post a comment

Đăng ký liền tay
Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !