Cómo instalar FileRun en Debian 11

3 feb 2022 7 min di lettura
Cómo instalar FileRun en Debian 11
Indice dei contenuti

Introducción

FileRun es una aplicación gratuita, de código abierto y autohospedada para compartir archivos para Linux. Es una gran alternativa a Google Drive y Dropbox. Le permite compartir y sincronizar archivos, acceder a través de WebDAV e incluso conectarse con la aplicación móvil Nextcloud. Está escrito en PHP y utiliza MariaDB como base de datos. Le permite acceder a sus archivos en cualquier lugar a través del almacenamiento seguro en la nube y también ofrece copias de seguridad y uso compartido de fotos, videos, archivos y más.

En este artículo explicaré cómo instalar FileRun con Apache y Let's Encrypt SSL en Debian 11.

Si desea instalar FileRun en un servidor remoto, continúe leyendo; de lo contrario, omita el primer párrafo "Conexión al servidor" y lea el siguiente.

Conexión al servidor

Para acceder al servidor, necesita conocer la dirección IP. También necesitará su nombre de usuario y contraseña para la autenticación. Para conectarse al servidor como root, escriba el siguiente comando:

ssh root@IP_DEL_SERVER

A continuación, deberá ingresar la contraseña del usuario root.

Si no está utilizando el usuario root, puede iniciar sesión con otro nombre de usuario utilizando el mismo comando, luego cambie root a su nombre de usuario :

ssh nome_utente@IP_DEL_SERVER

Luego se le pedirá que ingrese su contraseña de usuario.

El puerto estándar para conectarse a través de ssh es 22 , si su servidor usa un puerto diferente, deberá especificarlo usando el parámetro -p , luego escriba el siguiente comando:

ssh nome_utente@IP_DEL_SERVER -p PORTA

Requisitos previos

  • Un servidor que ejecuta Debian 11.
  • Un nombre de dominio válido apunta a la IP de su servidor.
  • Una contraseña de root está configurada en el servidor.

Instalar el servidor LAMP

Primero, deberá instalar Apache, MariaDB, PHP y otros paquetes en su servidor. Puede instalarlos todos ejecutando el siguiente comando:

apt-get install apache2 mariadb-server mariadb-client php libapache2-mod-php imagemagick ffmpeg php-imagick php-mysql php-fpm php-common php-gd php-json php-curl php-zip php-xml php-mbstring php-bz2 php-intl unzip -y

Una vez que todos los paquetes estén instalados, también deberá instalar el cargador IonCube en su sistema.

Primero, descargue el cargador IonCube con el siguiente comando:

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Una vez que se complete la descarga, extraiga el archivo descargado con el siguiente comando:

tar -xzf ioncube_loaders_lin_x86-64.tar.gz -C /usr/lib/php

Luego, cree un archivo de configuración de ioncube y defina la ruta de la fuente de IonCube:

nano /etc/php/7.4/apache2/conf.d/00-ioncube.ini

Agregue la siguiente línea:

zend_extension = /usr/lib/php/ioncube/ioncube_loader_lin_7.4.so

Guarde y cierre el archivo, luego cree un archivo de configuración de PHP para FileRun:

nano /etc/php/7.4/apache2/conf.d/filerun.ini

Agregue la siguiente configuración:

expose_php = Off
error_reporting = E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
ignore_repeated_errors = Off
allow_url_fopen = On
allow_url_include = Off
variables_order = "GPCS"
allow_webdav_methods = On
memory_limit = 128M
max_execution_time = 300
output_buffering = Off
output_handler = ""
zlib.output_compression = Off
zlib.output_handler = ""
safe_mode = Off
register_globals = Off
magic_quotes_gpc = Off
upload_max_filesize = 20M
post_max_size = 20M
enable_dl = Off
disable_functions = ""
disable_classes = ""
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_httponly = 1
date.timezone = "UTC"

Guarde y cierre el archivo, luego reinicie el servicio Apache para aplicar los cambios:

systemctl reload apache2

Configurar la base de datos MariaDB

Primero, deberá asegurar la instalación de MariaDB usando el siguiente comando:

mysql_secure_installation

Responda todas las preguntas como se muestra a continuación:

Enter current password for root (enter for none):  PRESS ENTER
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 

Luego, inicie sesión en el shell de MariaDB con el siguiente comando:

mysql -u root -p

Una vez que haya iniciado sesión, cree una base de datos y un usuario con el siguiente comando:

CREATE DATABASE filerun;
GRANT ALL PRIVILEGES ON filerun.* TO 'filerun'@'localhost';

Luego, otorgue todos los privilegios a la base de datos FileRun con el siguiente comando:

GRANT ALL PRIVILEGES ON filerun.* TO 'filerun'@'localhost';

Luego, borre los privilegios y salga de MariaDB con el siguiente comando:

FLUSH PRIVILEGES;
EXIT;

Una vez hecho esto, puede continuar con el siguiente paso.

Descargar FileRun

Primero, descargue la última versión de FileRun con el siguiente comando:

wget -O FileRun.zip https://filerun.com/download-latest

Una vez que se descarga FileRun, descomprima el archivo descargado usando el siguiente comando:

unzip FileRun.zip -d /var/www/html/filerun/

Luego, establezca el permiso y la propiedad apropiados con el siguiente comando:

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

Una vez hecho esto, puede continuar con el siguiente paso.

Configurar Apache para FileRun

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

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

Agregue las siguientes líneas:

<VirtualHost *:80>
        ServerName filerun.example.com

        DocumentRoot /var/www/html/filerun

        <Directory "/var/www/html/filerun">
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/filerun.error.log
        CustomLog ${APACHE_LOG_DIR}/filerun.access.log combined
</VirtualHost>

Guarde y cierre el archivo, luego active el host virtual de Apache y vuelva a escribir el módulo con el siguiente comando:

a2ensite filerun.conf
a2enmod rewrite

Luego, reinicie el servicio de Apache para aplicar los cambios:

systemctl restart apache2

También puede verificar el estado de Apache con el siguiente comando:

systemctl status apache2

Debería ver el siguiente resultado:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-01-29 15:14:56 UTC; 5s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 22533 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 22538 (apache2)
      Tasks: 6 (limit: 2341)
     Memory: 16.4M
        CPU: 94ms
     CGroup: /system.slice/apache2.service
             ??22538 /usr/sbin/apache2 -k start
             ??22539 /usr/sbin/apache2 -k start
             ??22540 /usr/sbin/apache2 -k start
             ??22541 /usr/sbin/apache2 -k start
             ??22542 /usr/sbin/apache2 -k start
             ??22543 /usr/sbin/apache2 -k start

Jan 29 15:14:56 debian11 systemd[1]: Starting The Apache HTTP Server...

Una vez hecho esto, puede continuar con el siguiente paso.

Inicie sesión en la interfaz de usuario web de FileRun

Ahora abra su navegador web y acceda a la interfaz de usuario web de FileRun usando la URL http://filerun.example.com .

Haga clic en el botón Siguiente . debería ver la página de verificación de requisitos del servidor.

Haga clic en el botón Siguiente . Debería ver la página de configuración de la base de datos.

Haga clic en el botón Siguiente . Una vez finalizada la instalación.

Haga clic en el botón Siguiente . Debería ver la página de inicio de sesión de FileRun.

Proporcione el nombre de usuario y la contraseña del administrador y haga clic en el botón Iniciar sesión . Debería ver el panel de control de FileRun.

Secure FileRun con Let's Encrypt SSL

También se recomienda que asegure su sitio web con Let's Encrypt SSL. Primero, deberá instalar el cliente Certbot para instalar y administrar SSL. De forma predeterminada, el paquete Certbot se incluye en el repositorio predeterminado de Debian, por lo que puede instalarlo con el siguiente comando:

apt-get install python3-certbot-apache -y

Una vez que Certbot esté instalado, ejecute el siguiente comando para proteger su sitio web con Let's Encrypt SSL:

certbot --apache -d filerun.example.com

Se le pedirá que proporcione su correo electrónico y acepte los términos de servicio como se muestra a continuación:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
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
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for filerun.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/filerun-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/filerun-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/filerun-le-ssl.conf
Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:

Elija si redirigir o no el tráfico HTTP sobre 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 instalar Let's Encrypt SSL para su sitio web:

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

Conclusión

¡Felicidades! ha instalado correctamente FileRun con Apache y Let's Encrypt SSL en Debian 11. Ahora puede usar FileRun para archivar archivos, música, fotos y compartirlos con amigos y familiares.

Buy me a coffeeBuy me a coffee

Supportaci se ti piacciono i nostri contenuti. Grazie.

Successivamente, completa il checkout per l'accesso completo a Noviello.it.
Bentornato! Accesso eseguito correttamente.
Ti sei abbonato con successo a Noviello.it.
Successo! Il tuo account è completamente attivato, ora hai accesso a tutti i contenuti.
Operazione riuscita. Le tue informazioni di fatturazione sono state aggiornate.
La tua fatturazione non è stata aggiornata.