Cómo instalar Automad CMS con Apache y cifrar en Debian 10
Automad es un sistema de gestión de contenidos plano, gratuito y de código abierto escrito en PHP. Es rápido, receptivo y proporciona otras funciones que el CMS basado en PHP quizás no utilice. Automad utiliza archivos de texto en lugar de bases de datos para almacenar su contenido. Automad proporciona una interfaz basada en web para administrar sitios, configuraciones del sistema, cargar imágenes y escribir publicaciones de blogs. Viene con un editor Markdown incorporado y un actualizador con un solo clic para mantener Automad actualizado.
En este tutorial, le mostraremos cómo instalar Automad CMS en Debian 10 usando el servidor web Apache.
Afirmar
- Un servidor que ejecuta Debian 10.
- Se establece una contraseña de root para su servidor.
empezando
Antes de comenzar, debe actualizar su sistema con la última versión. Puedes hacer esto ejecutando el siguiente comando:
apt-get update -y apt-get upgrade -y
Después de actualizar el servidor, reinícielo para aplicar los cambios.
Instalar Apache y PHP
Automad está basado en PHP y se ejecuta en un servidor web. Por lo tanto, necesitará instalar Apache, PHP y otros módulos necesarios en su servidor. Puedes instalarlos todos ejecutando:
apt-get install apache2 php libapache2-mod-php php-zip php-curl php-mbstring php-gd php-xml php-xmlrpc php-soap unzip -y
Una vez que todos los paquetes estén instalados, inicie el servidor web Apache y use el siguiente comando para iniciarlo al reiniciar el sistema:
systemctl start apache2 systemctl enable apache2
Cuando haya terminado, puede continuar con el siguiente paso.
Instalar Automático
Primero, debes descargar la última versión de Automad desde el repositorio de Bitbucket. Puedes descargarlo usando:
wget https://bitbucket.org/marcantondahmen/automad/get/default.zip
Una vez completada la descarga, utilice el siguiente comando para descomprimir el archivo descargado:
unzip default.zip
A continuación, mueva el directorio extraído a la raíz web de Apache usando el siguiente comando:
mv marcantondahmen-automad-c241e88edc3c /var/www/html/automad
A continuación, cambie la propiedad del directorio automatizad a www-data y otorgue los permisos apropiados usando el siguiente comando:
chown -R www-data:www-data /var/www/html/automad chmod -R 755 /var/www/html/automad
Cuando haya terminado, puede continuar con el siguiente paso.
Configurar Apache para Automat
A continuación, debe crear un archivo de configuración de host virtual Apache para el servidor Automatd. Puedes crearlo usando:
nano /etc/apache2/sites-available/automad.conf
Agregue lo siguiente:
ServerAdmin [email protected] DocumentRoot /var/www/html/automad ServerName example.com Options FollowSymlinks AllowOverride All Require all granted ErrorLog ${APACHE_LOG_DIR}/automadcms_error.log CustomLog ${APACHE_LOG_DIR}/automadcms_access.log combined
Cuando termine, guarde y cierre el archivo. Luego, use el siguiente comando para verificar si hay errores de sintaxis de Apache:
apachectl configtest
Si todo funciona, debería obtener el siguiente resultado:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message Syntax OK
A continuación, habilite el host virtual Apache y vuelva a escribir el módulo usando el siguiente comando:
a2ensite automad a2enmod rewrite
Finalmente, reinicie el servidor web Apache para aplicar los cambios de configuración:
systemctl restart apache2
Cuando haya terminado, puede continuar con el siguiente paso.
Accede automáticamente
Ahora que Automad está instalado y configurado, es hora de acceder a la interfaz web de Automad.
Abra su navegador web e ingrese la URL https://example.com. En la siguiente pantalla, será redirigido al sitio web de Automatd:
Para crear una cuenta de Automad, abra un navegador web y visite la URL https://example.com/dashboard. Serás redirigido a la siguiente página:
Ahora proporcione el nombre de usuario y la contraseña requeridos y haga clic endescargar Cuentas archivoBotón para descargar el formulario de registro de usuario y copiarlo en el directorio de configuración:
mv config.php /var/www/html/automad/config/
A continuación, otorgue los permisos apropiados al archivo config.php usando el siguiente comando:
chown -R www-data:www-data /var/www/html/automad/config/config.php
Ahora, abra un navegador web e ingrese la URL https://example.com/dashboard. Deberías ver la página de inicio de sesión de Automatd:
Ahora proporcione su nombre de usuario y contraseña y haga clicInicio sesiónEl botón. Debería ver el panel predeterminado de Automad CMS en las siguientes páginas:
Ciframos para proteger Automad
Primero, deberá instalar la herramienta Certbot para descargar e instalar "Let's Encrypt Free SSL" para su sitio web.
Primero, agregue el repositorio de Certbot usando el siguiente comando:
apt-get install software-properties-common add-apt-repository ppa:certbot/certbot
A continuación, actualice el repositorio e instale Certbot usando el siguiente comando:
apt-get update -y apt-get install certbot python-certbot-apache -y
Después de la instalación, deberá crear un directorio .well-known en el directorio letsencrypt. Puedes crearlo usando:
mkdir -p /var/lib/letsencrypt/.well-known
A continuación, deberá otorgar los permisos adecuados al directorio letencrypt. Puede utilizar los siguientes comandos:
chgrp www-data /var/lib/letsencrypt chmod g+s /var/lib/letsencrypt
A continuación, cree un archivo .conf conocido usando el siguiente comando:
nano /etc/apache2/conf-available/well-known.conf
Agregue las siguientes líneas:
Alias /.well-known/acme-challenge/ "/var/lib/letsencrypt/.well-known/acme-challenge/"AllowOverride None Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Require method GET POST OPTIONS
Guarde y cierre el archivo. Luego, habilite los módulos requeridos usando:
a2enmod ssl a2enmod http2 a2enmod headers a2enconf well-known
A continuación, reinicie el servicio Apache para aplicar todos los cambios de configuración:
systemctl restart apache2
Ahora instale "Let's Encrypt Free SSL" para su dominio ejemplo.com ejecutando el siguiente comando:
certbot --apache -d example.com
Primero, debe proporcionar una dirección de correo electrónico válida y aceptar los términos de servicio como se muestran a continuación:
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 example.com Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/example.com-le-ssl.conf Deploying Certificate to VirtualHost /etc/apache2/sites-available/example.com-le-ssl.conf Enabling available site: /etc/apache2/sites-available/example.com-le-ssl.conf 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
A continuación, seleccione la opción 2 para descargar e instalar un certificado SSL gratuito para su dominio. Después de completar con éxito la instalación. Debería obtener el siguiente resultado:
Enabled Apache rewrite module Redirecting 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 successfully enabled https://example.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/example.com/privkey.pem Your cert will expire on 2019-10-22. 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
Su Automad CMS ahora está protegido con "Let's Encrypt Free SSL". Puede acceder a él visitando la URL https://example.com.