티스토리 뷰
CentOS Linux release 7.9.2009 (Core)
1. 패키지 설치!
root@todle-todle:~:# yum -y install wget libxml2-devel libxml2-static libxslt libxslt-devel gd gd-devel openssl-devel
root@todle-todle:~:# yum -y groupinstall "Development Tools"
2. 컴파일 설치!
root@todle-todle:~:# wget https://nginx.org/download/nginx-1.19.4.tar.gz
root@todle-todle:~:# tar xzf nginx-1.19.4.tar.gz
root@todle-todle:~:# cd nginx-1.19.4
root@todle-todle:~/nginx-1.19.4:# ./configure \
--prefix=/usr/local/nginx \
--conf-path=/usr/local/nginx/conf/nginx.conf \
--sbin-path=/usr/local/nginx/sbin/nginx \
--lock-path=/usr/local/nginx/nginx.lock \
--pid-path=/usr/local/nginx/nginx.pid \
--http-client-body-temp-path=/usr/local/nginx/tmp/body \
--http-proxy-temp-path=/usr/local/nginx/tmp/proxy \
--http-fastcgi-temp-path=/usr/local/nginx/tmp/fastcgi \
--http-uwsgi-temp-path=/usr/local/nginx/tmp/uwsgi \
--http-scgi-temp-path=/usr/local/nginx/tmp/scgi \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
--with-http_addition_module \
--with-http_degradation_module \
--with-http_flv_module \
--with-http_image_filter_module \
--with-http_mp4_module \
--with-http_random_index_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_realip_module \
--with-http_xslt_module \
--with-debug \
--with-compat \
--with-perl=/usr/bin/perl \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_dav_module \
--with-http_auth_request_module \
--user=nginx --group=nginx
root@todle-todle:~/nginx-1.19.4:# make && make install
3. 기타설정!
root@todle-todle:~/nginx-1.19.4:# mkdir -p /usr/local/nginx/tmp/body
root@todle-todle:~/nginx-1.19.4:# useradd nginx
root@todle-todle:~/nginx-1.19.4:# ln -s /usr/local/nginx/sbin/* /usr/bin
4. 시작 / 중지 / 재시작 스크립트 작성!
-- vi /etc/init.d/nginx --
# !/bin/sh
# Author:Ryan Norbauer http://norbauerinc.com
# Modified : Geoffrey Grosenbach http://topfunky.com
# Modified : Clment NEDELCU
# Reproduced with express authorization from its contributors
# chkconfig: 345 85 15
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="nginx daemon"
NAME=nginx DAEMON=/usr/local/nginx/sbin/$NAME
# if daemon file not exist, script stop
test -x $DAEMON || exit 0
d_start() {
$DAEMON || echo -n "already running"
}
d_stop() {
$DAEMON -s quit || echo -n "not running"
}
d_reload() {
$DAEMON -s reload || echo -n "could not reload"
}
case "$1" in
start)
echo -n "Starting $DESC : $NAME"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC : $NAME"
d_stop
echo "."
;;
reload)
echo -n "Reloading $DESC configuration..."
d_reload
echo "reloaded."
;;
restart)
echo -n "Restarting $Desc : $NAME"
d_stop
sleep 2
d_start
echo "."
;;
*)
echo "Usage : $SCRIPTNAME {start|stop|restart|reload}" >&2
exit 3
ll
esac
exit 0
-- vi /etc/init.d/nginx --
: 실행권한 추가
root@todle-todle:~/nginx-1.19.4:# chmod +x /etc/init.d/nginx
: 재시작 시 자동실행 추가
root@todle-todle:~/nginx-1.19.4:# chkconfig --add nginx
root@todle-todle:~/nginx-1.19.4:# chkconfig nginx on
root@todle-todle:~/nginx-1.19.4:# service nginx start
※ NGINX 구동 명령어
- 시작 : service nginx start
- 재시작 : service nginx restart
- 중지 : service nginx stop
※ CentOS7 - minimal 환경에서 테스트하였고, 설치하면서 글 작성 같이 진행했습니다~
![](https://t1.daumcdn.net/keditor/emoticon/friends2/large/047.png)
![](https://t1.daumcdn.net/keditor/emoticon/friends2/large/047.png)
![](https://t1.daumcdn.net/keditor/emoticon/friends2/large/047.png)
'Linux' 카테고리의 다른 글
[CentOS7 따라만 하세요] #2. 네트워크 설정 및 SSH 접속하기 (0) | 2021.06.11 |
---|---|
[CentOS7 따라만 하세요] #1. CentOS 7.9 2009 설치하기 (0) | 2021.06.10 |
[CentOS7] httpd-2.2.34 / mysql-5.1.73 / php-5.6.30 컴파일 설치 (0) | 2021.06.08 |
재미있는 Linux #2. cmatrix (0) | 2021.06.08 |
재미있는 Linux #1. asciiquarium (0) | 2021.06.08 |
- Total
- Today
- Yesterday
- 재미
- 3.0.7
- centos
- LCK
- 리그오브레전드
- CVE-2022-3786
- ssh
- centos7
- CVE-2022-3602
- xtables
- php
- iptables
- T1
- drx
- asciiquarium
- 3.0.4
- 1.19.4
- 롤
- tcping
- putty
- 젠지
- Linux
- mysql5.1
- 재미있는
- 해외차단
- 리눅스
- cmatrix
- CentOS6
- 3.0.0
- xtables-addons-2.11
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |