最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CentOS7下 yum方式安裝Nginx的實現(xiàn)步驟

 更新時間:2017年10月26日 10:30:52   作者:Leshami  
這篇文章主要介紹了CentOS7下 yum方式安裝Nginx的實現(xiàn)步驟的相關(guān)資料,希望通過本文能幫助到大家,需要的朋友可以參考下

CentOS7下 yum方式安裝Nginx的實現(xiàn)步驟

Nginx 是一個很強大的高性能Web和反向代理服務(wù)器,它具有眾多非常優(yōu)越的特性。諸如低開銷,高并發(fā),支持緩存,支持正反向代理,支持負(fù)載均衡,支持正則,支持rewrite等等不一而足。所以眾多粉絲們也是不計其數(shù)。本文基于CentOS 7簡要描述yum方式的安裝部署,供大家參考。

如果是編譯安裝可以參考:Linux 6下安裝編譯安裝Nginx

有關(guān)Nginx的常用配置可參考:Nginx 概述及日常管理

一、配置nginx yum源

演示環(huán)境
[root@centos7-router ~]# more /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

[root@centos7-router ~]# vim /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1

將上述配置文件中的OS替換為rhel或者centos,OSRELEASE替換為6或者7,即當(dāng)前的Linux為6還是7版本

查看本機ip
[root@centos7-router ~]# ip addr|grep inet|grep global
inet 172.24.8.254/24 brd 172.24.8.255 scope global eno16777728
inet 192.168.1.175/24 brd 192.168.1.255 scope global dynamic eno33554960

二、安裝nginx

[root@centos7-router ~]# yum install nginx -y
[root@centos7-router ~]# yum install nginx-module-perl.x86_64 -y 

查看生程的相關(guān)文件
[root@centos7-router ~]# rpm -ql nginx
/etc/logrotate.d/nginx
/etc/nginx
/etc/nginx/conf.d
/etc/nginx/conf.d/default.conf
/etc/nginx/fastcgi_params
/etc/nginx/koi-utf
/etc/nginx/koi-win
/etc/nginx/mime.types
/etc/nginx/modules
/etc/nginx/nginx.conf
/etc/nginx/scgi_params
/etc/nginx/uwsgi_params
/etc/nginx/win-utf
/etc/sysconfig/nginx
/etc/sysconfig/nginx-debug
/usr/lib/systemd/system/nginx-debug.service
/usr/lib/systemd/system/nginx.service
/usr/lib64/nginx
/usr/lib64/nginx/modules
/usr/libexec/initscripts/legacy-actions/nginx
/usr/libexec/initscripts/legacy-actions/nginx/check-reload
/usr/libexec/initscripts/legacy-actions/nginx/upgrade
/usr/sbin/nginx
/usr/sbin/nginx-debug
/usr/share/doc/nginx-1.12.2
/usr/share/doc/nginx-1.12.2/COPYRIGHT
/usr/share/man/man8/nginx.8.gz
/usr/share/nginx
/usr/share/nginx/html
/usr/share/nginx/html/50x.html
/usr/share/nginx/html/index.html
/var/cache/nginx
/var/log/nginx

三、驗證nginx

啟動nginx
root@centos7-router ~]# systemctl start nginx
[root@centos7-router ~]# systemctl enable nginx ###配置自啟動
[root@centos7-router ~]# ss -nltp|grep nginx
LISTEN 0 128 *:80 *:* users:(("nginx",pid=65418,fd=6),("nginx",pid=65415,fd=6))

查看nginx的版本
[root@centos7-router ~]# nginx -v
nginx version: nginx/1.12.2

查看或修改配置文件
[root@centos7-router ~]# more /etc/nginx/nginx.conf

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;  ### Author : Leshami
default_type application/octet-stream; ### Blog : http://blog.csdn.net/leshami

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
}

[root@centos7-router ~]# firewall-cmd --add-service=http --permanent
[root@centos7-router ~]# firewall-cmd --reload

從其他機器驗證nginx
[root@centos7-web ~]# curl http://172.24.8.254
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a  rel="external nofollow" >nginx.org</a>.<br/>
Commercial support is available at
<a  rel="external nofollow" >nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

  • linux誤刪nginx.conf文件恢復(fù)方式

    linux誤刪nginx.conf文件恢復(fù)方式

    這篇文章主要介紹了linux誤刪nginx.conf文件恢復(fù)方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-01-01
  • 關(guān)于Apache默認(rèn)編碼錯誤 導(dǎo)致網(wǎng)站亂碼的解決方案

    關(guān)于Apache默認(rèn)編碼錯誤 導(dǎo)致網(wǎng)站亂碼的解決方案

    Apache默認(rèn)編碼UTF-8在解析A網(wǎng)站的時候沒有任何問題,當(dāng)運行B網(wǎng)站時出現(xiàn)的"蝌蚪文"亂碼問題
    2011-12-12
  • Linux+php+apache+oracle環(huán)境搭建之CentOS下安裝Oracle數(shù)據(jù)庫

    Linux+php+apache+oracle環(huán)境搭建之CentOS下安裝Oracle數(shù)據(jù)庫

    研究了兩天Linux下安裝Oracle,重裝了兩次虛擬機,終于安裝成功。很有收獲的。記錄下安裝過程。大神們?nèi)缬懈玫姆绞剑埪?lián)系我!
    2014-08-08
  • Centos中root密碼重置的實現(xiàn)及步驟詳解

    Centos中root密碼重置的實現(xiàn)及步驟詳解

    這篇文章主要介紹了Centos中root密碼重置的實現(xiàn)及步驟詳解的相關(guān)資料,需要的朋友可以參考下
    2017-07-07
  • 在Linux環(huán)境下安裝和使用Pyenv的詳細(xì)指南

    在Linux環(huán)境下安裝和使用Pyenv的詳細(xì)指南

    Pyenv是一個用于管理多個Python版本的強大工具,特別適合在Linux環(huán)境下使用,本文將詳細(xì)介紹如何在Linux系統(tǒng)上安裝和使用Pyenv,以便更好地管理Python開發(fā)環(huán)境,需要的朋友可以參考下
    2025-03-03
  • 詳解nohup /dev/null 2>&1 含義的使用

    詳解nohup /dev/null 2>&1 含義的使用

    這篇文章主要介紹了詳解nohup /dev/null 2>&1 含義的使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-09-09
  • 解析Linux內(nèi)核與設(shè)備樹的編譯和燒寫

    解析Linux內(nèi)核與設(shè)備樹的編譯和燒寫

    在內(nèi)核源碼中,存在大量對板級細(xì)節(jié)信息描述的代碼。開源文檔中對設(shè)備樹的描述是,一種描述硬件資源的數(shù)據(jù)結(jié)構(gòu),它通過bootloader將硬件資源傳給內(nèi)核,使得內(nèi)核和硬件資源描述相對獨立
    2021-06-06
  • linux(centos7)搭建SVN服務(wù)器的思路

    linux(centos7)搭建SVN服務(wù)器的思路

    這篇文章主要為大家詳細(xì)介紹了linux搭建SVN服務(wù)器的思路,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-03-03
  • Linux curl表單登錄或提交與cookie使用詳解

    Linux curl表單登錄或提交與cookie使用詳解

    這篇文章主要給大家介紹了關(guān)于Linux curl表單登錄或提交與cookie使用的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Linux系統(tǒng)具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-08-08
  • 在Linux上識別同樣內(nèi)容的文件詳解

    在Linux上識別同樣內(nèi)容的文件詳解

    這篇文章主要給大家介紹了關(guān)于如何在Linux上識別同樣內(nèi)容的文件的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Linux具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-06-06

最新評論

麟游县| 福清市| 凤庆县| 永年县| 小金县| 博白县| 雷波县| 沅江市| 临沂市| 卢龙县| 图木舒克市| 青田县| 塔城市| 信阳市| 全州县| 宜川县| 龙井市| 青神县| 和硕县| 青冈县| 荣成市| 裕民县| 敖汉旗| 光泽县| 河北省| 章丘市| 清水县| 白银市| 策勒县| 洪泽县| 蒙自县| 永修县| 桦南县| 施秉县| 略阳县| 泗洪县| 信丰县| 莱阳市| 科尔| 容城县| 名山县|