/////
Search
🐳

WordPress

워드프레스(WordPress)는 세계 최대의 자유 오픈소스 소프트웨어 저작물 관리 시스템이다.
PHP로 작성 되었으며 MySQL 또는 MariaDB가 주로 사용된다.
Debian에 워드프레스를 설치하려면 PHP를 사용할 수 있는 Web ServerDatabase가 필요하다.
Web Server
lighttpd
Database
MariaDB

 lighttpd 설치

$ sudo apt-get install lighttpd # sudo systemctl stop lighttpd.service # sudo systemctl start lighttpd.service # sudo systemctl enable lighttpd.service
Shell
복사
80포트를 통해 들어오는 연결 허용 ( http 기본 포트 )
$ sudo ufw allow 80
Shell
복사

 MariaDB 설치

1.
설치
$ sudo apt install mariadb-server
Shell
복사
2.
설정
$ sudo mysql_secure_installation # Database의 root 비밀번호 입력 Enter current password for root (enter for none): 그냥 엔터 (시스템 root랑 혼동 X) # root의 패스워드를 설정 할 것인가? Set root password? [Y/n] n # 알 수 없는 user들을 삭제하는가? Remove anonymous users? [Y/n] Y # root로의 원격 로그인을 금지하는가? Disallow root login remotely? [Y/n] Y # test 데이터베이스를 삭제하고 접근 할 수 있게 하는가? Remove test database and access to it? [Y/n] Y # 적용 Reload privilege tables now? [Y/n] Y
Shell
복사
3.
mariaDB 접속
$ sudo mariadb # 이렇게 나오면 mariadb에 접속 완료 MariaDB [(none)]>
Shell
복사
4.
데이터베이스 생성
MariaDB [(none)]> CREATE DATABASE <database-name>;
Shell
복사
5.
생성한 데이터베이스를 새로운 유저에게 권한을 할당
MariaDB [(none)]> GRANT ALL ON <database-name>.* TO '<username>'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;
Shell
복사
6.
설정 적용
MariaDB [(none)]> FLUSH PRIVILEGES;
Shell
복사
7.
다시 접속 해보기
MariaDB [(none)]> exit Bye $ mariadb -u <username> -p Enter pasword: # 패스워드 입력 MariaDB [(none)]>
Shell
복사
8.
데이터베이스 목록 확인
MariaDB [(none)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | <database-name> | | information_schema | +--------------------+ 2 rows in set (0.000 sec)
Shell
복사
9.
Exit
MariaDB [(none)]> exit
Shell
복사

 PHP

1.
설치
$ sudo apt install php-cgi php-mysql
Shell
복사
2.
wget 설치
$ sudo apt install wget
Shell
복사
3.
/var/www/htmlWordPress 다운로드
$ sudo wget http://wordpress.org/latest.tar.gz -P /var/www/html
Shell
복사
4.
tar 해제
$ sudo tar -zxvf /var/www/html/latest.tar.gz
Shell
복사
5.
tar 파일 삭제
$ sudo rm /var/www/html/latest.tar.gz
Shell
복사
6.
/var/www/html/wordpress 의 content들을 /var/www/html로 모두 복사
$ sudo cp -r /var/www/html/wordpress/* /var/www/html
Shell
복사
7.
/var/www/html/wordpress 삭제
$ sudo rm -rf /var/www/html/wordpress
Shell
복사
8.
WordPress 샘플 설정 파일 생성
$ sudo cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
Shell
복사
9.
WordPress 데이터베이스 설정
$ sudo vi /var/www/html/wp-config.php
Shell
복사
→ 원본
→ 수정
define( 'DB_NAME', '<database-name>'); define( 'DB_USER', '<username>'); define( 'DB_PASSWORD', '<password>');
Shell
복사

 lighttpd 설정

$ sudo lighty-enable-mod fastcgi $ sudo lighty-enable-mod fastcgi-php $ sudo service lighttpd force-reload
Shell
복사

포트포워딩

<ip-addr>:8080
Shell
복사

Reference