ubuntu安装nginx

首先下载nginx(nginx-1.7.3.tar.gz)
http://nginx.org/en/download.html
上传到home目录

[color=red]#cd /home
#tar zxvf nginx-1.7.3.tar.gz
#cd nginx-1.7.3
#./configure[/color]

提示prce没有模块,安装prce
提示zlib没有模块,安装zlib

如果没问题
[color=red]#make
#make install[/color]


安装以下模块:
Nginx需要依赖下面3个包
1. gzip 模块需要 zlib 库 ( 下载: http://www.zlib.net/ )
2. rewrite 模块需要 pcre 库 ( 下载: http://www.pcre.org/ )
3. ssl 功能需要 openssl 库 ( 下载: http://www.openssl.org/ )

列如:
[color=red]#tar jxvf pcre-8.33.tar.bz2
#cd pcre-8.33
#./configure
#make
#make install[/color]


nginx安装成功后:默认安装到/usr/local/nginx
[color=red]启动:/usr/local/nginx/sbin# ./nginx
关闭:/usr/local/nginx/sbin# ./nginx -s stop[/color]

修改配置文件:
[color=red]/usr/local/nginx/conf# vi nginx.conf[/color]

如改成图片服务器:
[color=red] server {
listen 8085;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root /upload/shopsExtend;
index index.html index.htm;
}[/color]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值