Host House Ubuntu 14 installation Nginx

Source: Internet
Author: User
Tags install openssl

Installing a dependency library for GCC g++

1 sudo apt-get install build-essential

2 sudo apt-get install Libtool

Installing Pcre dependent libraries

3 sudo apt-get update

4 sudo apt-get install libpcre3 libpcre3-devInstalling zlib dependent libraries

5 sudo apt-get install Zlib1g-dev

Installing SSL Dependent libraries

6 sudo apt-get install OpenSSL

Installing Nginx

#下载最新版本:

wget http://nginx.org/download/nginx-1.13.1.tar.gz #解压: tar -zxvf nginx-1.13.1.tar.gz #进入解压目录: cd nginx-1.13.1 #配置: ./configure --prefix=/usr/local/nginx  #编辑nginx: make 注意:这里可能会报错,提示“pcre.h No such file or directory”,具体详见:http://stackoverflow.com/questions/22555561/error-building-fatal-error-pcre-h-no-such-file-or-directory 需要安装 libpcre3-dev,命令为:sudo apt-get install libpcre3-dev #安装nginx: sudo make install #启动nginx: sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 注意:-c 指定配置文件的路径,不加的话,nginx会自动加载默认路径的配置文件,可以通过 -h查看帮助命令。 #查看nginx进程: ps -ef|grep nginxStart Nginx

/usr/local/nginx/sbin/nginx

./sbin/nginx Stop Nginx

./sbin/nginx -s stop

./sbin/nginx -s quitNginx Reload Configuration

./sbin/nginx-s Reload

Specify the configuration file

./sbin/nginx-c/usr/local/nginx/conf/nginx.conf

Host House Ubuntu 14 installation Nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.