Home / How To / How to install ElkArte Forum with Apache and let's encrypt on Debian 10

How to install ElkArte Forum with Apache and let's encrypt on Debian 10



ElkArte is a free, open source and powerful forum software that lets you create your own forum forum online. It is a simple, easy and modern forum platform based on PHP and uses MySQL / MariaDB to store its data. ElkArte comes with a wealth of features including, Messages, Likes for posts, Drafts, Auto save, Drag and drop file attachment, YouTube embedded video embedding, Email mail, Enhanced Anti Spam actions and many more.

In this tutorial we will explain how to install ElkArte on Debian 10. server.

Requirements

  • A server running Debian 10.
  • A root password is set on your server.

Getting Started

Before you begin, you must update your system with the latest version. You can do this by running the following command:

  apt-get update -y 
apt-get upgrade -y

After your server is updated, restart your server to apply the changes.

Installing Apache, MariaDB and PHP

First you need to install Apache web server, MariaDB database server, PHP and other necessary libraries on your server. You can install all of them by running the following command:

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

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

  nano / etc / php / 7.3 / apache2 / php.ini tu 1
919900900 change the following lines:

  memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America / Chicago

Save and close the file when you are done. Then restart the Apache web server with the following command:

  systemctl restart apache2 

Configuring ElkArte Database

Then you must create a database and user for ElkArte. To do so, log in to the MariaDB shell with the following command:

  mysql -u root -p 

Enter your root password when prompted to create a database and user with the following command:

  MariaDB [(none)]> CREATE DATABASE elkartedb; 
MariaDB [(none)]> CREATE USERS & # 39; elkarte & # 39; @ & # 39; localhost & # 39; IDENTIFIED OF & # 39; password & # 39 ;;

Then grant all privileges to ElkArte with the following command:

  MariaDB [(none)]> SUPPORT EVERYONE on elkartedb. * ON & # 39; elkarte & # 39; @ & # 39; localhost & # 39; WITH GRANT OPTION; 

Then flush the privileges and exit from the MariaDB shell with the following command:

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

When you're done, you can move on to the next step.

Download ElkArte

First you need to download the latest version of ElkArte from the Git repository. To download it, run the following command:

  wget https://github.com/elkarte/Elkarte/archive/master.zipebrit19659009??When the download is complete, unzip the downloaded file with the following command: [19659008] unzip master.zip 

Then move the extracted directory to the Apache root directory:

  etc. Elkarte-master / var / www / html / elkarte 

Next, change the ownership of the elkarte directory and give the necessary permissions with the following command :

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

When you're done, you can move on to next step.

Creating ElkArte Virtual Host

Next, you must create an Apache virtual host configuration file to serve ElkArte. You can create it with the following command:

  nano /etc/apache2/sites-available/elkarte.confospel19659009vardAdd the following lines: 

  
ServerAdmin [email protected]
DocumentRoot / var / www / html / elkarte
Server name example.com


Alternative FollowSymlinks
AllowOrrride All
Require everyone granted


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


Save and close the file when you are done. Then enable the virtual host file and Apache rewrite module with the following command:

  a2ensite elkarte.conf 
a2enmod rewrite

Finally, restart Apache web server to apply the changes:

  systemctl restart apache2 [194552toElkArteWebInterface

ElkArte is now installed and configured. It's time to access ElkArte's web interface.

Open your browser and type the URL http://example.com . You will be redirected to the ElkArte Welcome Page:

 ElkArte Installer

Click the Continue button. You should see the following page:

 Database Settings

Enter your database name, database user name, password and click the Continue button. You should see the following page:

 Forum Settings

Enter your forum name, forum URL and click the Continue button. You should see the following page:

 Populate database

Now click on the Continue button. You should see the administration page:

 Create an administrator account

Enter the desired administrator name, password, e-mail, database password and click on Continue . When the installation is complete, see the following page:

 End the installation

Now click on " your newly installed forum ". You should see the ElkArte dashboard on the following page:

 ElkArte Forum

Secure ElkArte with Let & # 39; s Encrypt

First you need to install Certbot on your server. Certbot is used to obtain an SSL certificate from Let & # 39; s Encrypt and configure Apache to use this certificate.

By default, the latest version of Certbot is not available in the Debian 10 standard repository. So you need to add the Certbot repository to your server.

First add the Certbot repository with the following command:

  add-apt-repository ppa: certbot / certbot 

Once the repository has been added, update the repository and install the Certbot with the following command:

  apt-get update -y 
apt-get install certbot python-certbot-apache -y

Certbot is now installed and ready to use.

Run the following command to obtain SSL certificates for your domain:

  certbot --apache -d example.com 

First, you must enter a valid email address and accept the terms of use listed below: [19659016] Saves debug log to /var/log/letsencrypt/letsencrypt.log
Selected plugins: Authenticator apache, Install apache
Enter Email Address (Used for Emergency Renewal and Security Messages) (Enter & # 39; c & # 39; to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Read the terms of use at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree to register on the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A) gree / (C) ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Should you be willing to share your email address with Electronic Frontier
Foundation, a founding partner of Let & # 39; s Encrypt project and the nonprofit
organization developing Certbot? We want to send an e-mail about our work
web encryption, EFF news, campaigns and ways to support digital freedom.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y) es / (N) o: Y
Get a new certificate
Perform the following challenges:
http-01 challenge for example.com
Activated module for rewriting Apache
Waiting for verification ...
Cleaning of challenges
Created an SSL vhost at /etc/apache2/sites-available/example.com-le-ssl.conf
Distribute certificates to VirtualHost /etc/apache2/sites-available/example.com-le-ssl.conf
Enable available site: /etc/apache2/sites-available/example.com-le-ssl.conf

Choose whether to redirect HTTP traffic to HTTPS or remove HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No Redirect - Make no further changes to the web server configuration.
2: Redirect - Makes all requests redirect to secure HTTPS access. Select this for
new websites, or if you are sure your site is working on HTTPS. You can undo this
change by editing your web server configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] and then [enter] (press & # 39; c & # 39; to cancel): 2

Then select 2 to download and install free SSL certificates for your domain. When the installation is complete. You should get the following output:

  Enabled Apache rewrite module
Redirect vhost in /etc/apache2/sites-enabled/example.com.conf to ssl vhost in / etc / apache2 / sites-available /
example.com-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have enabled https://example.com

You should test your configuration on:
https://www.ssllabs.com/ssltest/analyze.html?d=example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved to:
/etc/letsencrypt/live/example.com/fullchain.pem
Your key file has been saved to:
/etc/letsencrypt/live/example.com/privkey.pem
Your certificate expires 22/10/2019. To get a new or fine tuned
version of this certificate in the future, simply run certbot again
with the "certonly" option. Not to renew * everything * of non-interactive
your certificates, run "certbot renew"
- Your account details have been saved in your Certbot
configuration directory on / etc / letsencrypt. You should do one
secure backup of this folder now. This configuration directory is coming
also contains certificates and private keys obtained by Certbot
making regular backups of this folder is ideal.
- If you like Certbot, please consider supporting our work by:
Donate to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donate to EFF: https://eff.org/donate-le

Congratulations! your ElkArte is now secure with SSL certificates. You can now access it securely by visiting URL https://example.com .


Source link