FileRun adalah aplikasi berbagi file gratis, sumber terbuka, dan dihosting sendiri untuk Linux. Ini adalah alternatif yang sangat baik untuk Google Drive dan dropbox. Ini memungkinkan Anda untuk berbagi dan menyinkronkan file, mengakses melalui WebDAV dan bahkan menghubungkannya dengan aplikasi seluler Nextcloud. Itu ditulis dalam PHP dan menggunakan MariaDB sebagai backend database. Ini memungkinkan Anda mengakses file di mana saja melalui penyimpanan cloud yang aman, dan juga menawarkan pencadangan dan berbagi foto, video, file, dan lainnya.
Pada artikel ini, saya akan menjelaskan cara menginstal FileRun dengan Apache dan Let's Encrypt SSL di Debian 11.
Prasyarat
- Server yang menjalankan Debian 11.
- Nama domain valid yang ditunjukkan dengan IP server Anda.
- Kata sandi root dikonfigurasi di server.
Instal Server LAMP
Pertama, Anda perlu menginstal Apache, MariaDB, PHP, dan paket lainnya ke server Anda. Anda dapat menginstal semuanya dengan menjalankan perintah berikut:
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
Setelah semua paket terinstal, Anda juga perlu menginstal pemuat IonCube ke sistem Anda.
Pertama, unduh pemuat IonCube dengan perintah berikut:
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
Setelah unduhan selesai, ekstrak file yang diunduh dengan perintah berikut:
tar -xzf ioncube_loaders_lin_x86-64.tar.gz -C /usr/lib/php
Selanjutnya, buat file konfigurasi ioncube dan tentukan jalur sumber IonCube:
nano /etc/php/7.4/apache2/conf.d/00-ioncube.ini
Tambahkan baris berikut:
zend_extension = /usr/lib/php/ioncube/ioncube_loader_lin_7.4.so
Simpan dan tutup file kemudian buat file konfigurasi PHP untuk FileRun:
nano /etc/php/7.4/apache2/conf.d/filerun.ini
Tambahkan pengaturan berikut:
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"
Simpan dan tutup file kemudian restart layanan Apache untuk menerapkan perubahan:
systemctl reload apache2
Konfigurasi Database MariaDB
Pertama, Anda perlu mengamankan instalasi MariaDB menggunakan perintah berikut:
mysql_secure_installation
Jawab semua pertanyaan seperti yang ditunjukkan di bawah ini:
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
Selanjutnya, masuk ke shell MariaDB dengan perintah berikut:
mysql -u root -p
Setelah Anda masuk, buat database dan pengguna dengan perintah berikut:
MariaDB [(none)]> CREATE DATABASE filerun;
MariaDB [(none)]> CREATE USER 'filerun'@'localhost' IDENTIFIED BY 'password';
Selanjutnya, berikan semua hak istimewa ke database FileRun dengan perintah berikut:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON filerun.* TO 'filerun'@'localhost';
Selanjutnya, flush hak istimewa dan keluar dari MariaDB dengan perintah berikut:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.
Unduh FileRun
Pertama, unduh FileRun versi terbaru dengan perintah berikut:
wget -O FileRun.zip https://filerun.com/download-latest
Setelah FileRun diunduh, unzip file yang diunduh menggunakan perintah berikut:
unzip FileRun.zip -d /var/www/html/filerun/
Selanjutnya, atur izin dan kepemilikan yang tepat dengan perintah berikut:
chown -R www-data:www-data /var/www/html/filerun
chmod -R 755 /var/www/html/filerun
Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.
Konfigurasi Apache untuk FileRun
Selanjutnya, Anda perlu membuat file konfigurasi virtual host Apache untuk FileRun. Anda dapat membuatnya dengan perintah berikut:
nano /etc/apache2/sites-available/filerun.conf
Tambahkan baris berikut:
<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>
Simpan dan tutup file kemudian aktifkan Apache virtual host dan rewrite module dengan perintah berikut:
a2ensite filerun.conf
a2enmod rewrite
Selanjutnya, restart layanan Apache untuk menerapkan perubahan:
systemctl restart apache2
Anda juga dapat memeriksa status Apache dengan perintah berikut:
systemctl status apache2
Anda akan melihat output berikut:
? 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...
Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.
Mengakses UI Web FileRun
Sekarang, buka browser web Anda dan akses UI web FileRun menggunakan URL http://filerun.example.com . Anda akan diarahkan ke halaman berikut:
Klik Berikutnya tombol. Anda akan melihat halaman pemeriksaan persyaratan server:
Klik Berikutnya tombol. Anda akan melihat halaman penyiapan basis data:
Klik Berikutnya tombol. Setelah instalasi selesai, Anda akan melihat halaman berikut:
Klik Berikutnya tombol. Anda akan melihat halaman login FileRun:
Berikan nama pengguna, kata sandi admin Anda, dan klik tombol Masuk tombol. Anda akan melihat dasbor FileRun di halaman berikut:
Amankan FileRun dengan Let's Encrypt SSL
Disarankan juga untuk mengamankan situs web Anda dengan Let's Encrypt SSL. Pertama, Anda perlu menginstal klien Certbot untuk menginstal dan mengelola SSL. Secara default, paket Certbot disertakan dalam repositori default Debian sehingga Anda dapat menginstalnya dengan perintah berikut:
apt-get install python3-certbot-apache -y
Setelah Certbot terinstal, jalankan perintah berikut untuk mengamankan situs web Anda dengan Let's Encrypt SSL:
certbot --apache -d filerun.example.com
Anda akan diminta untuk memberikan email Anda dan menerima persyaratan layanan seperti yang ditunjukkan di bawah ini:
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:
Harap pilih apakah akan mengalihkan lalu lintas HTTP ke HTTPS, menghapus akses 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
Ketik 2 dan tekan Enter untuk menginstal Let's Encrypt SSL untuk situs web Anda:
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
Kesimpulan
Selamat! Anda telah berhasil menginstal FileRun dengan Apache dan Let's Encrypt SSL di Debian 11. Sekarang Anda dapat menggunakan FileRun untuk menyimpan file, musik, foto, dan membaginya dengan teman dan keluarga.