zoukankan      html  css  js  c++  java
  • 远程服务器安装nginx

    肯定有前端的小伙伴在腾讯云或者阿里云上购买了服务器,却不知道怎么访问使用它,那我们就一起来安装学习下?

    1. xshell 登录服务器,输入公网ip和密码登录
    2. ls 查看目录,which nginx ,查看是否已经安装过nginx;
    3. 安装编译工具及库文件
      yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
      4.首先要安装 PCRE
      http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
      5.解压安装包:tar zxvf pcre-8.35.tar.gz
    4. 进入安装包目录 : cd pcre-8.35
    5. 编译安装 : ./configure make && make install
      8.查看pcre版本 : pcre-config --version
      9.安装 Nginx : wget http://nginx.org/download/nginx-1.6.2.tar.gz
    6. 解压安装包 : tar zxvf nginx-1.6.2.tar.gz
    7. 进入安装包目录 : cd nginx-1.6.2
    8. 编译安装: ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
      make,make install
    9. 查看nginx版本 (如果没有安转成功,说明12步有问题)
    10. Nginx 配置:全局找到nginx,nginx/conf/nginx.conf 文件, 进行vim写入编辑,把ip或者域名输入进行;

    server
    {
    listen 80;#监听端口
    server_name localhost;#域名
    index index.html index.htm index.php;
    root /usr/local/webserver/nginx/html;#站点目录
    }

    1. 启动 Nginx nginx -s reload
  • 相关阅读:
    arcgis api for flex 开发入门
    Error #2148
    为Flex Builder设置测试服务器
    地图服务报 error #2035
    springMVC整理03--处理数据模型 & 试图解析器 & @ResponseBody & HttpEntity
    FastDFS安装与使用
    springMVC整理02--常用注解的使用
    springMVC整理01--搭建普通的工程
    Spring模块介绍
    spring05-Spring事务管理
  • 原文地址:https://www.cnblogs.com/panax/p/10548175.html
Copyright © 2011-2022 走看看