Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Nginx Server in CentOS6.5 system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to configure the Nginx server in the CentOS6.5 system, the article is very detailed, has a certain reference value, interested friends must read!

This paper gives an example of how to install and configure Nginx server in CentOS6.5 system. Share with you for your reference, the details are as follows:

Dependent package installation

Before installing nginx, you need to make sure that the system has the glossy +, gcc, openssl-devel, pcre-devel, and zlib-devel software installed. To install the required software:

[root@admin /] # yum install gcc-c++yum-y install zlib zlib-devel openssl openssl--devel pcrepcre-devel

Check the Nginx installed on the system:

[root@admin local] # find-name nginx

Uninstall the original Nginx

[root@admin /] # yum remove nginx

Installation

Upload the installation package file to / usr/local and do the following:

[root@admin local] # cd / usr/local [root@admin local] # tar-zxv-f nginx-1.2.6.tar.gz [root@admin local] # rm-rf nginx-1.2.6.tar.gz [root@admin local] # mv nginx-1.2.6 nginx [root@admin local] # cd / usr/local/nginx [root@admin nginx] #. / configure-prefix=/usr/local/nginx [root@admin nginx] # make [root@admin nginx] # make install

Configuration

# modify firewall configuration: [root@admin nginx-1.2.6] # vi + / etc/sysconfig/iptables# add configuration item-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 80-jACCEPT# restart firewall [root@admin nginx-1.2.6] # service iptables restart

Start

# method 1 [root@admin nginx-1.2.6] # / usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf# method 2 [root@admin nginx-1.2.6] # cd / usr/local/nginx/sbin [root@admin sbin] #. / nginx

Stop it

# query nginx main process number ps-ef | grep nginx# stop process kill-QUIT main process number # Quick stop kill-TERM main process number # Force stop pkill-9 nginx

Restart

[root@admin local] # / usr/local/nginx/sbin/nginx-s reload

test

# Test Port netstat Cna | Test http://ip:80 in grep 8 browser is all the content of this article "how to configure Nginx server in CentOS6.5 system". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report