웹사이트 검색

Apache와 함께 ElkArte Forum을 설치하고 Debian 10에서 Encrypt를 허용하는 방법


이 페이지에서

  1. 요구 사항\n
  2. 시작하기\n
  3. Apache, MariaDB 및 PHP 설치
  4. ElkArte용 데이터베이스 구성
  5. ElkArte 다운로드
  6. ElkArte용 가상 호스트 만들기\n
  7. ElkArte 웹 인터페이스 액세스
  8. Lets Encrypt로 안전한 ElkArte\n

ElkArte는 자신만의 온라인 포럼 커뮤니티를 만들 수 있는 강력한 무료 오픈 소스 포럼 소프트웨어입니다. PHP 기반의 단순하고 가볍고 현대적인 포럼 플랫폼이며 MySQL/MariaDB를 사용하여 데이터를 저장합니다. ElkArte는 알림, 게시물에 대한 좋아요, 초안, 자동 저장, 파일 첨부 파일 드래그 앤 드롭, YouTube용 통합 비디오 임베딩, 이메일로 게시, 향상된 스팸 방지 조치 등을 포함한 풍부한 기능을 제공합니다.

이 튜토리얼에서는 Debian 10 서버에 ElkArte를 설치하는 방법을 설명합니다.

요구 사항

  • Debian 10을 실행하는 서버.\n
  • 루트 비밀번호가 서버에 설정됩니다.\n

시작하기

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

apt-get update -y
apt-get upgrade -y

서버가 업데이트되면 서버를 다시 시작하여 변경 사항을 적용하십시오.

Apache, MariaDB 및 PHP 설치

먼저 Apache 웹 서버, MariaDB 데이터베이스 서버, PHP 및 기타 필수 라이브러리를 서버에 설치해야 합니다. 다음 명령을 실행하여 모두 설치할 수 있습니다.

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

모든 패키지가 설치되면 php.ini 파일을 열고 일부 설정을 조정합니다.

nano /etc/php/7.3/apache2/php.ini

다음 줄을 변경합니다.

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago

완료되면 파일을 저장하고 닫습니다. 그런 다음 다음 명령을 사용하여 Apache 웹 서버를 다시 시작합니다.

systemctl restart apache2

ElkArte용 데이터베이스 구성

다음으로 ElkArte에 대한 데이터베이스와 사용자를 생성해야 합니다. 이렇게 하려면 다음 명령을 사용하여 MariaDB 셸에 로그인합니다.

mysql -u root -p

프롬프트가 표시되면 루트 암호를 제공한 후 다음 명령을 사용하여 데이터베이스와 사용자를 생성합니다.

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

그런 다음 다음 명령을 사용하여 ElkArte에 모든 권한을 부여합니다.

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

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

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

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

다운로드

먼저 Git 저장소에서 최신 버전의 ElkArte를 다운로드해야 합니다. 다운로드하려면 다음 명령을 실행합니다.

wget https://github.com/elkarte/Elkarte/archive/master.zip

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

unzip master.zip

다음으로 추출된 디렉터리를 Apache 웹 루트 디렉터리로 이동합니다.

mv Elkarte-master /var/www/html/elkarte

그런 다음 elkarte 디렉터리의 소유권을 변경하고 다음 명령을 사용하여 필요한 권한을 제공합니다.

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

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

ElkArte용 가상 호스트 만들기

다음으로 ElkArte를 제공할 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 만들 수 있습니다.

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

다음 줄을 추가합니다.

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

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

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

완료되면 파일을 저장하고 닫습니다. 그런 다음 다음 명령을 사용하여 가상 호스트 파일 및 Apache 재작성 모듈을 활성화합니다.

a2ensite elkarte.conf
a2enmod rewrite

마지막으로 Apache 웹 서버를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart apache2

ElkArte 웹 인터페이스에 액세스

이제 ElkArte가 설치 및 구성되었습니다. ElkArte 웹 인터페이스에 액세스할 시간입니다.

웹 브라우저를 열고 URL http://example.com을 입력합니다. ElkArte 시작 페이지로 리디렉션됩니다.

계속 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

데이터베이스 이름, 데이터베이스 사용자 이름, 암호를 제공하고 계속 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

포럼 이름, 포럼 URL을 제공하고 계속 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

이제 계속 버튼을 클릭하십시오. 관리자 생성 페이지가 표시됩니다.

원하는 관리자 이름, 비밀번호, 이메일, 데이터베이스 비밀번호를 제공하고 계속 버튼을 클릭합니다. 설치가 완료되면 다음 페이지가 표시됩니다.

이제 "새로 설치된 포럼"을 클릭하십시오. 다음 페이지에서 ElkArte 대시보드를 볼 수 있습니다.

Lets Encrypt로 안전한 ElkArte

먼저 서버에 Certbot을 설치해야 합니다. Certbot은 Let’s Encrypt에서 SSL 인증서를 얻고 이 인증서를 사용하도록 Apache를 구성하는 데 사용됩니다.

기본적으로 최신 버전의 Certbot은 Debian 10 기본 리포지토리에서 사용할 수 없습니다. 따라서 서버에 Certbot 리포지토리를 추가해야 합니다.

먼저 다음 명령을 사용하여 Certbot 리포지토리를 추가합니다.

add-apt-repository ppa:certbot/certbot

리포지토리가 추가되면 리포지토리를 업데이트하고 다음 명령을 사용하여 Certbot을 설치합니다.

apt-get update -y
apt-get install certbot python-certbot-apache -y

이제 Certbot이 설치되어 사용할 준비가 되었습니다.

다음 명령을 실행하여 도메인에 대한 SSL 인증서를 얻습니다.

certbot --apache -d example.com

먼저 유효한 이메일 주소를 제공하고 아래와 같이 서비스 약관에 동의해야 합니다.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
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
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/example.com-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/example.com-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/example.com-le-ssl.conf

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를 선택하여 도메인용 무료 SSL 인증서를 다운로드하고 설치합니다. 일단 설치가 성공적으로 완료되었습니다. 다음 출력이 표시되어야 합니다.

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/example.com.conf to ssl vhost in /etc/apache2/sites-available/
example.com-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com/privkey.pem
   Your cert will expire on 2019-10-22. 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"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - 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

축하합니다! 귀하의 ElkArte는 이제 SSL 인증서로 보호됩니다. 이제 URL https://example.com을 방문하여 안전하게 액세스할 수 있습니다.