b2br_bonus - KimTaebin-ai/study_posts GitHub Wiki

λ³΄λ„ˆμŠ€ μ–΄μ©Œκ΅¬ μ €μ©Œκ΅¬

sudo apt install lighttpd
sudo systemctl stop lighttpd.service		# μ„œλ²„ 쀑지
sudo systemctl start lighttpd.service		# μ„œλ²„ μ‹œμž‘
sudo systemctl enable lighttpd.service	# λΆ€νŒ… μ‹œ μ„œλ²„ μ‹€ν–‰
sudo systemctl disable lighttpd.service	# λΆ€νŒ… μ‹œ μ„œλ²„ μ‹€ν–‰ 정지
sudo apt install php-fpm
sudo vim /etc/lighttpd/conf-available/15-fastcgi-php.conf
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/run/lighttpd/php.socket",
이거 2개 μ£Όμ„μ²˜λ¦¬

"socket" => "/var/run/php/php8.2-fpm.sock",
μœ„ λ‚΄μš© μΆ”κ°€
sudo lighttpd-enable-mod fastcgi
sudo lighttpd-enable-mod fastcgi-php
sudo service lighttpd force-reload
sudo ufw allow 80

VirtualBox 의 포트 ν¬μ›Œλ”© λ‚΄μš© μΆ”κ°€

Host IP / Host Port : 둜컬 컴퓨터 IP μ£Όμ†Œ, 8080 Guest IP / Guest Port : 가상 λ¨Έμ‹  IP μ£Όμ†Œ, 80

둜컬 μ»΄ν“¨ν„°μ˜ λΈŒλΌμš°μ €μ—μ„œ

둜컬 컴퓨터 IPμ£Όμ†Œ:8080 λ₯Ό μ£Όμ†Œμ°½μ— μž…λ ₯ν•˜λ©΄ νŽ˜μ΄μ§€κ°€ λœ¬λ‹€.

sudo apt install php8.2-mysql
sudo apt install mariadb-server mariadb-client -y
sudo systemctl stop mysql.service			# μ„œλ²„ 쀑지
sudo systemctl start mysql.service		# μ„œλ²„ μ‹œμž‘
sudo systemctl enable mysql.service		# λΆ€νŒ… μ‹œ μ„œλ²„ μ‹€ν–‰
sudo systemctl disable mysql.service	# λΆ€νŒ… μ‹œ μ„œλ²„ μ‹€ν–‰ 정지
sudo mysql_secure_installation

μ „λΆ€ y둜 λ„˜μ–΄κ°€λ„ 됨 (λΉ„λ°€λ²ˆν˜Έ μž¬μ„€μ •μ€ λΉ„μΆ”)
sudo systemctl restart mysql.service
sudo mysql -u root
# DB 생성
CREATE DATABASE wpdb;
# 계정 생성 및 νŒ¨μŠ€μ›Œλ“œ μ„€μ •
CREATE USER 'wp-user'@'localhost' IDENTIFIED BY 'wp-pw';
# 계정이 DB에 μ ‘κ·Όν•  수 μžˆλŠ” λͺ¨λ“  κΆŒν•œ λΆ€μ—¬
GRANT ALL ON wpdb.* TO 'wp-user'@'localhost' IDENTIFIED BY 'wp-pw' WITH GRANT OPTION;
# 섀정을 마침
FLUSH PRIVILEGES;
# μ’…λ£Œ
EXIT;
sudo apt install wget -y
sudo wget -O /tmp/wordpress.tar.gz "http://wordpress.org/latest.tar.gz"
sudo tar -xvzf /tmp/wordpress.tar.gz -C /var/www/html
sudo vim /var/www/html/wordpress/wp-config-sample.php

μœ„μ—μ„œ μ„€μ •ν–ˆλ˜ DB_NAME,DB_USER, DB_PASSWORD μž…λ ₯

define 8쀄 μžˆλŠ”κ±° μ—¬κΈ° λ“œκ°€μ„œ 볡뢙 https://api.wordpress.org/secret-key/1.1/salt/

sudo mv /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php

μ›Œλ“œν”„λ ˆμŠ€ ν‚€λ©΄ 이제 λ– μ•Ό 정상

sudo apt install phpmyadmin

N0 선택 ν›„ lighttpd μ—”ν„°
sudo service lighttpd force-reload

phpmyadmin 켰을 λ•Œ λ‚˜μ™€μ•Ό 정상

μ‚¬μš©μžλͺ…κ³Ό λΉ„λ°€λ²ˆν˜ΈλŠ” μœ„μ—μ„œ μ„€μ •ν–ˆλ˜ κ±° κ·ΈλŒ€λ‘œ