GNU/Linux >> Tutoriales Linux >  >> Ubuntu

Cómo instalar DokuWiki en Ubuntu 20.04 LTS

DokuWiki es una aplicación wiki gratuita, de código abierto y muy versátil escrita en PHP. Es simple y liviano que utiliza un formato de archivo simple para almacenar sus datos, por lo que no requiere ninguna base de datos. Es conocido por su sintaxis limpia y legible y le permite escalar y optimizar fácilmente usando muchas funciones avanzadas. Puede crear sus sitios web personales o comerciales simplemente cargando su contenido en su servidor. Viene con un amplio conjunto de características que incluyen compatibilidad con WYSIWYG, controles de acceso incorporados y conectores de autenticación, un marco CSS flexible y mucho más.

En este tutorial, le mostraremos cómo instalar DokuWiki con Apache y el certificado SSL Letsencrypt en Ubuntu 20.04.

Requisitos

  • Un servidor con Ubuntu 20.04.
  • Un nombre de dominio válido apuntado con su servidor.
  • Se ha configurado una contraseña raíz en su servidor.

Actualizar los paquetes del sistema

Antes de comenzar, se recomienda actualizar los paquetes de su sistema a la última versión. Puedes hacerlo con el siguiente comando:

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

Una vez que su sistema esté actualizado, reinícielo para implementar los cambios.

Instalar Apache y PHP

DokuWiki está escrito en PHP y se ejecuta en el servidor web. Por lo tanto, deberá instalar el servidor web Apache, PHP y otras bibliotecas de PHP en su sistema. Puede instalarlos todos ejecutando el siguiente comando:

apt-get install apache2 php php-gd php-xml php-json -y

Una vez que todos los paquetes estén instalados, inicie el servicio Apache y habilítelo para que se inicie en el arranque con el siguiente comando:

systemctl start apache2
systemctl enable apache2

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

Descargar DokuWiki

Primero, vaya a la página de descarga oficial de DokuWiki y descargue la última versión de DokuWiki con el siguiente comando:

wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-rc.tgz

Una vez completada la descarga, cree un directorio DokuWiki dentro del directorio raíz web de Apache y extraiga el DokuWiki:

mkdir /var/www/html/dokuwiki
tar -xvzf dokuwiki-rc.tgz -C /var/www/html/dokuwiki/ --strip-components=1

A continuación, copie el archivo .htaccess de muestra con el siguiente comando:

cp /var/www/html/dokuwiki/.htaccess{.dist,}

A continuación, cambia la propiedad del dokuwiki a www-data:

chown -R www-data:www-data /var/www/html/dokuwiki

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

Configurar Apache para DokuWiki

A continuación, cree un archivo de configuración de host virtual de Apache para servir el sitio web de DokuWiki:

nano /etc/apache2/sites-available/dokuwiki.conf

Agregue las siguientes líneas:

<VirtualHost *:80>
        ServerName    dokuwiki.linuxbuz.com      
        DocumentRoot  /var/www/html/dokuwiki

        <Directory ~ "/var/www/html/dokuwiki/(bin/|conf/|data/|inc/)">
            <IfModule mod_authz_core.c>
                AllowOverride All
                Require all denied
            </IfModule>
            <IfModule !mod_authz_core.c>
                Order allow,deny
                Deny from all
            </IfModule>
        </Directory>

        ErrorLog   /var/log/apache2/dokuwiki_error.log
        CustomLog  /var/log/apache2/dokuwiki_access.log combined
</VirtualHost>

Guarde y cierre el archivo cuando haya terminado. Luego, habilite el sitio DokuWiki y vuelva a cargar el servicio Apache con el siguiente comando:

a2ensite dokuwiki.conf
systemctl reload apache2

En este punto, el servidor web Apache está configurado para servir al sitio DokuWiki. Ahora puede proceder a instalar Let's Encrypt SSL en su sitio web.

Asegure DokuWiki con Let's Encrypt SSL

Primero, deberá instalar el cliente Certbot en su sistema. El Certbot es un cliente fácil de usar que obtiene un certificado de Let's Encrypt, una autoridad de certificación abierta lanzada por EFF, Mozilla y otros, y lo implementa en un servidor web. Con el cliente de Certbot Let's Encrypt, puede descargar, instalar y renovar fácilmente el certificado SSL para su dominio.

Puede instalar Certbot con el siguiente comando:

apt-get install certbot python3-certbot-apache -y

Una vez que el cliente de Certbot se haya instalado correctamente, ejecute el siguiente comando para instalar Let's Encrypt SSL para su sitio web:

certbot --apache -d dokuwiki.linuxbuz.com

Se le pedirá que proporcione su correo electrónico válido y acepte el término de servicio como se muestra 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 dokuwiki.linuxbuz.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/dokuwiki-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/dokuwiki-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/dokuwiki-le-ssl.conf

A continuación, seleccione si desea o no redirigir el tráfico HTTP a HTTPS o configurar Nginx para redirigir todo el tráfico al acceso HTTPS seguro, como se muestra en el siguiente resultado:

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

Tipo 2 y pulsa Enter para iniciar el proceso. Una vez que se complete la instalación, debería obtener el siguiente resultado:

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/dokuwiki.conf to ssl vhost in /etc/apache2/sites-available/dokuwiki-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://dokuwiki.linuxbuz.com

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/dokuwiki.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/dokuwiki.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-09-05. 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"
 - 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

En este punto, tu sitio Dokuwiki está protegido con Let's Encrypt SSL. Ahora puede acceder a su sitio de forma segura utilizando el protocolo HTTPS.

Acceder a DokuWiki

Ahora, abra su navegador web y escriba la URL https://dokuwiki.linuxbuz.com/install.php. Debería ver la pantalla de instalación de DokuWiki:

Proporcione su nombre de wiki, nombre de usuario de administrador, contraseña, correo electrónico, elija su política y haga clic en Guardar botón. Será redirigido a la siguiente página:

Haz clic en "tu nuevo DokuWiki ". Debería ver la siguiente pantalla:

Haga clic en Iniciar sesión botón. Será redirigido a la pantalla de inicio de sesión de DokuWiki como se muestra a continuación:

Proporcione su nombre de usuario y contraseña de administrador y haga clic en Iniciar sesión En botón. Deberías ver el panel de DokuWiki en la siguiente pantalla:

Configuración de la renovación automática del certificado SSL de Let's Encrypt

De forma predeterminada, los certificados de Let's Encrypt tienen una validez de 90 días. Por lo tanto, deberá configurar un trabajo cron para renovar automáticamente el certificado SSL. Es seguro crear un trabajo cron que se ejecute todas las semanas o incluso todos los días.

Si desea renovar el certificado SSL manualmente, ejecute el siguiente comando:

certbot renew --dry-run

Puede configurar el trabajo cron para renovar automáticamente el certificado SSL todos los días a las 10:00 am editando el siguiente archivo:

crontab -e

Agregue la siguiente línea:

00 10 * * *   root /usr/bin/certbot renew >/dev/null 2>&1

Guarde y cierre el archivo cuando haya terminado.

Conclusión

¡Felicidades! Has instalado correctamente DokuWiki y lo has asegurado con Let's Encrypt SSL en Ubuntu 20.04. También puede ampliar su DokuWiki utilizando temas, complementos y plantillas. Siéntase libre de preguntarme si tiene alguna pregunta.


Ubuntu
  1. Cómo instalar Docker en Ubuntu 22.04/20.04 LTS

  2. Cómo instalar PlayOnLinux en Ubuntu 20.04 LTS

  3. Cómo instalar MariaDB en Ubuntu 20.04 LTS

  4. Cómo instalar Ansible en Ubuntu 20.04 LTS / 21.04

  5. Instalar Dokuwiki en Ubuntu 20.04 LTS

Cómo instalar Spotify en Ubuntu 18.04 LTS / 17.10 y Ubuntu 16.04

Cómo instalar Ubuntu Server 18.04 LTS

Cómo instalar Go en Ubuntu 22.04 LTS

Cómo instalar Go en Ubuntu 18.04 LTS

Cómo instalar Go en Ubuntu 20.04 LTS

Cómo instalar Dokuwiki en Ubuntu 20.04 LTS