FileRunは、Linux用の無料のオープンソースの自己ホスト型ファイル共有アプリケーションです。これは、Googleドライブとドロップボックスの非常に優れた代替手段です。これにより、ファイルの共有と同期、WebDAV経由のアクセス、さらにはNextcloudモバイルアプリとの接続が可能になります。 PHPで記述されており、MariaDBをデータベースバックエンドとして使用します。安全なクラウドストレージを介してどこからでもファイルにアクセスでき、写真、ビデオ、ファイルなどのバックアップと共有も可能です。
この記事では、Apacheを使用してFileRunをインストールし、Debian11にSSLを暗号化する方法を説明します。
- Debian11を実行しているサーバー。
- サーバーIPで指定された有効なドメイン名。
- ルートパスワードはサーバーで構成されています。
LAMPサーバーをインストールする
まず、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をダウンロード
まず、次のコマンドを使用して最新バージョンの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...
終了したら、次のステップに進むことができます。
FileRunWebUIにアクセス
次に、Webブラウザーを開き、URL http://filerun.example.comを使用してFileRunWebUIにアクセスします。 。次のページにリダイレクトされます:
次へをクリックします ボタン。サーバー要件のチェックページが表示されます:
次へをクリックします ボタン。データベース設定ページが表示されます:
次へをクリックします ボタン。インストールが完了すると、次のページが表示されます。
次へをクリックします ボタン。 FileRunログインページが表示されます:
管理者のユーザー名とパスワードを入力し、ログインをクリックします ボタン。次のページにFileRunダッシュボードが表示されます。
Let'sEncryptSSLを使用してWebサイトを保護することもお勧めします。まず、SSLをインストールして管理するためにCertbotクライアントをインストールする必要があります。デフォルトでは、CertbotパッケージはDebianのデフォルトリポジトリに含まれているため、次のコマンドでインストールできます。
apt-get install python3-certbot-apache -y
Certbotをインストールしたら、次のコマンドを実行して、Let'sEncryptSSLでWebサイトを保護します。
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): [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:
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キーを押して、WebサイトにLet'sEncryptSSLをインストールします。
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 withApacheとLet'sEncryptSSLがDebian11に正常にインストールされました。これで、FileRunを使用してファイル、音楽、写真を保存し、友人や家族と共有できます。