AB Lab

abgata20000 blog.

Nginxのインストール

1
vim /etc/yum.repos.d/nginx.repo
/etc/yum.repos.d/nginx.repo
1
2
3
4
5
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sudo yum install -y nginx

cd /etc/nginx
sudo mkdir sites-avalable
sudo mkdir sites-enabled
# sudo rm -f conf.d/*.conf

cd conf.d
cp default.conf default.conf.org
cp example_ssl.conf example_ssl.conf.org


cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.org

sudo vim /etc/nginx/nginx.conf
/etc/nginx/nginx.conf
1
2
3
# 下から二行目に追加

include /etc/nginx/sites-enabled/*;

自動起動をON

1
2
3
service nginx start

chkconfig nginx on