ubuntu15.10_x64 安装 nginx
2016-08-01 16:55
351 查看
浏览器到 http://nginx.org/en/download.html
下载 stable version的nginx 如nginx-1.10.1.tar.gz,这是一个nginx源码包,需要经过编译和安装才能使用。
解压命令: tar –zxvf nginx-1.10.1.tar.gz
cd nginx解压后的源码目录 : ./configure 命令
问题一:gcc和gcc++ 编译器未安装
./configure: error: C compiler cc is not found
解决:安装gc++
sudo apt-get install gcc
sudo apt-get install gcc++
问题二: http模块缺少prce正则表达式库
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决:安装pcre库
sudo apt-get install libpcre3 libpcre3-dev
问题三: http gzip 模块缺少 zlib库
./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
解决:安装zlib库
$ sudo apt-get install zlib1g
$ sudo apt-get install zlib1g.dev
再次:./configure
编译 make
安装 make install
进入nginx安装目录
cd /usr/local/
ls 可以看到nginx,则代表nginx在ubuntu上安装成功了
进入 cd /usr/local/nginx/sbin
sudo ./nginx 启动nginx
若nginx没有启动成功,很可能是80端口被占用了(ubuntu15默认安装了apache2),更换一下端口即可(编辑conf/nginx.conf文件 80改为81)
http://localhost:80
引申:《nginx 在ubuntu 上的启动,停止,重启》
相关文章推荐
- Ubuntu 17.04 x64 安装 Docker CE 初窥 Dockerfile 部署 Nginx
- ubuntu16.04 x64上nginx源码安装
- Ubuntu 15.10 x64 安装 Android SDK
- Ubuntu 15.10 x64 安装 Android Studio详细教程
- Ubuntu 15.10 x64 安装 Android SDK(转)
- Ubuntu 17.04 x64 安装 Docker CE 初窥 Dockerfile 部署 Nginx
- Ubuntu 15.10 安装 php7.0.6 + nginx-1.9.3(ubuntu)
- Ubuntu 15.10 x64 安装 Android SDK
- Ubuntu15.10下安装Nginx,PHP5(及PHP-FPM),MySQL
- ubuntu9.04安装nginx记录
- NGINX在Ubuntu 10.10下的安装与配置指南
- Ubuntu下自动编译安装Nginx、Mysql、PHP、Memcache、eaccelerator
- ubuntu 12.04下安装 nginx php mysql -- 安装笔记
- Ubuntu 安装 Nginx + PHP + Mysql 源安装
- 在Ubuntu 9.04中编译安装 Nginx-0.7.61
- Ubuntu Server 10.10 安装配置 Ruby Rails3 passenger nginx MySQL
- 基于Xen的VPS ubuntu+nginx+php安装教程
- ubuntu上安装 nginx 之一 pcre open ssl
- Ubuntu10下Nginx-0.8.54安装
- Ubuntu 9.04/9.10安装Nginx+Mysql+Php