1.安装步骤
-
step1: 下载ninx
1 2 3 | <code>$ cd ~/download/
$ wget http:
</code>
|
Nach dem Login kopieren
不同版本的下载地址可从http://nginx.org/en/download.html获取。
-
step2: 解压并安装
1 2 3 4 5 6 | <code>$ tar -zxvf nginx-1.8.1.tar.gz
$ cd nginx-1.8.1/
$ ./configure
$ make
$ make install
</code>
|
Nach dem Login kopieren
-
查看是否安装成功
查看/usr/local/目录下是否有nginx目录,有则安装成功。
2.文件说明
/usr/local/nginx/目录下的文件说明:
1 2 3 4 5 | <code>conf/ 存放配置文件
html/ 存放一些网页文件
logs/ 存放一些日志
sbin/ 一些可执行文件
</code>
|
Nach dem Login kopieren
3. 安装时常见的一些问题
./configure的时候会报如下错误:
错误1:
1 2 | <code>error: the HTTP rewrite module requires the PCRE library.
</code>
|
Nach dem Login kopieren
解决办法:
1 2 | <code>$ apt-get -y install libpcre3 libpcre3-dev #安装库,之后重新./configure
</code>
|
Nach dem Login kopieren
错误2:
1 2 | <code>error: the HTTP gzip module requires the zlib library
</code>
|
Nach dem Login kopieren
解决办法:
1 2 | <code>$ apt-get -y install zlib1g zlib1g.dev #安装库,之后重新./configure
</code>
|
Nach dem Login kopieren
参考: http://www.jikexueyuan.com/course/1470_2.html?ss=1
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i ').text(i));
};
$numbering.fadeIn(1700);
});
});
以上就介绍了ubuntu下安装nginx,包括了ubuntu方面的内容,希望对PHP教程有兴趣的朋友有所帮助。