GNU/Linux >> Belajar Linux >  >> Ubuntu

Cara Menginstal ProjectSend dengan Apache dan Lets Encrypt SSL di Ubuntu 20.04

ProjectSend adalah aplikasi berbagi file dan gambar sumber terbuka dan gratis yang membantu Anda berbagi file antara perusahaan dan klien Anda. Ini adalah alat berbagi file berorientasi klien yang memungkinkan Anda mengunggah dan berbagi ukuran file tanpa batas di server mana pun. Itu ditulis dalam PHP dan menggunakan database MySQL untuk menyimpan informasi. Ini menawarkan serangkaian fitur yang kaya termasuk, Statistik waktu nyata, pendaftaran mandiri, login mandiri, template Email Kustom, dan banyak lagi.

Dalam posting ini, kami akan menunjukkan cara menginstal aplikasi berbagi file ProjectSend dengan Apache dan Let's Encrypt SSL di Ubuntu 20.04.

Prasyarat

  • Server yang menjalankan Ubuntu 20.04.
  • Nama domain valid yang ditunjukkan dengan IP server Anda.
  • Kata sandi root dikonfigurasi di server.

Memulai

Pertama, perbarui paket sistem ke versi yang diperbarui dengan menjalankan perintah berikut:

apt-get update -y

Setelah semua paket diperbarui, Anda dapat melanjutkan ke langkah berikutnya.

Instal Server LAMP

Pertama, Anda perlu menginstal Apache, MariaDB, PHP, dan ekstensi lain yang diperlukan ke server Anda. Anda dapat menginstal semuanya dengan perintah berikut:

apt-get install apache2 mariadb-server imagemagick php libapache2-mod-php php-imagick php7.4-common php7.4-mysql php7.4-gd php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-intl php7.4-bcmath php7.4-gmp

Setelah menginstal semua paket, edit file php.ini:

nano /etc/php/7.4/apache2/php.ini

Ubah pengaturan berikut:

memory_limit = 512M
upload_max_filesize = 32M
max_execution_time = 300
date.timezone = Asia/Kolkata

Simpan dan tutup file kemudian restart layanan Apache untuk menerapkan perubahan:

systemctl restart apache2

Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.

Buat Database untuk ProjectSend

Selanjutnya, Anda perlu membuat database dan pengguna untuk ProjectSend.

Untuk melakukannya, masuk ke MariaDB dengan perintah berikut:

mysql

Setelah login, buat database dan user dengan perintah berikut:

MariaDB [(none)]> create database projectsend;
MariaDB [(none)]> create user [email protected] identified by 'password';

Selanjutnya, berikan semua hak istimewa ke database projectend dengan perintah berikut:

MariaDB [(none)]> grant all privileges on projectsend.* to [email protected];

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 ProjectSend

Selanjutnya, Anda perlu mengunduh ProjectSend versi terbaru dari situs resminya. Anda dapat mengunduhnya dengan perintah berikut:

wget -O projectsend.zip https://www.projectsend.org/download/387/

Setelah unduhan selesai, ekstrak file yang diunduh dengan perintah berikut:

unzip projectsend.zip -d /var/www/html/projectsend

Selanjutnya, ubah direktori ke direktori yang diekstrak dan ganti nama file konfigurasi default:

cd /var/www/html/projectsend/includes
cp sys.config.sample.php sys.config.php

Selanjutnya, edit file konfigurasi dengan perintah berikut:

nano sys.config.php

Ubah pengaturan berikut:

define('DB_DRIVER', 'mysql');

/** Database name */
define('DB_NAME', 'projectsend');

/** Database host (in most cases it's localhost) */
define('DB_HOST', 'localhost');

/** Database username (must be assigned to the database) */
define('DB_USER', 'projectsend');

/** Database password */
define('DB_PASSWORD', 'password');

Simpan dan tutup file kemudian atur izin dan kepemilikan yang tepat dengan perintah berikut:

chown -R www-data:www-data /var/www/html/projectsend
chmod -R 775 /var/www/html/projectsend
chmod 644 /var/www/html/projectsend/includes/sys.config.php

Setelah selesai, Anda dapat melanjutkan ke langkah berikutnya.

Konfigurasi Apache untuk ProjectSend

Selanjutnya, buat file konfigurasi virtual host apache dengan perintah berikut:

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

Tambahkan baris berikut:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/projectsend/
ServerName projectsend.example.com
<Directory /var/www/html/projectsend/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/example.com-error_log
CustomLog /var/log/apache2/example.com-access_log common
</VirtualHost>

Simpan dan tutup file kemudian aktifkan modul rewrite dan file konfigurasi virtual host dengan perintah berikut:

a2enmod rewrite
a2ensite projectsend.conf

Selanjutnya, restart layanan Apache untuk menerapkan perubahan:

systemctl restart apache2

Anda sekarang 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 Wed 2021-06-02 07:11:08 UTC; 5min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 17680 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
   Main PID: 14862 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 25.0M
     CGroup: /system.slice/apache2.service
             ??14862 /usr/sbin/apache2 -k start
             ??17684 /usr/sbin/apache2 -k start
             ??17685 /usr/sbin/apache2 -k start
             ??17686 /usr/sbin/apache2 -k start
             ??17687 /usr/sbin/apache2 -k start
             ??17688 /usr/sbin/apache2 -k start

Jun 02 07:11:08 ubuntu2004 systemd[1]: Starting The Apache HTTP Server...

Akses Antarmuka Web ProjectSend

Sekarang, buka browser web Anda dan akses antarmuka web ProjectSend menggunakan URL http://projectsend.example.com . Anda akan melihat halaman berikut:

Berikan nama situs Anda, URL situs, nama pengguna admin, kata sandi, dan klik tombol Instal tombol. Anda akan melihat halaman berikut:

Sekarang, klik Masuk tombol. Anda akan melihat halaman berikut:

Berikan nama pengguna, kata sandi admin Anda, dan klik Masuk tombol. Anda akan melihat dasbor ProjectSend di halaman berikut:

Amankan ProjectSend dengan Let's Encrypt SSL

Itu selalu merupakan ide yang baik 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 Ubuntu 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 projectsend.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 projectsend.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/projectsend-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/projectsend-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/projectsend-le-ssl.conf

Selanjutnya, pilih apakah akan mengarahkan lalu lintas HTTP ke HTTPS seperti yang ditunjukkan di bawah ini:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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/projectsend.conf to ssl vhost in /etc/apache2/sites-available/projectsend-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/projectsend.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/projectsend.example.com/privkey.pem
   Your cert will expire on 2021-12-23. 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 ProjectSend dengan Apache dan Let's Encrypt SSL di Ubuntu 20.04. Sekarang Anda dapat dengan mudah berbagi file dan gambar dari antarmuka web ProjectSend.


Ubuntu
  1. Cara Menginstal Nextcloud dengan Nginx dan Lets Encrypt SSL di Ubuntu 20.04 LTS

  2. Cara Menginstal Magento 2 dengan Nginx dan Mengenkripsi SSL di Ubuntu 20.04 LTS

  3. Cara Menginstal WonderCMS dengan Apache dan Mengenkripsi SSL di CentOS 8

  1. Cara Menginstal Drupal dengan Nginx dan Mengenkripsi SSL di Ubuntu 20.04 LTS

  2. Cara Instal Joomla dengan Apache2 dan Lets Encrypt di Ubuntu 20.04

  3. Cara menginstal Webmin dan mengamankannya dengan Lets Encrypt SSL di Ubuntu 20.04 LTS

  1. Cara Menginstal Forum Vanilla dengan Apache dan Mengenkripsi SSL di Ubuntu 20.04 LTS

  2. Cara Menginstal Shopware 6 dengan Nginx dan Lets Encrypt SSL di Ubuntu 20.04

  3. Cara Menginstal CMS TYPO3 dengan Lets Encrypt SSL di Ubuntu 20.04