웹사이트 검색

Apache로 ProjectSend를 설치하고 Ubuntu 20.04에서 SSL을 암호화하는 방법


이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. LAMP 서버 설치
  4. ProjectSend용 데이터베이스 만들기
  5. ProjectSend 다운로드
  6. ProjectSend용 Apache 구성
  7. ProjectSend 웹 인터페이스 액세스
  8. Lets Encrypt SSL로 안전한 ProjectSend\n
  9. 결론

ProjectSend는 회사와 클라이언트 간에 파일을 공유하는 데 도움이 되는 무료 오픈 소스 파일 및 이미지 공유 응용 프로그램입니다. 모든 서버에서 무제한 파일 크기를 업로드하고 공유할 수 있는 클라이언트 지향 파일 공유 도구입니다. PHP로 작성되었으며 MySQL 데이터베이스를 사용하여 정보를 저장합니다. 실시간 통계, 자체 등록, 자체 로그인, 사용자 정의 이메일 템플릿 등을 포함한 다양한 기능을 제공합니다.

이 게시물에서는 Apache와 함께 ProjectSend 파일 공유 애플리케이션을 설치하고 Ubuntu 20.04에서 Lets Encrypt SSL을 사용하는 방법을 보여줍니다.

전제 조건

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

시작하기

먼저 다음 명령을 실행하여 시스템 패키지를 업데이트된 버전으로 업데이트합니다.

apt-get update -y

모든 패키지가 업데이트되면 다음 단계로 진행할 수 있습니다.

램프 서버 설치

먼저 Apache, MariaDB, PHP 및 기타 필요한 확장을 서버에 설치해야 합니다. 다음 명령으로 모두 설치할 수 있습니다.

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

모든 패키지를 설치한 후 php.ini 파일을 편집합니다.

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

다음 설정을 변경합니다.

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

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

systemctl restart apache2

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

ProjectSend용 데이터베이스 생성

다음으로 ProjectSend를 위한 데이터베이스와 사용자를 생성해야 합니다.

이렇게 하려면 다음 명령을 사용하여 MariaDB에 로그인합니다.

mysql

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

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

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

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

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

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

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

프로젝트 보내기

다음으로 공식 웹 사이트에서 최신 버전의 ProjectSend를 다운로드해야 합니다. 다음 명령으로 다운로드할 수 있습니다.

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

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

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

그런 다음 디렉터리를 추출된 디렉터리로 변경하고 기본 구성 파일의 이름을 바꿉니다.

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

그런 다음 다음 명령을 사용하여 구성 파일을 편집합니다.

nano sys.config.php

다음 설정을 변경합니다.

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');

파일을 저장하고 닫은 후 다음 명령을 사용하여 적절한 권한과 소유권을 설정합니다.

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

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

ProjectSend를 위한 Apache 구성

다음으로 다음 명령을 사용하여 Apache 가상 호스트 구성 파일을 만듭니다.

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

다음 줄을 추가합니다.

<VirtualHost *:80>
ServerAdmin 
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>

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

a2enmod rewrite
a2ensite projectsend.conf

다음으로 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 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 ubunt4 systemd[1]: Starting The Apache HTTP Server...

ProjectSend 웹 인터페이스에 액세스

이제 웹 브라우저를 열고 URL http://projectsend.example.com을 사용하여 ProjectSend 웹 인터페이스에 액세스하십시오. 다음 페이지가 표시됩니다.

사이트 이름, 사이트 URL, 관리자 사용자 이름, 비밀번호를 제공하고 설치 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

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

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

Lets Encrypt SSL로 안전한 ProjectSend

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

apt-get install python3-certbot-apache -y

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

certbot --apache -d projectsend.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 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

다음으로 아래와 같이 HTTP 트래픽을 HTTPS로 리디렉션할지 여부를 선택합니다.

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

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

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

결론

축하합니다! Apache와 함께 ProjectSend를 성공적으로 설치했으며 Ubuntu 20.04에서 Lets Encrypt SSL을 사용했습니다. 이제 ProjectSend 웹 인터페이스에서 파일과 이미지를 쉽게 공유할 수 있습니다.