๐Ÿ”ผ0607[Azure]

๋ง์ง€ยท2022๋…„ 6์›” 7์ผ
0
post-custom-banner

๐Ÿ“Œ Azure-mariaDB์„œ๋ฒ„์™€ ์—ฐ๊ฒฐ๋œ wordpress ์›น์„œ๋ฒ„ ๋งŒ๋“ค๊ธฐ

๐Ÿ“˜ ์›น์„œ๋ฒ„ ๋งŒ๋“ค๊ธฐ

โœ”๏ธ 0. ๊ฐ€์ƒ๋จธ์‹  - ๋งŒ๋“ค๊ธฐ - ๋ฆฌ์†Œ์Šค๊ทธ๋ฃน ์ƒˆ๋กœ๋งŒ๋“ค๊ธฐ - ์ด๋ฆ„ : rg-test
โœ”๏ธ 1. ๊ฐ€์ƒ๋จธ์‹  ์ด๋ฆ„ : webserver - ๊ฐ€์šฉ์„ฑ ์˜์—ญ : Zone 1 - ์ด๋ฏธ์ง€ : [smalldisk]window server 2012
R2 Datacenter-Gen2
โœ”๏ธ 2. ์‚ฌ์šฉ์ž ์ด๋ฆ„ : azureusr - ์•”ํ˜ธ ์ž…๋ ฅ
โœ”๏ธ 3. ์ธ๋ฐ”์šด๋“œ ํฌํŠธ ์„ ํƒ : RDP, HTTP - ๋‹ค์Œ : ๋””์Šคํฌ
โœ”๏ธ 4. ์ƒˆ ๋””์Šคํฌ ๋งŒ๋“ค๊ธฐ ๋ฐ ์—ฐ๊ฒฐ - ์ด๋ฆ„ ๊ทธ๋Œ€๋กœ, ์›๋ณธ์œ ํ˜• ๊ทธ๋Œ€๋กœ(์—†์Œ(๋นˆ ๋””์Šคํฌ))- ํฌ๊ธฐ : ํฌ๊ธฐ๋ณ€๊ฒฝ - 8GiB - ํ™•์ธ - ๋‹ค์Œ : ๋„คํŠธ์›Œํฌ - ๋‹ค์Œ : ๊ด€๋ฆฌ - ๋‹ค์Œ : ํƒœ๊ทธ - ๋‹ค์Œ : ๊ฒ€ํ†  + ๋งŒ๋“ค๊ธฐ -๋งŒ๋“ค๊ธฐ

๐Ÿ“˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋งŒ๋“ค๊ธฐ

โœ”๏ธ0. ๊ฒ€์ƒ‰์ฐฝ - maria db- ๋ฆฌ์†Œ์Šค ๊ทธ๋ฃน : rg-test

โœ”๏ธ 1. ์„œ๋ฒ„์ด๋ฆ„ : kosa14 - ์ปดํ“จํŒ… + ์Šคํ† ๋ฆฌ์ง€ -์„œ๋ฒ„๊ตฌ์„ฑ -์ปดํ“จํ„ฐ ๊ณ„์ธต : ๊ธฐ๋ณธ , vCore: 2, ์Šคํ† ๋ฆฌ์ง€ ํฌ๊ธฐ : 5GB


โœ”๏ธ 2. ์‚ฌ์šฉ์ž ์ด๋ฆ„ : azureuser - ์•”ํ˜ธ ์ž…๋ ฅ - ๋‹ค์Œ : ํƒœ๊ทธ - ๋‹ค์Œ : ๊ฒ€ํ†  + ๋งŒ๋“ค๊ธฐ - ๋งŒ๋“ค๊ธฐ

๐Ÿ“˜ ์ƒˆ๋””์Šคํฌ ์—ฐ๊ฒฐํ•˜๊ธฐ

์ƒ์„ฑํ•œ ์›น์„œ๋ฒ„(๊ฐ€์ƒ๋จธ์‹ ) ๊ณต์šฉ Ip๋ณต์‚ฌ ํ›„ ์›๊ฒฉ ๋ฐ์Šคํฌํ†ฑ ์‹คํ–‰ํ•˜์—ฌ ์ ‘์†ํ•˜์—ฌ ์ง„ํ–‰
โœ”๏ธ 1. (attatch)
servermanager - tool - computer management - disk management - OK

โœ”๏ธ 2. (format , mount)
disk2 ๊ณต๊ฐ„์— ๋งˆ์šฐ์Šค์˜ค๋ฅธ์ชฝ๋ฒ„ํŠผ - New simple volume wizard - next - next - f drive, next - next - finish

โœ”๏ธ 3. ํƒ์ƒ‰์ฐฝ์—์„œ Fํด๋” ํ™•์ธ ๊ฐ€๋Šฅ

โœ”๏ธ 3-1. ์ด ํด๋”์— mariadb key, webplatfrom, ์›Œ๋“œํ”„๋ ˆ์Šค ํŒŒ์ผ(zipํŒŒ์ผ ํ•ด์ œ) ๋„ฃ์–ด๋‘๊ธฐ

๐Ÿ“˜ IIS ์„ค์น˜

โœ”๏ธ 1. servermanager - manage - add roles and features

โœ”๏ธ 2. next - role-based , next- ๊ทธ๋Œ€๋กœ, next - IIS ์ฒดํฌ , Add Features ,next - ๊ทธ๋Œ€๋กœ, next - next - next - ์ฒดํฌ์•ˆํ•˜๊ณ , install

โœ”๏ธ 3. F:์— ๋„ฃ์–ด๋‘” webplatfrominstaller msi์‹คํ–‰ํ•ด์„œ IIS ์„ค์น˜ ์ง„ํ–‰
โœ”๏ธ 4. servermanager - tools - IIS manager - ์™ผ์ชฝ๋ฉ”๋‰ด , webserver - ์ฐฝ ๋‚ด๋ถ€ : webplatform intaller ์‹คํ–‰

โœ”๏ธ 4-1. products - php ๊ฒ€์ƒ‰ -php7.4.13 ADD - install - i accept - finish


โœ”๏ธ 5. C:\inetpub\wwwroot์— F:์— ์••์ถ• ํ’€์–ด๋‘” wordpress ๋‚ด๋ถ€ํŒŒ์ผ, Baltmore key ๋ณต์‚ฌ-๋ถ™์—ฌ๋„ฃ๊ธฐ.

โœ”๏ธ 6. wwwroot ํด๋” ์œ ์ €๊ถŒํ•œ ์ˆ˜์ •. Users, IIS modift, write ๊ถŒํ•œ์ฃผ๊ธฐ.

๐Ÿ“˜ DB์„œ๋ฒ„ ์ •๋ณด

์„œ๋ฒ„ ์ด๋ฆ„
: kosa14.mariadb.database.azure.com
์„œ๋ฒ„ ๊ด€๋ฆฌ์ž ๋กœ๊ทธ์ธ ์ด๋ฆ„
: azureuser@kosa14

๐Ÿ“˜ ํ˜ธ์ŠคํŠธ PC CLI ํ™˜๊ฒฝ์—์„œ์˜ ssh key๋ฐ mysql ์„ค์ •

home๋””๋ ‰ํ† ๋ฆฌ์— baltimore ํ‚ค ์žˆ๋Š” ์ƒํ™ฉ

โœ”๏ธ mobaxterm - start local terminal์—์„œ ์•„๋ž˜ ๋ช…๋ น์–ด ์ž…๋ ฅ

๎ƒจ 07/06/2022 ๎‚ฐ ๎ƒฉ 16:12.32 ๎‚ฐ ๎ƒช /home/mobaxterm ๎‚ฐ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mobaxterm/.ssh/id_rsa):
Created directory '/home/mobaxterm/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mobaxterm/.ssh/id_rsa.
Your public key has been saved in /home/mobaxterm/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:hNxfhwSwL+JzaIh0AitaO2YKyMxW03S/yxQb1mRDFug r2com@DESKTOP-DD3FU43
The key's randomart image is:
+---[RSA 2048]----+
|        ..o=o    |
|     . o oo. .   |
|.    .o.=  +o .  |
| o  o ...E+...   |
|o +o... S=o.     |
|Bo.=.o o..=      |
|+=* . = .+       |
|o+ . . oo .      |
|.        o       |
+----[SHA256]-----+

 07/06/2022 ๎‚ฐ ๎ƒฉ 16:13.08 ๎‚ฐ ๎ƒช /home/mobaxterm ๎‚ฐ cd .ssh
                                                                                      โœ” 

 ๎ƒจ 07/06/2022 ๎‚ฐ ๎ƒฉ 16:14.27 ๎‚ฐ ๎ƒช /home/mobaxterm/.ssh ๎‚ฐ ls
id_rsa      id_rsa.pub
                                                                                      โœ”

 ๎ƒจ 07/06/2022 ๎‚ฐ ๎ƒฉ 16:14.27 ๎‚ฐ ๎ƒช /home/mobaxterm/.ssh ๎‚ฐ mv id_rsa id_rsa.pem
                                                                                      โœ”

 ๎ƒจ 07/06/2022 ๎‚ฐ ๎ƒฉ 16:15.26 ๎‚ฐ ๎ƒช /home/mobaxterm/.ssh ๎‚ฐ ls
id_rsa.pem  id_rsa.pub

โœ”๏ธ ์™ธ๋ถ€ IP ํ™•์ธ ๋ช…๋ น์–ด


 ๎ƒจ 07/06/2022 ๎‚ฐ ๎ƒฉ 16:15.27 ๎‚ฐ ๎ƒช /home/mobaxterm/.ssh ๎‚ฐ curl ipconfig.io
123.142.252.25

โœ”๏ธ mysql ์„ค์น˜์—ฌ๋ถ€ ํ™•์ธ ( access denied ๋œจ๋ฉด ์„ค์น˜๋œ ๊ฒƒ)

 ๎ƒจ 07/06/2022 ๎‚ฐ ๎ƒฉ 16:21.43 ๎‚ฐ ๎ƒช /home/mobaxterm/.ssh ๎‚ฐ mysql
ERROR 1045 (28000): Access denied for user 'r2com'@'localhost' (using password: NO)

๐Ÿ“˜ Azure mariaDB ์„ค์ •

โœ”๏ธ ์ƒ์„ฑํ•œ db์„œ๋ฒ„ ๋ฆฌ์†Œ์Šค ๋ณด๊ธฐ - SSL ์ ์šฉ์ƒํƒœ '์‚ฌ์šฉ๋จ'ํด๋ฆญ - ํ˜„์žฌํด๋ผ์ด์–ธํŠธ IP ์ฃผ์†Œ ์ถ”๊ฐ€ ํด๋ฆญ - webserver ip๋ฅผ ์‹œ์ž‘, ์ข…๋ฃŒIP์— ๋„ฃ์–ด์ฃผ๊ณ  ์ €์žฅ

โœ”๏ธ mobaxterm์—์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ์ง„ํ–‰

 07/06/2022 ๎‚ฐ ๎ƒฉ 16:34.27 ๎‚ฐ ๎ƒช /home/mobaxterm ๎‚ฐ mysql -h kosa14.mariadb.database.azure.com -u azureuser@kosa14 -p --ssl-ca=BaltimoreCyberTrustRoot.crt.pem
Enter password: *********
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 64346
Server version: 5.6.47.0 MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> CREATE USER 'wpuser'@'%' IDENTIFIED BY 'wppass';
Query OK, 0 rows affected (0.024 sec)

MySQL [(none)]> CREATE DATABASE IF NOT EXISTS wordpress;
Query OK, 1 row affected (0.056 sec)

MySQL [(none)]> GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'%';
Query OK, 0 rows affected (0.029 sec)

MySQL [(none)]> quit
Bye

โœ”๏ธ ๋‹ค์‹œ ์›น์„œ๋ฒ„ ์›๊ฒฉ์ ‘์†ํ•˜์—ฌ wp-config-sample.phpํŒŒ์ผ ๋ณต๋ถ™ํ•ด์„œ copyํŒŒ์ผ ์ƒ์„ฑ - copy ํŒŒ์ผ์„ wp-config.php๋กœ ์ด๋ฆ„๋ณ€๊ฒฝ ํ›„ ๋ฉ”๋ชจ์žฅ์œผ๋กœ ์—ด์–ด์„œ ํ•ด๋‹น ๋ถ€๋ถ„ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ฐ”๊ฟ”์ฃผ๊ธฐ ๋ฐ ์ถ”๊ฐ€.

* @package WordPress
 */

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

/** MySQL database username */
define('DB_USER', 'wpuser@kosa14');

/** MySQL database password */
define('DB_PASSWORD', 'wppass');

/** MySQL hostname */
define('DB_HOST', 'kosa14.mariadb.database.azure.com');

/** 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', '');

//** Connect with SSL** //
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);

//** SSL CERT **//
define('MYSQL_SSL_CERT','BaltimoreCyberTrustRoot.crt.pem');

โœ”๏ธIIS manager ์ ‘์†, ์™ผ์ชฝ ์„œ๋ฒ„์ด๋ฆ„ ํด๋ฆญ - sites - default web site - ์˜ค๋ฅธ์ชฝ restart ํด๋ฆญ

๐Ÿ“Œ ๊ธฐํƒ€

โญ๏ธ LAMP

(Linux Apache MariaDB php)

โญ๏ธ WIMP

(Window IIS MariaDB php)

profile
๊พธ์ค€ํžˆ, ์ฐจ๊ทผ์ฐจ๊ทผ
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€