GNU/Linux >> Tutoriales Linux >  >> Cent OS

Cómo instalar ElkArte Forum con Apache y Lets Encrypt SSL en CentOS 8

ElkArte es un software de foro gratuito y de código abierto basado en Simple Machine Forum. Está escrito en PHP y utiliza MariaDB como base de datos. Proporciona todas las funciones necesarias para crear un foro comunitario con todas las funciones. Es simple, liviano y utiliza temas receptivos que son adecuados para cualquier navegador, teléfono inteligente o tableta modernos.

Características

  • Interfaz simple y fácil de usar
  • Gestor de complementos integrado y personalizable
  • Funcionalidad antispam mejorada
  • Arrastrar y soltar archivos adjuntos
  • Incrustación de video integrada para youtube, vimeo y dailymotion

En este tutorial, le mostraremos cómo instalar ElkArte con Let's Encrypt SSL en CentOS 8.

Requisitos

  • Un servidor que ejecuta CentOS 8.
  • Un nombre de dominio válido apuntado con la IP de su servidor.
  • Se configura una contraseña de root en el servidor.

Instalar servidor LAMP

Primero, deberá instalar Apache, MariaDB, PHP y otras extensiones en su sistema. Puede instalarlos todos ejecutando el siguiente comando:

dnf install httpd mariadb-server php php-common php-json php-curl php-intl php-mbstring php-xmlrpc php-mysqlnd php-gd php-pgsql php-xml php-cli php-bcmath php-gmp php-zip unzip -y

Una vez que todos los paquetes estén instalados, edite el archivo php.ini y realice algunos cambios deseados:

nano /etc/php.ini

Cambie los siguientes valores:

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

Guarde y cierre el archivo, luego inicie el servicio Apache y MariaDB y habilítelos para que se inicien al reiniciar el sistema con el siguiente comando:

systemctl start httpd
systemctl start mariadb
systemctl enable httpd
systemctl enable mariadb

Una vez que haya terminado, puede continuar con el siguiente paso.

Configurar MariaDB

De forma predeterminada, la contraseña raíz de MariaDB no está configurada. Por lo tanto, deberá configurarlo en su sistema. Puede hacerlo ejecutando el siguiente script:

mysql_secure_installation

Responda todas las preguntas como se muestra a continuación para establecer la contraseña de root:

Enter current password for root (enter for none):
OK, successfully used password, moving on...
Set root password? [Y/n] Y
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

Una vez que MariaDB esté protegida, inicie sesión en el shell de MariaDB con el siguiente comando:

mysql -u root -p

Proporcione su contraseña raíz cuando se le solicite, luego cree una base de datos y un usuario con el siguiente comando:

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

A continuación, otorga todos los privilegios a la base de datos de ElkArte con el siguiente comando:

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

A continuación, elimine los privilegios y salga del shell de MariaDB con el siguiente comando:

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

Una vez que haya terminado, puede continuar con el siguiente paso.

Descargar ElkArte

Primero, deberá descargar la última versión de ElkArte desde el repositorio de Git. Puedes descargarlo con el siguiente comando:

wget https://github.com/elkarte/Elkarte/archive/master.zip

Una vez descargado, descomprima el archivo descargado con el siguiente comando:

unzip master.zip

A continuación, mueva el directorio extraído al directorio raíz de Apache con el siguiente comando:

mv Elkarte-master /var/www/html/elkarte

A continuación, cambie la propiedad y los permisos con el siguiente comando:

chown -R apache:apache /var/www/html/elkarte
chmod -R 775 /var/www/html/elkarte

Una vez que haya terminado, puede continuar con el siguiente paso.

Configurar Apache para ElkArte

A continuación, deberá crear un archivo de configuración de host virtual apache para ElkArte. Puedes crearlo con el siguiente comando:

nano /etc/httpd/conf.d/elkarte.conf

Agregue las siguientes líneas:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/elkarte
     ServerName elk.example.com

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

     ErrorLog /var/log/httpd/error.log
     CustomLog /var/log/httpd//access.log combined

</VirtualHost>
systemctl restart httpd

En este punto, el servidor web Apache está configurado para servir a ElkArte. Ahora puede continuar con el siguiente paso.

Configurar Selinux y Firewall

De manera predeterminada, SELinux está habilitado en CentOS 8. Por lo tanto, deberá configurarlo para su sitio web ElkArte.

Puede configurar SELinux con el siguiente comando:

setsebool httpd_can_network_connect on -P
chcon -R -u system_u -t httpd_sys_rw_content_t -r object_r /var/www/html/elkarte

Luego, permita el puerto 80 y 443 a través del firewall con el siguiente comando:

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Una vez que haya terminado, puede continuar con el siguiente paso.

Acceso a ElkArte

Ahora, abra su navegador web y acceda a ElkArte usando la URL http://elk.example.com . Será redirigido a la siguiente página:

Haga clic en Continuar botón para iniciar la instalación. Debería ver la siguiente página:

Proporcione los detalles de su base de datos y haga clic en Continuar botón. Debería ver la siguiente página:

Proporcione el nombre de su foro, URL y haga clic en Continuar botón. Debería ver la siguiente página:

Ahora, haga clic en Continuar botón para llenar la base de datos. Debería ver la siguiente página:

Proporcione su nombre de usuario, contraseña y correo electrónico de administrador y haga clic en Continuar botón. Debería ver la siguiente página:

Haga clic en su foro recién instalado botón. Debería ver la siguiente página:

Proporcione su nombre de usuario y contraseña de administrador y haga clic en Iniciar sesión en botón. Deberías ver el tablero de ElkArte en la siguiente página:

Asegure Elkarte con Let's Encrypt SSL

En este punto, ElkArte está instalado y configurado. A continuación, se recomienda asegurar su sitio ElkArte con Let's Encrypt SSL. Primero, deberá instalar el cliente Certbot en su sistema. El Certbot es un cliente de Let's Encrypt que se puede usar para descargar el SSL del sitio web de Let's Encrypt y configurar el servidor web Apache para usar el SSL descargado.

Puede instalar Certbot con el siguiente comando:

wget https://dl.eff.org/certbot-auto
mv certbot-auto /usr/local/bin/certbot-auto
chown root /usr/local/bin/certbot-auto
chmod 0755 /usr/local/bin/certbot-auto

Ahora, ejecute el siguiente comando para obtener e instalar un certificado SSL para su sitio web ElkArte.

certbot-auto --apache -d elk.example.com

El comando anterior instalará primero todas las dependencias requeridas en su servidor. Una vez instalado, se le pedirá que proporcione una dirección de correo electrónico y acepte el término del servicio como se muestra a continuación:

Nota:si tiene algún error relacionado con SSL, reinicie el servicio httpd y ejecute el comando anterior nuevamente.

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.example.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/httpd/conf.d/elkarte-le-ssl.conf
Deploying Certificate to VirtualHost /etc/httpd/conf.d/elkarte-le-ssl.conf

A continuación, elija si desea redirigir o no el tráfico HTTP a HTTPS, eliminando el acceso HTTP.

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

Escriba 2 y presione Entrar para iniciar el proceso de instalación. Una vez que la instalación se haya completado con éxito, debería obtener el siguiente resultado:

Redirecting vhost in /etc/httpd/conf.d/elkarte.conf to ssl vhost in /etc/httpd/conf.d/elkarte-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/elk.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/elk.example.com/privkey.pem
   Your cert will expire on 2020-05-10. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again with the "certonly" option. To non-interactively renew *all*
   of your certificates, run "certbot-auto 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

Ahora puede acceder a su ElkArte de forma segura usando la URL https://elk.example.com.

Conclusión

¡Felicidades! Ha instalado correctamente ElkArte con Apache y Let's Encrypt SSL en CentOS 8. Ahora puede comenzar a crear su propio foro en línea. Siéntase libre de preguntarme si tiene alguna pregunta.


Cent OS
  1. Cómo instalar WonderCMS con Nginx y Lets Encrypt SSL en CentOS 7

  2. Cómo instalar WordPress con Nginx y Lets Encrypt SSL en CentOS 8

  3. Cómo instalar ElkArte Forum con Apache y Lets Encrypt en Debian 10

  4. Cómo instalar DokuWiki con Nginx y Lets encrypt SSL en CentOS 8

  5. Cómo instalar Flarum Forum con Nginx y LE SSL en CentOS 8

Cómo instalar Drupal con Apache y Lets Encrypt SSL en Debian 11

Instale TaskBoard con Apache y permita Encrypt SSL en Debian 11

Cómo instalar SuiteCRM con Apache y Lets Encrypt SSL gratuito en Debian 11

Cómo instalar InvoicePlane con Apache y el certificado SSL gratuito Lets Encrypt en Debian 11

Cómo instalar Lighttpd con PHP, MariaDB y Lets Encrypt SSL en Debian 10

Cómo instalar Let's Encrypt SSL con Apache en CentOS 7