zoukankan      html  css  js  c++  java
  • SSM-6nginx Linux下的安装

    1.下载nginx

    官方网站:

    http://nginx.org/download/

    2. 要求的安装环境

    yum install gcc-c++

    yum -y install pcre-devel

    yum -y install openssl openssl-devel

    yum -y install pcre-devel openssl openssl-devel

    3.第一步:把nginx的源码包上传到linux系统

    第二步:解压缩

    [root@localhost ~]# tar -zxvf nginx-1.8.0.tar.gz

    第三步:使用configure命令创建makeFile文件。

    ./configure --prefix=/opt/nginx --sbin-path=/usr/bin/nginx

    注意:启动nginx之前,上边将临时文件目录指定为/usr/local/nainx

    第四步:编译nginx :make

    第五步:安装nginx:make install

    4. 启动nginx

    进入sbin目录 启动 nginx

    [root@localhost sbin]# ./nginx

     

    关闭nginx

    [root@localhost sbin]# ./nginx -s stop

    推荐使用:

    [root@localhost sbin]# ./nginx -s quit

    重启nginx

    1、先关闭后启动。

    2、刷新配置文件:

    [root@localhost sbin]# ./nginx -s reload

    5. 访问nginx

    默认是80端口。

    注意:是否关闭防火墙。

    1:查看防火状态
    systemctl status firewalld
    service  iptables status

    2:暂时关闭防火墙
    systemctl stop firewalld
    service  iptables stop

    3:永久关闭防火墙
    systemctl disable firewalld
    chkconfig iptables off

    4:重启防火墙
    systemctl enable firewalld
    service iptables restart  

  • 相关阅读:
    mtr-网络分析工具
    vpc是什么
    openstack安全组
    nginx服务器有什么作用?什么叫反向代理?为什么要使用反向代理?
    rpm 命令详解
    跟踪路由
    网卡配置bond(绑定)
    核心交换机、汇聚交换机是什么
    U盘制作Linux镜像
    11.MySQL 慢日志PT分析 可视化
  • 原文地址:https://www.cnblogs.com/asndxj/p/10922857.html
Copyright © 2011-2022 走看看