Tutorial

How to Install ElkArte Forum Software on Ubuntu 22.04

ElkArte is a free and open-source forum software written in PHP language. It is based on the Simple Machines Forum, which helps you create a community forum easily. It has grown to become a modern and feature-rich forum package to meet the demands of today’s message board users. It offers a wide range of Themes and Addons created by the community that helps you to extend the ElkArte functionality.

This tutorial will show you how to install ElkArte on Ubuntu 22.04 with Let’s Encrypt SSL.Ezoic

Prerequisites

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

Install Apache, PHP, and MariaDB

ElkArte runs on the web server 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 on your server.

First, install the Apache and MariaDB server with the following command:

apt install apache2 mariadb-server

Next, you will need to install PHP version 7.4 and other required extensions on your server. By default, Ubuntu 22.04 ships with PHP version 8.1 in its default repository. So you will need to install the Ondrej PHP repository to your server.

apt install software-properties-common -y
add-apt-repository ppa:ondrej/php -y

Once the PHP repository is added to your server, you can install PHP with the following command:

apt install 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 change the default settings:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

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:Ezoic

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:Ezoic

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.8/ElkArte_v1-1-8_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-8_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.AdvertisementEzoic

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

You can also check the Apache status with the following command:

systemctl status apache2

You will get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-09-11 13:35:46 UTC; 9s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 30485 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 30490 (apache2)
      Tasks: 6 (limit: 4579)
     Memory: 14.9M
        CPU: 90ms
     CGroup: /system.slice/apache2.service
             ??30490 /usr/sbin/apache2 -k start
             ??30549 /usr/sbin/apache2 -k start
             ??30550 /usr/sbin/apache2 -k start
             ??30551 /usr/sbin/apache2 -k start
             ??30552 /usr/sbin/apache2 -k start
             ??30553 /usr/sbin/apache2 -k start

Sep 11 13:35:46 ubuntu2204 systemd[1]: Starting The Apache HTTP Server...

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:

congdonglinux elkarte 1

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

congdonglinux elkarte 2

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

congdonglinux elkarte 3

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

congdonglinux elkarte 4

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

congdonglinux elkarte 5

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

congdonglinux elkarte 6

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

congdonglinux elkarte 7

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.

Conclusion

Congratulations! you have successfully installed ElkArte with Let’s Encrypt SSL on Ubuntu 22.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ý !

Tags

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ý !