카테고리 없음

iwinv 서버에서 새 워드프레스 설치

kingcoin 2025. 12. 30.

파트너스 활동으로 소정의 수수료를 제공 받습니다.

좋아요 👍
iwinv 서버에서 새 워드프레스 설치는 아래 순서대로 하면 실수 없이 10~15분 컷입니다.
(지금 서버 상태도 깔끔해져서 설치하기 딱 좋아요)


✅ 전체 흐름 한눈에 보기

  1. 사이트 디렉터리 생성
  2. DB + DB 계정 생성
  3. 워드프레스 다운로드
  4. 권한 설정
  5. 웹에서 설치 마무리
  6. 보안·기본 세팅

1️⃣ 사이트 폴더 생성 (hosting 구조 기준)

지금 구조상 사이트는 여기로 가는 게 맞습니다:

/data/hosting/site

예: 새 도메인 example.com

mkdir -p /data/hosting/site/example.com
cd /data/hosting/site/example.com

2️⃣ 워드프레스 다운로드 & 배치

wget https://ko.wordpress.org/latest-ko_KR.tar.gz
tar -xzf latest-ko_KR.tar.gz
mv wordpress/* .
rm -rf wordpress latest-ko_KR.tar.gz

3️⃣ 권한 설정 (아주 중요)

웹서버 유저가 www-data 인 경우:

chown -R www-data:www-data /data/hosting/site/example.com
find /data/hosting/site/example.com -type d -exec chmod 755 {} \;
find /data/hosting/site/example.com -type f -exec chmod 644 {} \;

4️⃣ DB 생성 (MySQL / MariaDB)

MySQL 접속

mysql -u root -p

DB & 계정 생성

CREATE DATABASE wp_example DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'wp_example'@'localhost' IDENTIFIED BY '강력한비밀번호';
GRANT ALL PRIVILEGES ON wp_example.* TO 'wp_example'@'localhost';
FLUSH PRIVILEGES;
EXIT;

5️⃣ 웹서버 설정 (Nginx 기준)

서버 블록 생성

nano /etc/nginx/sites-available/example.com
server {
    listen 80;
    server_name example.com www.example.com;

    root /data/hosting/site/example.com;
    index index.php index.html;

    access_log /data/hosting/logs/example.com.access.log;
    error_log  /data/hosting/logs/example.com.error.log;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
        expires max;
        log_not_found off;
    }
}

활성화:

ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx

6️⃣ 웹에서 워드프레스 설치

브라우저에서 접속:

http://example.com

입력 정보:

  • DB 이름: wp_example
  • 사용자: wp_example
  • 비밀번호: 위에서 설정한 것
  • 호스트: localhost
  • 테이블 접두사: wp_ → 가능하면 wp9k_ 같이 변경 추천

7️⃣ 필수 보안 & 기본 세팅 (강력 추천)

wp-config.php 권한

chmod 640 wp-config.php

파일 수정 제한

define('DISALLOW_FILE_EDIT', true);

퍼머링크

  • 관리자 → 설정 → 고유주소
  • 글 이름 선택

🔐 SSL (Let’s Encrypt)

certbot --nginx -d example.com -d www.example.com

🎯 설치 후 바로 하면 좋은 것

  • 불필요 플러그인 ❌
  • 캐시 플러그인 1개만
  • 자동 백업은 외부(S3, Drive)
  • /data/hosting/logs logrotate 꼭 유지

댓글