웹사이트 검색

Debian 11에 FileRun을 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. LAMP 서버 설치
  3. MariaDB 데이터베이스 구성
  4. FileRun 다운로드
  5. FileRun용 Apache 구성
  6. FileRun 웹 UI 액세스
  7. Lets Encrypt SSL을 사용한 보안 FileRun\n
  8. 결론

FileRun은 Linux용 무료 오픈 소스 자체 호스팅 파일 공유 애플리케이션입니다. 구글 드라이브와 드롭박스에 대한 아주 좋은 대안입니다. 파일을 공유 및 동기화하고 WebDAV를 통해 액세스하고 Nextcloud 모바일 앱과 연결할 수도 있습니다. PHP로 작성되었으며 MariaDB를 데이터베이스 백엔드로 사용합니다. 안전한 클라우드 저장소를 통해 어디에서나 파일에 액세스할 수 있으며 사진, 비디오, 파일 등의 백업 및 공유도 제공합니다.

이 기사에서는 Apache와 함께 FileRun을 설치하는 방법과 Debian 11에서 Lets Encrypt SSL을 설명합니다.

전제 조건

  • Debian 11을 실행하는 서버.\n
  • 서버 IP를 가리키는 유효한 도메인 이름입니다.\n
  • 루트 암호는 서버에서 구성됩니다.\n

램프 서버 설치

먼저 Apache, MariaDB, PHP 및 기타 패키지를 서버에 설치해야 합니다. 다음 명령을 실행하여 모두 설치할 수 있습니다.

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

모든 패키지가 설치되면 IonCube 로더도 시스템에 설치해야 합니다.

먼저 다음 명령을 사용하여 IonCube 로더를 다운로드합니다.

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

다운로드가 완료되면 다음 명령을 사용하여 다운로드한 파일의 압축을 풉니다.

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

다음으로 ioncube 구성 파일을 만들고 IonCube 소스의 경로를 정의합니다.

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

다음 줄을 추가합니다.

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

파일을 저장하고 닫은 다음 FileRun용 PHP 구성 파일을 만듭니다.

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

다음 설정을 추가합니다.

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"

파일을 저장하고 닫은 다음 Apache 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl reload apache2

MariaDB 데이터베이스 구성

먼저 다음 명령을 사용하여 MariaDB 설치를 보호해야 합니다.

mysql_secure_installation

아래와 같이 모든 질문에 답하십시오.

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 

그런 다음 다음 명령을 사용하여 MariaDB 셸에 로그인합니다.

mysql -u root -p

로그인한 후 다음 명령을 사용하여 데이터베이스와 사용자를 생성합니다.

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

그런 다음 다음 명령을 사용하여 FileRun 데이터베이스에 대한 모든 권한을 부여합니다.

MariaDB [(none)]> GRANT ALL PRIVILEGES ON filerun.* TO 'filerun'@'localhost';

그런 다음 권한을 플러시하고 다음 명령을 사용하여 MariaDB를 종료합니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

파일런 다운로드

먼저 다음 명령을 사용하여 최신 버전의 FileRun을 다운로드합니다.

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

FileRun이 다운로드되면 다음 명령을 사용하여 다운로드한 파일의 압축을 풉니다.

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

그런 다음 다음 명령을 사용하여 적절한 권한과 소유권을 설정합니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

FileRun용 Apache 구성

다음으로 FileRun용 Apache 가상 호스트 구성 파일을 만들어야 합니다. 다음 명령으로 만들 수 있습니다.

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

다음 줄을 추가합니다.

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

파일을 저장하고 닫은 후 Apache 가상 호스트를 활성화하고 다음 명령을 사용하여 모듈을 다시 작성합니다.

a2ensite filerun.conf
a2enmod rewrite

다음으로 Apache 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart apache2

다음 명령을 사용하여 Apache 상태를 확인할 수도 있습니다.

systemctl status apache2

다음 출력이 표시되어야 합니다.

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

완료되면 다음 단계로 진행할 수 있습니다.

FileRun 웹 UI에 액세스

이제 웹 브라우저를 열고 URL http://filerun.example.com을 사용하여 FileRun 웹 UI에 액세스하십시오. 다음 페이지로 리디렉션됩니다.

다음 버튼을 클릭합니다. 서버 요구 사항 확인 페이지가 표시됩니다.

다음 버튼을 클릭합니다. 데이터베이스 설정 페이지가 표시되어야 합니다.

다음 버튼을 클릭합니다. 설치가 완료되면 다음 페이지가 표시됩니다.

다음 버튼을 클릭합니다. FileRun 로그인 페이지가 표시됩니다.

관리자 사용자 이름, 비밀번호를 제공하고 로그인 버튼을 클릭합니다. 다음 페이지에 FileRun 대시보드가 표시되어야 합니다.

Lets Encrypt SSL로 보안 FileRun

또한 Lets Encrypt SSL로 웹 사이트를 보호하는 것이 좋습니다. 먼저 SSL을 설치하고 관리하려면 Certbot 클라이언트를 설치해야 합니다. 기본적으로 Certbot 패키지는 Debian 기본 리포지토리에 포함되어 있으므로 다음 명령으로 설치할 수 있습니다.

apt-get install python3-certbot-apache -y

Certbot이 설치되면 다음 명령을 실행하여 Lets Encrypt SSL로 웹 사이트를 보호하십시오.

certbot --apache -d filerun.example.com

아래와 같이 이메일을 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다.

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

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

HTTP 트래픽을 HTTPS로 리디렉션하여 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

2를 입력하고 Enter 키를 눌러 웹사이트에 Lets Encrypt SSL을 설치합니다.

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

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/filerun.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/filerun.example.com/privkey.pem
   Your cert will expire on 2022-4-29. 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

결론

축하합니다! FileRun with Apache 및 Lets Encrypt SSL on Debian 11을 성공적으로 설치했습니다. 이제 FileRun을 사용하여 파일, 음악, 사진을 저장하고 친구 및 가족과 공유할 수 있습니다.