웹사이트 검색

Ubuntu 20.04에서 Apache 및 무료 Lets Encrypt SSL을 사용하여 Concrete5 CMS를 설치하는 방법


이 페이지에서

  1. 요구 사항\n
  2. 시작하기\n
  3. Apache, MariaDB 및 PHP 설치
  4. Concrete5 데이터베이스 생성
  5. Concrete5 CMS 다운로드
  6. Concrete5 CMS용 Apache 구성
  7. Concrete5 CMS 웹 인터페이스에 액세스
  8. Secure Concrete5 with Lets Encrypt SSL
  9. 결론

Concrete5는 인터넷에 콘텐츠를 게시하는 데 사용되는 오픈 소스 콘텐츠 관리 시스템입니다. PHP로 작성되었으며 MariaDB를 데이터베이스 백엔드로 사용합니다. 웹 브라우저를 통해 페이지와 콘텐츠를 만들 수 있도록 도와주는 사용하기 쉬운 빌더를 제공합니다. 유연하고 안전하며 모바일 지원이 가능하며 Model-View-Controller 아키텍처를 기반으로 합니다. WYSIWYG 콘텐츠 편집기, 미디어 관리자, 콘텐츠 끌어서 놓기, 상황에 맞는 편집 등을 포함한 다양한 기능을 제공합니다.

이 게시물에서는 Ubuntu 20.04 서버에서 Apache와 Lets Encrypt SSL을 사용하여 Concrete5 CMS를 설치하는 방법을 보여줍니다.

요구 사항

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

시작하기

먼저 APT 패키지 색인을 최신 버전으로 업데이트해야 합니다. 다음 명령으로 업데이트할 수 있습니다.

apt-get update -y

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

Apache, MariaDB 및 PHP 설치

다음으로 Apache 웹 서버, MariaDB 데이터베이스 서버, PHP 및 기타 PHP 확장을 서버에 설치해야 합니다. 다음 명령을 사용하여 모두 설치할 수 있습니다.

apt-get install apache2 mariadb-server php libapache2-mod-php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-ldap php-zip php-curl -y

모든 패키지가 설치되면 php.ini 파일을 편집하고 원하는 값을 설정합니다.

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

다음 줄을 변경합니다.

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 64M
date.timezone = Asia/Kolkata

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

systemctl restart apache2

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

Concrete5 데이터베이스 생성

다음으로 Concrete5용 데이터베이스와 사용자를 생성해야 합니다. 먼저 다음 명령을 사용하여 MariaDB에 로그인합니다.

mysql

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

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

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

MariaDB [(none)]> GRANT ALL ON concrete5.* TO 'concrete5user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

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

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

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

Concrete5 CMS 다운로드

먼저 Concrete5 CMS 웹사이트로 이동하여 Concrete5 최신 버전의 URL을 복사하고 다음 명령으로 다운로드합니다.

wget --trust-server-names https://www.concrete5.org/download_file/-/view/115589/ -O concrete5.zip

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

unzip concrete5.zip

그런 다음 다음 명령을 사용하여 추출된 디렉터리를 Apache 웹 루트 디렉터리로 이동합니다.

mv concrete5-* /var/www/html/concrete5

다음으로 다음 명령을 사용하여 concrete5 디렉토리에 적절한 권한과 소유권을 설정합니다.

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

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

Concrete5 CMS용 Apache 구성

다음으로 Concrete5 CMS용 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 만들 수 있습니다.

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

다음 줄을 추가합니다.

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

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

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

</VirtualHost>

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

a2ensite concrete5.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 Sat 2021-05-15 15:00:03 UTC; 4s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 15566 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 15585 (apache2)
      Tasks: 6 (limit: 2353)
     Memory: 13.5M
     CGroup: /system.slice/apache2.service
             ??15585 /usr/sbin/apache2 -k start
             ??15586 /usr/sbin/apache2 -k start
             ??15587 /usr/sbin/apache2 -k start
             ??15588 /usr/sbin/apache2 -k start
             ??15589 /usr/sbin/apache2 -k start
             ??15590 /usr/sbin/apache2 -k start

May 15 15:00:03 ubunt4 systemd[1]: Starting The Apache HTTP Server...

이 시점에서 Apache 웹 서버는 Concrete5 CMS를 호스팅하도록 구성됩니다. 이제 다음 단계를 진행할 수 있습니다.

Concrete5 CMS 웹 인터페이스에 액세스

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

언어를 선택하고 화살표 버튼을 클릭하십시오. 다음 페이지가 표시됩니다.

필요한 모든 라이브러리가 설치되었는지 확인한 다음 설치 계속 버튼을 클릭하면 다음 페이지가 표시됩니다.

여기에서 Admin 사용자 이름, 암호, 데이터베이스 사용자 이름, 암호 및 데이터베이스 이름을 제공한 다음 Install Concrete5 버튼을 클릭하여 설치를 시작합니다. 설치가 완료되면 다음 페이지가 표시됩니다.

이제 사이트 편집 버튼을 클릭하면 다음 페이지에 Concrete5 대시보드가 표시됩니다.

Lets Encrypt SSL로 Secure Concrete5

다음으로 Lets Encrypt SSL로 웹 사이트를 보호하는 것이 좋습니다. 먼저 다음 명령을 사용하여 Certbot 클라이언트를 설치합니다.

apt-get install python3-certbot-apache -y

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

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

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/concrete5.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/concrete5.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://concrete5.example.com을 사용하여 Concrete 5에 안전하게 액세스할 수 있습니다.

결론

위의 가이드에서는 Apache와 함께 Concrete5 CMS를 설치하는 방법과 Ubuntu 20.04에서 Lets Encrypt SSL을 배웠습니다. 이제 Concrete5 CMS를 사용하여 인터넷에 콘텐츠를 쉽게 게시할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.