GoDaddy 도움말

How to install nginx on CentOS 7

Nginx is primarily a web server for various protocols such as HTTP, HTTPS, IMAP, POP3 and SMTP. It also performs other functions, including HTTP caching, load balancing and acting as a reverse proxy. Nginx is open-source software that runs on Linux-like operating systems such as CentOS. It’s distributed as a binary package that contains all of the files needed to install nginx, including a public PGP key and configuration file. This installation requires you to install the nginx software repository and then install the actual software from the repository.

DIFFICULTY Basic - 1 | Medium - 2 | Advanced - 3
TIME REQUIRED 10 min
RELATED PRODUCTS CentOS-based VPS or dedicated servers

Here is a quick tutorial on how to install nginx on CentOS 7.

Install the nginx software repository

Connect to your server via SSH (more info).

Switch to the root user (more info).

Enter the directory where you’ll install the repository. Assuming you wish to use the tmp directory, you’ll use the following command:

# cd /tmp

Download the appropriate nginx binary package for CentOS. The following wget command downloads the most current version of this package:

# wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

Install the nginx yum configuration file for this package with the following rpm command:

# rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm

Install nginx

The following yum command will install nginx from the yum configuration file by automatically answering "yes" to all questions.

# yum install nginx

The yum command will produce output similar to the following if nginx installs successfully:

Enter the following commands to enable and start nginx:

# chkconfig nginx on
# service nginx start

(If you have another service listening on port 80, such as Apache - you will have to stop that service prior to starting nginx. You can also change the port that nginx listens on by modifying the /etc/nginx/conf.d/default.conf file).

Enter the following URL into your browser:

http://127.0.0.1:80

This page should look like the following screenshot if nginx is running correctly:


이 글이 도움되었나요?
피드백을 보내주셔서 감사합니다. 고객 서비스 담당자에게 문의하시려면 지원 전화 번호 또는 위의 채팅 옵션을 이용하시기 바랍니다.
도와드릴 수 있어 기쁩니다! 더 도와 드릴 것이 있나요?
그것 유감스럽습니다. 혼동이 되었던 사항 또는 솔루션이 고객님의 문제를 해결하지 못했던 원인을 알려주세요.