웹사이트 검색

Ubuntu 20.04에 Friendica 소셜 네트워크 플랫폼을 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. LAMP 서버 설치
  4. Friendica 데이터베이스 만들기
  5. 프렌디카 다운로드\n
  6. Friendica용 Apache 구성
  7. Friendica 대시보드 액세스
  8. Lets Encrypt SSL로 Friendica 보호\n
  9. 결론

Friendica는 소셜 네트워킹 프로젝트를 구축하고 유지하는 데 도움이 되는 무료 오픈 소스 분산형 소셜 네트워킹 플랫폼입니다. Mastodon, Hubzilla, OStatus, Pleroma 등을 포함한 ActivityPub에 대한 지원이 내장되어 있습니다. RSS/Atom 피드를 통해 웹사이트와 블로그를 소셜 스트림으로 가져올 수 있습니다. 모든 장치에서 소셜 네트워크를 관리하는 데 도움이 되는 강력한 사용자 및 관리 대시보드를 제공합니다.

이 튜토리얼에서는 Apache와 함께 Friendica를 설치하고 Ubuntu 20.04에서 Lets Encrypt SSL을 설치하는 방법을 보여줍니다.

전제 조건

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

시작하기

시작하기 전에 시스템 패키지를 최신 버전으로 업데이트해야 합니다. 다음 명령을 사용하여 업데이트할 수 있습니다.

apt-get update -y

서버가 업데이트되면 다음 단계로 진행할 수 있습니다.

램프 서버 설치

Friendica는 PHP로 작성된 웹 서버에서 실행되며 MySQL을 데이터베이스 백엔드로 사용합니다. 따라서 시스템에 LAMP 스택을 설치해야 합니다. 설치되어 있지 않은 경우 다음 명령으로 설치할 수 있습니다.

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-imagick php-xml php-cli php-zip php-sqlite3 curl git -y

모든 패키지가 설치되면 php.ini 파일을 편집하고 몇 가지 사항을 변경합니다.

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

다음 줄을 변경합니다.

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 300
max_input_vars = 1500
date.timezone = Asia/Kolkata

완료되면 파일을 저장하고 닫습니다.

Friendica 데이터베이스 생성

다음으로 Friendica용 데이터베이스와 사용자를 생성해야 합니다. 먼저 다음 명령을 사용하여 MySQL에 연결합니다.

mysql

연결되면 다음 명령을 사용하여 데이터베이스와 사용자를 만듭니다.

MariaDB [(none)]> CREATE DATABASE friendicadb;
MariaDB [(none)]> CREATE USER 'friendica'@'localhost' IDENTIFIED BY 'password';

다음으로 다음 명령을 사용하여 Friendica 데이터베이스에 대한 모든 권한을 부여합니다.

MariaDB [(none)]> GRANT ALL ON friendicadb.* TO 'friendica'@'localhost' WITH GRANT OPTION;

그런 다음 권한을 플러시하고 다음 명령을 사용하여 MySQL을 종료합니다.

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

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

프렌디카 다운로드

Friendica를 다운로드하기 전에 시스템에 Composer를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

apt-get install composer -y

설치가 완료되면 디렉터리를 Apache 웹 루트로 변경하고 Git 리포지토리에서 최신 버전의 Friendica를 다운로드합니다.

cd /var/www/html
git clone https://github.com/friendica/friendica.git

다운로드가 완료되면 디렉토리를 friendica로 변경하고 다음 명령을 사용하여 필요한 PHP 종속성을 설치합니다.

cd friendica
composer install --no-dev

다음으로 다음 명령을 사용하여 Friendica 애드온을 다운로드합니다.

git clone https://github.com/friendica/friendica-addons.git

다음으로 friendica 디렉터리에 대한 적절한 소유권과 권한을 설정합니다.

chown -R www-data:www-data /var/www/html/friendica/
chmod -R 755 /var/www/html/friendica/

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

Friendica용 Apache 구성

다음으로 Friendica를 호스팅하기 위해 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 만들 수 있습니다.

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

다음 줄을 추가합니다.

<VirtualHost *:80>
     ServerAdmin 
     DocumentRoot /var/www/html/friendica
     ServerName friendica.example.com


     <Directory /var/www/html/friendica/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

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

a2ensite friendica.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 Sun 2021-02-07 09:20:58 UTC; 6s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 33243 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 33259 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 15.1M
     CGroup: /system.slice/apache2.service
             ??33259 /usr/sbin/apache2 -k start
             ??33260 /usr/sbin/apache2 -k start
             ??33261 /usr/sbin/apache2 -k start
             ??33262 /usr/sbin/apache2 -k start
             ??33263 /usr/sbin/apache2 -k start
             ??33264 /usr/sbin/apache2 -k start

Feb 07 09:20:58 ubunt4 systemd[1]: Starting The Apache HTTP Server...

Friendica 대시보드에 액세스

이제 웹 브라우저를 열고 URL http://friendica.example.com을 사용하여 Friendica 웹 인터페이스에 액세스하십시오. 시스템 확인 페이지로 리디렉션됩니다.

모든 PHP 종속성이 설치되었는지 확인한 후 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

도메인 이름, 설치 경로를 제공하고 제출 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

데이터베이스 이름, 데이터베이스 사용자 이름, 암호를 제공하고 제출을 클릭하십시오. 사이트 설정 페이지가 표시됩니다.

관리자 이메일, 언어, 시간대를 제공하고 제출 버튼을 클릭합니다. 설치가 완료되면 다음 페이지가 표시됩니다.

이제 등록 페이지 버튼을 클릭하고 등록 프로세스를 완료하여 Friendica에 액세스하십시오.

Lets Encrypt SSL로 Friendica 보호

Lets Encrypt SSL로 웹 사이트를 보호하는 것은 항상 좋은 생각입니다. SSL을 설치하고 관리하려면 Certbot 클라이언트를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

apt-get install python3-certbot-apache -y

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

certbot --apache -d friendica.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 friendica.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/friendica-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/friendica-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/friendica-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/friendica.conf to ssl vhost in /etc/apache2/sites-available/friendica-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/friendica.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/friendica.example.com/privkey.pem
   Your cert will expire on 2020-10-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

이제 URL https://friendica.example.com을 사용하여 안전하게 웹사이트에 액세스할 수 있습니다.

결론

축하합니다! Ubuntu 20.04 서버에 Friendica 소셜 네트워크 플랫폼을 성공적으로 설치하고 구성했습니다. 이제 중앙 위치에서 소셜 네트워크 커뮤니티를 관리할 수 있습니다.