웹 개발 · 7 min read · Sep 26, 2025
Ubuntu 22.04 LTS에서 Apache 및 Let's Encrypt SSL로 CraftCMS 설치하는 방법

Craft는 개발자와 콘텐츠 작성자를 위한 오픈 소스, 유연하고 기능이 풍부한 콘텐츠 관리 시스템입니다. 강력한 웹사이트를 구축하는 데 필요한 모든 사용자 정의 기능을 제공합니다. 단일 대시보드에서 다양한 사이트의 콘텐츠를 관리할 수 있습니다. 맞춤형 디지털 경험을 구축하기 위한 WordPress 및 Drupal의 대안 솔루션입니다. 기능을 추가할 수 있는 수백 개의 무료 및 유료 플러그인이 있습니다.
이 게시물에서는 Ubuntu 22.04에서 Apache 및 Let’s Encrypt SSL로 Craft CMS를 설치하는 방법을 설명합니다.
필수 조건
- Ubuntu 22.04에서 실행되는 서버.
- 서버 IP에 포인팅된 유효한 도메인 이름.
- 서버에 구성된 루트 비밀번호.
LAMP 서버 설치
Craft CMS는 웹 서버에서 실행되며 PHP로 작성되었고 MariaDB를 데이터베이스 백엔드로 사용합니다. 따라서 이러한 모든 패키지를 서버에 설치해야 합니다.
다음 명령을 실행하여 모든 패키지를 설치할 수 있습니다:
apt-get install apache2 mariadb-server php php-cli libapache2-mod-php php-common php-json php-curl php-gd php-imagick php-json php-mbstring php-mysql php-pgsql php-zip php-intl php-xml -y모든 패키지를 설치한 후 PHP 구성 파일을 편집하고 기본 설정을 변경합니다:
nano /etc/php/8.1/php.ini다음 설정을 변경합니다:
memory_limit = 512M
post_max_size = 32M
upload_max_filesize = 32M
max_execution_time = 360파일을 저장하고 닫은 후 변경 사항을 적용하기 위해 Apache 서비스를 재시작합니다:
systemctl restart apache2CraftCMS용 데이터베이스 생성
다음으로, Fork CMS를 위한 데이터베이스와 사용자를 생성해야 합니다. 먼저 다음 명령으로 MariaDB 셸에 로그인합니다:
mysql로그인한 후 다음 명령으로 데이터베이스와 사용자를 생성합니다:
MariaDB [(none)]> CREATE DATABASE craftcms;
MariaDB [(none)]> GRANT ALL ON craftcms.* TO 'craftuser' IDENTIFIED BY 'password';다음으로, 권한을 플러시하고 다음 명령으로 MariaDB 셸에서 종료합니다:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;이 시점에서 Craft CMS를 위한 MariaDB 데이터베이스가 생성되었습니다. 이제 다음 단계로 진행할 수 있습니다.
Compose를 사용하여 Craft CMS 설치
다음으로, Craft CMS의 최신 버전을 다운로드하기 위해 Composer를 설치해야 합니다. 다음 명령을 사용하여 설치할 수 있습니다:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composerComposer가 설치되면 Apache 웹 루트 디렉토리로 이동하여 다음 명령을 사용하여 Craft CMS 프로젝트를 생성합니다:
cd /var/www/html
composer create-project craftcms/craft craftcms데이터베이스 설정, 관리자 사용자 이름, 비밀번호, 사이트 URL을 제공하라는 메시지가 표시됩니다:
Which database driver are you using? (mysql or pgsql) [mysql]
Database server name or IP address: [127.0.0.1]
Database port: [3306]
Database username: [root] craftuser
Database password:
Database name: craft
Database table prefix:
Testing database credentials ... success!
Saving database credentials to your .env file ... done
Install Craft now? (yes|no) [yes]:yes
Username: [admin] admin
Email: [email protected]
Password:
Confirm:
Site name: CraftCMS Site
Site URL: http://craftcms.example.com
Site language: [en-US]
> add foreign key fk_rlbmgnhpxsljkaunjwnsezfrnrkhwzpthfsq: {{%widgets}} (userId) references {{%users}} (id) ... done (time: 0.035s)
> populating the info table ... done
> saving default site data ... done
> saving the first user ... done
*** installed Craft successfully (time: 5.449s)다음으로, Craft CMS 디렉토리에 적절한 권한과 소유권을 설정합니다:
chown -R www-data:www-data /var/www/html/craftcms/
chmod -R 755 /var/www/html/craftcms/작업이 완료되면 다음 단계로 진행할 수 있습니다.
Craft CMS를 위한 Apache 구성
다음으로, Craft CMS를 위한 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 생성할 수 있습니다:
nano /etc/apache2/sites-available/craftcms.conf다음 줄을 추가합니다:
ServerAdmin [email protected]
DocumentRoot /var/www/html/craftcms/web
ServerName craftcms.example.com
Options FollowSymlinks
AllowOverride All
Require all granted
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]
파일을 저장하고 닫은 후 다음 명령을 사용하여 Apache 가상 호스트 및 재작성 모듈을 활성화합니다:
a2ensite craftcms.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 Fri 2022-06-17 15:48:11 UTC; 31min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 37935 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Process: 40916 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 37939 (apache2)
Tasks: 6 (limit: 2292)
Memory: 53.0M
CPU: 28.718s
CGroup: /system.slice/apache2.service
??37939 /usr/sbin/apache2 -k start
??40920 /usr/sbin/apache2 -k start
??40921 /usr/sbin/apache2 -k start
??40922 /usr/sbin/apache2 -k start
??40923 /usr/sbin/apache2 -k start
??40924 /usr/sbin/apache2 -k start
Jun 17 15:48:11 ubuntu2204 systemd[1]: Starting The Apache HTTP Server...Apache 웹 서버가 구성되면 다음 단계로 진행할 수 있습니다.
Craft CMS 웹 인터페이스에 접근
이제 웹 브라우저를 열고 URL http://craftcms.example.com을 입력하여 Craft CMS 웹 인터페이스에 접근합니다. 다음 페이지가 표시되어야 합니다:

제어판으로 이동을 클릭합니다. Craft CMS 로그인 페이지로 리디렉션됩니다:

관리자 사용자 이름, 비밀번호를 제공하고 로그인 버튼을 클릭합니다. 다음 페이지에서 Craft CMS 대시보드를 볼 수 있어야 합니다:

Let’s Encrypt SSL로 Craft CMS 보안 설정
다음으로, Let’s Encrypt SSL로 웹사이트를 보안 설정하는 것이 좋습니다. 먼저 다음 명령으로 Certbot 클라이언트 패키지를 설치합니다:
apt-get install python3-certbot-apache -y설치가 성공적으로 완료된 후, 다음 명령을 실행하여 Let’s Encrypt SSL로 웹사이트를 보안 설정합니다:
certbot --apache -d craftcms.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): [email protected]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 craftcms.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/craftcms-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/craftcms-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/craftcms-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): 22를 입력하고 Enter를 눌러 웹사이트에 Let’s Encrypt SSL을 설치합니다:
Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/craftcms.conf to ssl vhost in /etc/apache2/sites-available/craftcms-le-ssl.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://craftcms.example.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=craftcms.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/craftcms.example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/craftcms.example.com/privkey.pem
Your cert will expire on 2022-09-17. 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결론
축하합니다! Ubuntu 22.04에서 Apache 및 Let’s Encrypt SSL로 Craft CMS를 성공적으로 설치했습니다. 이제 CraftCMS 기능을 탐색하고 Craft CMS를 사용하여 강력한 웹사이트를 만들기 시작할 수 있습니다. 질문이 있으면 언제든지 문의해 주세요.
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.