Ubuntu 手动安装 Nginx

Ubuntu 手动安装 Nginx

TONYLABS 02 Feb, 2014
Share:

1. 准备工作

1. 下载 Nginx http://nginx.org/en/download.html 2. 可通过 apt-get 安装 Nginx 需要的库 

  • Zlib: sudo sudo apt-get install zlib1g-dev
  • OpenSSL: sudo apt-get install libssl-dev
  • PCRE: sudo apt-get install libpcre3-dev

如果需要手动安装可自行下载新版本的库 

  • Zlib: http://www.zlib.net
  • PCRE: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

 

2. 添加用户和组

sudo useradd www-data sudo groupadd www-data  

3. 编译

首先安装 gcc 编译器: sudo apt-get install gcc 安装make: sudo apt-get install make ./configure --user=www-data --group=www-data --with-http_ssl_module 或添加其他模块: --add-module=../ngx-fancyindex 之后会看到: nginx path prefix: "/usr/local/nginx" nginx binary file: "/usr/local/nginx/sbin/nginx" nginx configuration prefix: "/usr/local/nginx/conf" nginx configuration file: "/usr/local/nginx/conf/nginx.conf" nginx pid file: "/usr/local/nginx/logs/nginx.pid" nginx error log file: "/usr/local/nginx/logs/error.log" nginx http access log file: "/usr/local/nginx/logs/access.log" nginx http client request body temporary files: "client_body_temp" nginx http proxy temporary files: "proxy_temp" nginx http fastcgi temporary files: "fastcgi_temp" nginx http uwsgi temporary files: "uwsgi_temp" nginx http scgi temporary files: "scgi_temp" make && make isntall 编译完成 Nginx 配置文件: /usr/local/nginx/conf

Like what you're reading? Subscribe to our top stories.

We will continue to update Front; if you have any questions or suggestions, please contact us!

Follow us on Medium, Twitter, Facebook, YouTube, and Dribbble.

Image Description
Written by

Hanna Wolfe

I create advanced website builders made exclusively for web developers.

3 Comments

  • Image Description
    Dave Austin 1 day ago

    As a Special Education teacher this resonates so well with me. Fighting with gen ed teachers to flatten for the students with learning disabilities. It also confirms some things for me in my writing.

    Reply
    • Image Description
      Hanna Wolfe 1 day ago

      Love it Dave! We're all about keeping it up.

      Reply
  • Image Description
    Christina Kray 2 days ago

    Since our attention spans seem to be shrinking by the day — keeping it simple is more important than ever.

    Reply

Post a comment

Stay in the know

Get special offers on the latest developments from Front.