[워드프레스] 우분투에 설치

  • Post author:
  • Post category:ETC
  • Post comments:0 Comments

계정 추가 및 www 폴더 생성

sudo adduser blog
cd /home/blog
sudo mkdir ./www
sudo chmod 755 ./www
cd ./www

다운로드

wget -c http://wordpress.org/latest.tar.gz

압축 해제

tar -xzvf latest.tar.gz

권한 설정

sudo chown -R blog:www-data /home/blog/www/wordpress
sudo chmod -R 775 /home/blog/www/wordpress

WordPress 데이터베이스 생성

sudo mysql -u root -p 

MariaDB [(none)]> CREATE DATABASE blog;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON blog.* TO 'blog'@'localhost' IDENTIFIED BY  'passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

wp-config.php 파일 생성

cd /home/blog/www/wordpress
sudo mv wp-config-sample.php wp-config.php

wp-config.php 파일 수정

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'blog' );

/** Database username */
define( 'DB_USER', 'blog' );

/** Database password */
define( 'DB_PASSWORD', 'passwd' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

nginx 설정

cd /etc/nginx/sites-available
sudo mkdir ./blog
sudo vi ./blog


server {
	root /home/blog/www/wordpress;
	
	index index.html index.htm index.php;

	server_name blog.goodzz.site;

	location / {        
		index index.php index.html;
		try_files $uri $uri/ /index.php?q=$uri&$args;
	}
	
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		
		fastcgi_pass unix:/run/php/php8.1-fpm.sock;
		fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		include fastcgi_params;

		fastcgi_buffers 8 512k;
   	 fastcgi_buffer_size 256k;
    	fastcgi_send_timeout 5m;
    	fastcgi_read_timeout 5m;
    	fastcgi_connect_timeout 5m;
	}
}
//저장


//심볼릭 링크
sudo cp -s /etc/nginx/sites-available/blog /etc/nginx/sites-enabled/blog

한글설정

좌측 하단에 있는 Setting 메뉴 클릭 

Site Language를 한국어로 변경
Timezone을 UTC+9로 변경
Save Changes

Site Language에 한국어가 선택이 되지 않을때
아래 링크에서 소스파일 다운
wordpress > wp-content > languages 폴더 복사 후 해당 계정에 복사

FTP 자격증명 요청시

//wp-conpig.php 파일에 추가 
define('FS_METHOD', 'direct');

플러그인 및 테마 설치 권한 오류

참고 링크 : https://medium.com/ksbgenius/%EC%9B%8C%EB%93%9C%ED%94%84%EB%A0%88%EC%8A%A4-%EC%86%8C%EC%9C%A0%EC%9E%90-%EB%B0%8F-%EA%B6%8C%ED%95%9C-%EC%84%A4%EC%A0%95-fc85fd2234cf

//www-data 그룹에 blog 유저 추가.
sudo usermod -a -G www-data blog

//wp-content 폴더 775 권한 설정
cd /home/blog/www/wordpress
chmod 775 ./wp-content

//워드프레스 하위 폴더 권한 일괄 설정 (기본:755)
cd ./wp-content
find ./ -type d -exec chmod 0775 {} \;
guest
0 Comments
Inline Feedbacks
View all comments