웹사이트 검색

Ubuntu 22.04에 FileRun을 설치하는 방법


이 튜토리얼은 다음 OS 버전에 대해 존재합니다.

  • Ubuntu 22.04(Jammy Jellyfish)
  • Ubuntu 20.04(Focal Fossa)

이 페이지에서

  1. 전제 조건
  2. Apache, MariaDB 및 PHP 설치
  3. FileRun용 데이터베이스 만들기
  4. FileRun 다운로드
  5. FileRun용 Apache 가상 호스트 만들기\n
  6. FileRun 웹 UI 액세스
  7. Lets Encrypt SSL을 사용한 보안 FileRun\n
  8. 결론

FileRun은 Linux 기반 운영 체제용 오픈 소스 및 웹 기반 파일 공유 애플리케이션입니다. Google 드라이브, iCloud 및 DrobBox와 매우 유사하며 사용자가 인터넷을 통해 파일을 공유하고 동기화할 수 있습니다. 모바일 앱, WebDAV 및 웹 브라우저를 통해 액세스할 수 있습니다. 클라우드에서 자신의 파일 공유 솔루션을 호스팅하고 안전한 클라우드 저장소를 통해 어디서나 모든 파일에 액세스할 수 있습니다.

이 게시물은 Ubuntu 22.04에서 Apache 및 Lets Encrypt SSL을 사용하여 FileRun을 설치하는 방법을 보여줍니다.

전제 조건

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

Apache, MariaDB 및 PHP 설치

FileRun은 PHP로 작성되었으며 MariaDB를 데이터베이스 백엔드로 사용합니다. 따라서 Apache, MariaDB, PHP 및 기타 패키지를 서버에 설치해야 합니다. 먼저 다음 명령을 사용하여 Apache 및 MariaDB 패키지를 설치합니다.

apt-get install apache2 mariadb-server mariadb-client

두 패키지를 모두 설치한 후 서버에 PHP 버전 php7.2-php7.4를 설치해야 합니다. 그러나 Ubuntu 22.04는 기본 리포지토리에 PHP 8.1 버전과 함께 제공됩니다. 따라서 서버에 PHP Ondrej 저장소를 추가해야 합니다.

먼저 다음 명령을 사용하여 필요한 모든 종속 항목을 설치합니다.

apt install software-properties-common ca-certificates lsb-release apt-transport-https -y

다음으로 다음 명령을 사용하여 PHP 리포지토리를 추가합니다.

add-apt-repository ppa:ondrej/php

다음으로 다음 명령을 사용하여 리포지토리 캐시를 업데이트하고 필요한 다른 확장과 함께 PHP를 설치합니다.

apt update
apt install php7.4 libapache2-mod-php7.4 imagemagick ffmpeg php7.4-imagick php7.4-mysql php7.4-fpm php7.4-common php7.4-gd php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-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

FileRun용 데이터베이스 생성

먼저 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 가상 호스트를 활성화하고 다음 명령을 사용하여 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-08-06 09:26:00 UTC; 7s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 21189 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 21193 (apache2)
      Tasks: 6 (limit: 2242)
     Memory: 14.6M
        CPU: 112ms
     CGroup: /system.slice/apache2.service
             ??21193 /usr/sbin/apache2 -k start
             ??21194 /usr/sbin/apache2 -k start
             ??21195 /usr/sbin/apache2 -k start
             ??21196 /usr/sbin/apache2 -k start
             ??21197 /usr/sbin/apache2 -k start
             ??21198 /usr/sbin/apache2 -k start

Aug 06 09:26:00 ubuntu2204 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로 웹 사이트를 보호하는 것이 좋습니다. 먼저 서버에 Certbot 클라이언트를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

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

결론

축하합니다! Apache와 함께 FileRun을 성공적으로 설치했으며 Ubuntu 22.04에서 SSL을 암호화할 수 있습니다. 이제 클라우드에서 자체 FileRun 서버를 호스팅하고 파일, 음악 및 사진을 친구 및 가족과 공유하고 동기화할 수 있습니다.