Debian 10에서 Nginx와 함께 Textpattern CMS를 설치하는 방법
이 페이지에서
- 요구 사항\n
- 1단계: 필수 소프트웨어 설치.\n
- 2단계: Textpattern 다운로드
- 3단계: 데이터베이스 설정
- 4단계: Nginx 구성
- 5단계: 텍스트 패턴 구성
- 추가 정보
Textpattern은 무료 오픈 소스 PHP 콘텐츠 관리 시스템입니다. 테마와 플러그인을 통해 적절한 사용자 정의 기능을 제공하면서 다소 가볍고 빠르며 사용하기 쉽습니다. 이 가이드에서는 새로운 Debian 10 인스턴스에 Textpattern을 설치합니다.
요구 사항
- 루트 사용자 또는 sudo 권한이 있는 모든 사용자에 대한 액세스 권한이 있는 새로운 Debian 10 시스템.\n
- 서버를 가리키는 등록된 도메인 이름.
sudo 사용자로 로그인한 경우 이 설정을 위해 루트로 전환합니다.
sudo su -
$VISUAL 환경 변수를 원하는 텍스트 편집기로 설정합니다. 예를 들어 nano를 사용하려면:
echo "export VISUAL=nano" >> ~/.profile . ~/.profile
1단계: 필수 소프트웨어 설치.
시스템에서 패키지 캐시를 업데이트합니다.
apt update
그런 다음 Nginx, PHP-FPM, 필수 PHP 확장, MariaDB 및 certbot을 설치합니다.
apt install -y nginx mariadb-server php-fpm php-xml php-mysql php-json php-mbstring php-zip certbot
Nginx 및 MariaDB 서비스가 활성화되어 실행 중인지 확인합니다.
systemctl enable --now nginx.service mariadb.service
2단계: 텍스트 패턴 다운로드
Github의 릴리스에서 최신 textpattern 릴리스에 대한 다운로드 링크(.tar.gz 형식)를 복사하고 다음과 같이 wget을 사용하여 서버에 다운로드합니다.
wget https://github.com/textpattern/textpattern/releases/download/4.7.3/textpattern-4.7.3.tar.gz
그런 다음 아카이브의 압축을 풀고 내용을 webroot 디렉터리 내의 위치로 이동합니다.
tar -xzf textpattern*.tar.gz rm textpattern*.tar.gz mv textpattern* /var/www/html/textpattern
3단계: 데이터베이스 설정
기본 보안 향상을 수행하려면 mysql_secure_installation 스크립트를 실행하여 시작하십시오.
mysql_secure_installation
아래와 같이 질문에 답하고 루트 사용자의 보안 암호를 선택했는지 확인하십시오.
Enter current password for root (enter for none):Set root password? [Y/n] y New password: your_password Re-enter new password: your_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] y
다음으로 Textpattern에서 사용할 데이터베이스와 사용자를 생성합니다. 다음을 사용하여 MySQL 셸에 로그인합니다.
mysql -u root -p
루트 비밀번호를 입력한 후 다음 명령문을 발행하십시오. textpattern_user_password를 적절한 암호로 바꾸십시오.
MariaDB [(none)]> CREATE DATABASE textpattern_db; MariaDB [(none)]> CREATE USER textpattern_user IDENTIFIED BY 'textpattern_user_password'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON textpattern_db.* TO textpattern_user; MariaDB [(none)]> \q
4단계: Nginx 구성
먼저 다음 명령을 실행하여 도메인에 대한 SSL 인증서를 얻습니다.
certbot certonly --webroot --webroot-path /var/www/html -d "your_domain" -m ""
도메인이 올바르게 구성되었다고 가정하면 certbot은 HTTPS를 구성하는 데 사용할 인증서를 자동으로 얻습니다.
다음으로 기본 Nginx 서버 구성 파일을 비활성화합니다.
rm /etc/nginx/sites-enabled/default
그런 다음 /etc/nginx/sites-available에서 새 구성 파일을 엽니다.
$VISUAL /etc/nginx/sites-available/textpattern
다음 구성을 입력하여 your_domain을 도메인 이름으로 바꿉니다.
server { listen 80; #replace your_domain below server_name your_domain; return 301 https://$server_name$request_uri; } server { listen 443 ssl; #replace your_domain below server_name your_domain; root /var/www/html/textpattern; index index.php; ssl on; #replace your_domain below ssl_certificate /etc/letsencrypt/live/your_domain/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/your_domain/privkey.pem; location ~* \.php$ { fastcgi_pass unix:/run/php/php7.3-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } }
이 구성은 모든 HTTP 요청을 HTTPS로 리디렉션합니다. 특정 기본 설정이나 요구 사항이 있는 경우 수정할 수 있습니다. 만족스러우면 사이트 활성화 디렉토리에 심볼릭 링크를 만듭니다.
ln -s /etc/nginx/sites-available/textpattern /etc/nginx/sites-enabled/
그런 다음 다음을 사용하여 구문 오류가 있는지 확인합니다.
nginx -t
마지막으로 다음 명령을 실행하여 새 구성을 로드합니다.
systemctl reload nginx.service
5단계: 텍스트 패턴 구성
이제 Textpattern 설치에 액세스할 수 있지만 아직 구성되지 않았습니다. https://your_domain/textpattern/setup/으로 이동하여 웹 설치 프로그램을 시작합니다. 언어를 선택한 후 데이터베이스 세부 정보를 입력합니다.
- MySQL 사용자 이름: textpattern_user
- MySQL 암호: 2단계에서 textpattern_user에 대해 선택한 암호를 입력합니다.\n
- MySQL 서버: localhost
- MySQL 데이터베이스: textpattern_db
- 테이블 접두어: 공백으로 두기
설치 프로그램은 해당 구성을 생성하기 전에 입력된 데이터베이스 자격 증명을 확인합니다. 필요한 파일을 만듭니다.
$VISUAL /var/www/html/textpattern/textpattern/config.php
생성된 구성을 붙여넣고 파일을 저장한 후 종료합니다. CMS 관리자 계정 및 사이트 구성에 대한 정보를 입력하라는 메시지가 표시되는 웹 설치 프로그램의 다음 단계로 진행합니다. 완료되면 설정 디렉토리를 제거하십시오.
rm -rf /var/www/html/textpattern/textpattern/setup
그리고 Textpattern이 쓰기 권한이 필요한 디렉토리의 Nginx 시스템 사용자 소유권을 부여합니다.
chown -R www-data /var/www/html/textpattern/{files,images,themes}
이제 Textpattern 사이트를 사용할 준비가 되었습니다. 관리 인터페이스는 https://your_domain/textpattern에서 액세스할 수 있습니다.
추가 정보
- 이 가이드에서 certbot으로 인증서를 관리하는 방법에 대해 알아보세요.\n