웹사이트 검색

Ubuntu 20.04에서 Lets Encrypt SSL로 TYPO3 CMS를 설치하는 방법


이 튜토리얼은 다음 OS 버전에 대해 존재합니다.

  • 우분투 20.04(Focal Fossa)
  • 우분투 14.04 LTS(Trusty Tahr)

이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. LAMP 서버 설치
  4. TYPO3용 데이터베이스 만들기
  5. TYPO3 CMS 설치
  6. TYPO3용 Apache 구성
  7. TYPO3 CMS에 액세스
  8. Lets Encrypt로 TYPO3 보호\n
  9. 결론

TYPO3는 PHP로 작성된 무료 오픈 소스 콘텐츠 관리 시스템입니다. 오픈 소스 코드에 신뢰성과 진정한 확장성을 결합한 엔터프라이즈급 CMS입니다. 웹 서버에서 실행되며 Windows, Linux, macOS 등을 포함한 많은 운영 체제를 지원합니다. 간단하고 반응이 빠른 모바일 지원 및 보안 CMS이며 코드를 작성하지 않고도 쉽게 사용자 지정하고 확장할 수 있습니다. 웹 사이트를 빠르게 시작하고 실행하는 데 매우 인기 있고 훌륭한 선택입니다.

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

전제 조건

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

시작하기

먼저 시스템 패키지를 최신 버전으로 업데이트하는 것이 좋습니다. 다음 명령을 실행하여 모든 패키지를 업데이트할 수 있습니다.

apt-get update -y

모든 패키지가 최신 상태이면 다음 단계로 진행할 수 있습니다.

램프 서버 설치

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

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-xml php-cli php-zip curl git gnupg2 -y

모든 패키지를 설치한 후 php.ini 파일을 편집하고 몇 가지 권장 설정을 변경합니다.

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

다음 줄을 변경합니다.

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

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

systemctl restart apache2

TYPO3용 데이터베이스 생성

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

mysql

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

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

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

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

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

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

이 시점에서 MariaDB 데이터베이스가 구성되었습니다.

TYPO3 CMS 설치

먼저 공식 웹사이트에서 최신 버전의 TYPO3를 다운로드해야 합니다. curl 명령을 사용하여 다운로드할 수 있습니다.

curl -L -o typo3_src.tgz https://get.typo3.org/10.4.9

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

tar -xvzf typo3_src.tgz

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

mv typo3_src-10.4.9 /var/www/html/typo3

그런 다음 다음 명령을 사용하여 적절한 권한 및 권한을 부여하십시오.

chown -R www-data:www-data /var/www/html/typo3
chmod -R 775 /var/www/html/typo3

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

TYPO3에 대한 Apache 구성

다음으로 Apache 가상 호스트 구성 파일을 만들어 TYPO3 CMS를 호스팅합니다. 다음 명령으로 만들 수 있습니다.

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

다음 줄을 추가합니다.

<VirtualHost *:80>
     ServerAdmin 
     DocumentRoot /var/www/html/typo3
     ServerName typo3.example.com
     <Directory /var/www/html/typo3>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

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

</VirtualHost>

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

a2ensite typo3.conf
a2enmod rewrite

다음으로 Apache 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart apache2

이 시점에서 Apache 웹 서버는 TYPO3을 제공하도록 구성됩니다. 이제 다음 단계를 진행할 수 있습니다.

TYPO3 CMS에 액세스

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

새 서버에 TYPO3를 설치하는 경우 TYPO3 웹 루트 디렉토리에 FIRST_INSTALL 파일을 만들어야 합니다. 다음 명령으로 만들 수 있습니다.

touch /var/www/html/typo3/FIRST_INSTALL

다음으로 웹 페이지를 새로 고칩니다. 다음 페이지가 표시됩니다.

감지된 문제 없음을 클릭하고 설치를 계속하면 다음 페이지가 표시됩니다.

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

TYPO3 데이터베이스 이름을 선택하고 계속 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

그런 다음 관리자 사용자 이름, 비밀번호, 사이트 이름을 제공하고 계속 버튼을 클릭하십시오. TYPO3 로그인 페이지로 리디렉션됩니다.

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

Lets Encrypt로 TYPO3 보호

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

apt-get install python3-certbot-apache -y

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

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

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

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

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

결론

축하합니다! TYPO3 CMS를 성공적으로 설치하고 Ubuntu 20.04에서 Lets Encrypt SSL로 보안을 설정했습니다. 이제 웹 브라우저를 통해 웹 사이트와 블로그를 쉽게 만들 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.