step1: 下载ninx
$ cd ~/download/ $ wget http://nginx.org/download/nginx-1.8.1.tar.gz不同版本的下载地址可从http://nginx.org/en/download.html获取。
step2: 解压并安装
$ tar -zxvf nginx-1.8.1.tar.gz $ cd nginx-1.8.1/ $ ./configure $ make $ make install查看是否安装成功
查看/usr/local/目录下是否有nginx目录,有则安装成功。
2.文件说明
/usr/local/nginx/目录下的文件说明:
conf/ 存放配置文件
html/ 存放一些网页文件
logs/ 存放一些日志
sbin/ 一些可执行文件
3. 安装时常见的一些问题
./configure的时候会报如下错误:
错误1:
error: the HTTP rewrite module requires the PCRE library.
解决办法:
$ apt-get -y install libpcre3 libpcre3-dev #安装库,之后重新./configure
错误2:
error: the HTTP gzip module requires the zlib library
解决办法:
$ apt-get -y install zlib1g zlib1g.dev #安装库,之后重新./configure
参考: 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 <= lines; i++) { $numbering.append($('').text(i)); }; $numbering.fadeIn(1700); }); });以上就介绍了ubuntu下安装nginx,包括了ubuntu方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!