• Ubuntu安装nginx


    Ubuntu安装nginx

    1.输入:
    apt-get install build-essential
    apt-get install libtool

    2.安装pcre依赖库(http://www.pcre.org/)
    sudo apt-get update
    sudo apt-get install libpcre3 libpcre3-dev

    3.安装zlib依赖库(http://www.zlib.net)
    apt-get install zlib1g-dev

    4.安装ssl依赖库
    apt-get install openssl

    5.安装nginx
    sudo apt install nginx
    启动nginx
    sudo service nginx start
    测试nginx
    ifconfig
    浏览器输入ip地址访问如果出现: Welcome to nginx!说明安装成功

    6.nginx常用命令
    启动/停止/重启
    /etc/init.d/nginx start或者stop或者restart
    查看版本:
    nginx -v
    查看帮助信息:
    nginx -h
    检查配置文件是否正确:
    nginx -t


    7.配置nginx.conf
    =================== nginx.conf文件 ===================
    user root;
    worker_processes 1;

    pid /run/nginx.pid;

    events {
    use epoll;
    worker_connections 65535;
    }

    http {
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;

    #gzip on;
    autoindex on;
    #fastcgi_intercept_errors on;
    server {
    listen 80;
    server_name localhost;
    root /var/www/html;
    index index.php index.html index.htm index.nginx-debian.html;

    location / {
    try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;

    location = /50x.html {
    root /var/www/html;
    }

    location ~ .php$ {
    try_files $uri =404;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    include fastcgi.conf;
    }
    }

    }
    =================== nginx.conf文件 结束 ===================
    注意:网站根目录一定不能设置777,有可能会报403错误。

  • 相关阅读:
    idea websitehttp://www.youyur.com/
    chromium project相关页面
    WebKit Remote Debugging
    天兰尾货
    GitCookbook from google chromium
    ocr识别
    Google发布Chrome官方扩展DOM Snitch 可发现网页代码漏洞
    WebKit2 High Level Document ¶
    Phantom JS: an alternative to Selenium
    Python Extension
  • 原文地址:https://www.cnblogs.com/pengyunjing/p/7355578.html
Copyright © 2020-2023  润新知