1. nginx๋ ์ฐ๋ํ๋ ์คํฌ๋ฆฝํธ ์์ฑ์ฉ ํ์ผ ์์ฑ : sudo vim /etc/nginx/conf.d/php_vhost.conf.include
2. ๋ด์ฉ ์ถ๊ฐ
index index.php index.html index.htm;
root $documentRoot;
location ~ \.php$ {
root $documentRoot;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $documentRoot/$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_read_timeout 600;
}
3. nginx๋ ์ฐ๋ํ๋ ์๋ฒ ๋ฑ๋ก์ฉ ์ค์ ํ์ผ ์์ฑ
: sudo vim /etc/nginx/conf.d/vhost.conf
4. ๋ด์ฉ ์ถ๊ฐ
server {
listen 8011;
server_name _;
set $documentRoot /web/site1/public;
location / {
try_files $uri $uri/ /index.php?$args;
}
include /etc/nginx/conf.d/php_vhost.conf.include;
}
server {
listen 8012;
server_name _;
set $documentRoot /web/site1/public;
location / {
try_files $uri $uri/ /index.php?$args;
}
include /etc/nginx/conf.d/php_vhost.conf.include;
}
.
.
.
5. nginx ์ฌ์์ : sudo systemctl restart nginx
6. editPlus ๋ค์ด
7. ์๋ํธ ํ๋ฌ์ค ์ ์ > ํ์ผ > FTP > FTP ์ค์
8. ์ถ๊ฐ > ์ ๋ณด ์
๋ ฅ > ํ์ธ
9. ์ฐ๊ฒฐํ ๊ณ์ ์ ํ
10. public > ๊ธฐ์กด ํ์ผ ์ญ์ > gugudan.php ์์ฑ > ๋ด์ฉ ์ถ๊ฐ
<?php
$dan = intval($_GET['dan']);
$limit = intval($_GET['limit']);
?>
<h1>== <?=$dan?>๋จ ==</h1>
<?php for ( $i = 1; $i <= $limit; $i++ ) { ?>
<div><?=$dan?> * <?=$i?> = <?=$dan * $i?></div>
<?php } ?>
11. ์ฌ์ดํธ ํ์ธ : 192.168.56.101:ํฌํธ_๋ฒํธ/gugudan.php?dan=์์์ซ์&limit=์์์ซ์