Magento 설치 · 7 min read · Nov 26, 2025
우분투 20.04에서 Apache2 및 Let's Encrypt로 Magento 전자상거래 플랫폼 설치하기

Magento는 몇 분 안에 완전한 기능을 갖춘 전자상거래 상점을 만들 수 있는 무료 오픈 소스 전자상거래 웹 애플리케이션입니다. PHP로 작성되었으며 강력한 기능과 유연성, 사용자 친화적인 인터페이스를 결합합니다. 간단함과 강력한 관리 패널 덕분에 자가 호스팅 온라인 상점에 가장 인기 있는 솔루션 중 하나입니다. 사이트 관리, SEO, 카탈로그 관리, 제품 및 카탈로그 탐색, 주문 관리, 체크아웃, 프로모션 및 전환 도구 등 다양한 기능을 제공합니다.
이 튜토리얼에서는 우분투 20.04에서 Apache 및 Let’s Encrypt SSL과 함께 Magento 전자상거래 플랫폼을 설치하는 방법을 보여줍니다.
전제 조건
- 4GB RAM이 장착된 우분투 20.04 서버.
- 서버에 포인팅된 유효한 도메인 이름.
- 서버에 구성된 루트 비밀번호.
LAMP 서버 설치
Magento는 PHP로 작성된 웹 서버에서 실행되며 MariaDB를 데이터베이스로 사용합니다. 따라서 서버에 LAMP 스택을 설치해야 합니다.
먼저, 다음 명령어로 Apache 웹 서버와 MariaDB 서버를 설치합니다:
apt-get install apache2 mariadb-server mariadb-client -yMagento의 최신 버전은 PHP 7.1.3+ 및 7.2.x와만 호환됩니다. 따라서 서버에 필요한 확장 기능이 포함된 지원되는 PHP 버전을 설치해야 합니다.
기본적으로 우분투 20.04는 PHP 버전 7.4를 제공합니다. 따라서 다른 PHP 버전을 설치하기 위해 Ondrej PPA를 시스템에 추가해야 합니다.
다음 명령어로 Ondrej PHP PPA를 추가할 수 있습니다:
apt-get install software-properties-common -y
add-apt-repository ppa:ondrej/php다음으로, 리포지토리를 업데이트하고 다음 명령어를 사용하여 다른 필요한 확장 기능과 함께 PHP를 설치합니다:
apt-get install php7.2 libapache2-mod-php7.2 php7.2-bcmath php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql php7.2-cli php7.2-ldap php7.2-zip php7.2-curl wget curl unzip -y작업이 완료되면 다음 단계로 진행할 수 있습니다.
MariaDB 데이터베이스 구성
기본적으로 MariaDB는 보안이 설정되어 있지 않습니다. 따라서 MariaDB 루트 비밀번호를 보안하고 설정하는 것이 좋습니다. 다음 명령어로 수행할 수 있습니다:
mysql_secure_installation아래와 같이 모든 질문에 답변합니다:
Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] YMariaDB가 보안 설정이 완료되면 MariaDB 셸에 로그인합니다:
mysql -u root -pMariaDB 루트 비밀번호를 입력한 후 Magento용 데이터베이스와 사용자를 생성합니다:
MariaDB [(none)]> CREATE DATABASE magentodb;
MariaDB [(none)]> CREATE USER 'magento'@'localhost' IDENTIFIED BY 'password';다음으로, 다음 명령어로 Magento 데이터베이스에 모든 권한을 부여합니다:
MariaDB [(none)]> GRANT ALL ON magentodb.* TO 'magento'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;다음으로, 권한을 플러시하고 다음 명령어로 MariaDB 셸에서 종료합니다:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;작업이 완료되면 다음 단계로 진행할 수 있습니다.
Magento 다운로드
이 튜토리얼을 작성할 당시 Magento의 최신 버전은 2.3.5입니다. Magento 공식 다운로드 페이지에서 다운로드할 수 있습니다.
다운로드가 완료되면 다음 명령어로 다운로드한 파일을 Apache 웹 루트 디렉토리에 추출합니다:
mkdir /var/www/html/magento
tar -xvjf magento-ce* -C /var/www/html/magento/다음으로, Magento 디렉토리에 적절한 소유권과 권한을 부여합니다:
chown -R www-data:www-data /var/www/html/magento/
chmod -R 755 /var/www/html/magento/작업이 완료되면 다음 단계로 진행할 수 있습니다.
Magento용 Apache 구성
다음으로, Magento 웹사이트를 제공하기 위해 새로운 Apache 가상 호스트 구성 파일을 생성합니다.
nano /etc/apache2/sites-available/magento.conf다음 줄을 추가합니다:
ServerAdmin [email protected]
DocumentRoot /var/www/html/magento/
ServerName magento.linuxbuz.com
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
파일을 저장하고 닫은 후 다음 명령어로 Magento 가상 호스트와 Apache 재작성 모듈을 활성화합니다:
a2ensite magento.conf
a2enmod rewrite마지막으로, 다음 명령어로 Apache 서비스를 재시작하여 변경 사항을 적용합니다:
systemctl restart apache2이 시점에서 Apache 웹 서버는 Magento를 제공하도록 구성되었습니다.
Let’s Encrypt SSL로 Magento 보안 설정
Let’s Encrypt 무료 SSL로 웹사이트를 보안하는 것은 항상 좋은 생각입니다. 먼저, 서버에 Certbot 클라이언트를 설치하여 웹사이트에 대한 Let’s Encrypt SSL을 다운로드하고 구성합니다.
apt-get install certbot python3-certbot-apache -yCertbot이 설치되면 다음 명령어를 실행하여 웹사이트에 대한 Let’s Encrypt SSL을 다운로드하고 설치합니다:
certbot --apache -d magento.linuxbuz.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): [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
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for magento.linuxbuz.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/magento-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/magento-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/magento-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를 눌러 설치를 완료합니다.
Redirecting vhost in /etc/apache2/sites-enabled/magento.conf to ssl vhost in /etc/apache2/sites-available/magento-le-ssl.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://magento.linuxbuz.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=magento.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/magento.linuxbuz.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/magento.linuxbuz.com/privkey.pem
Your cert will expire on 2020-08-11. 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-leMagento 웹사이트에 접근하기
이 시점에서 Magento 웹사이트는 Let’s Encrypt SSL로 보안이 설정되었습니다.
이제 웹 브라우저를 열고 URL https://magento.linuxbuz.com을 입력합니다. Magento 웹 기반 설치 마법사로 리디렉션됩니다:

Agree and Setup Magento 버튼을 클릭합니다. Magento 준비 화면이 표시됩니다:

Start Readiness Check 버튼을 클릭합니다. 준비 점검이 완료되면 다음 화면이 표시됩니다:

Next 버튼을 클릭합니다. 데이터베이스 설정 화면이 표시됩니다:

Magento 데이터베이스 이름, 데이터베이스 사용자 이름, 비밀번호를 입력하고 Next 버튼을 클릭합니다. Magento 웹 구성 마법사가 표시됩니다:

Magento 상점 및 관리자 주소를 입력하고 HTTPS를 활성화한 후 Next 버튼을 클릭합니다. 상점 사용자 정의 화면이 표시됩니다:

선호하는 시간대, 통화, 언어를 설정하고 Next 버튼을 클릭합니다. 관리자 사용자 생성 화면이 표시됩니다:

관리자 사용자 이름, 이메일, 비밀번호를 입력하고 Next 버튼을 클릭합니다. 다음 화면이 표시됩니다:

Install Now 버튼을 클릭하여 설치를 시작합니다. 설치가 성공적으로 완료되면 다음 화면이 표시됩니다:

Magento 관리자 주소를 클릭합니다. Magento 관리자 페이지가 표시됩니다:

Magento 관리자 사용자 이름, 비밀번호를 입력하고 Sign in 버튼을 클릭합니다. 다음 화면에서 Magento 대시보드를 확인할 수 있습니다:

또한 URL https://magento.linuxbuz.com를 사용하여 Magento 상점에 접근할 수 있습니다. 다음 화면이 표시됩니다:

결론
축하합니다! 우분투 20.04에서 Let’s Encrypt SSL로 Magento를 성공적으로 설치했습니다. 이제 쉽게 자신의 온라인 상점을 배포할 수 있습니다. 질문이 있으면 언제든지 문의해 주세요.
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.