CentOS 上安装nginx 0.8.53

1、安装nginx所须的pcre(pcre-7.7.tar.gz)库:
./configure
make && make install


2、安装nginx所的openssl(openssl-1.0.0c.tar.gz)库:

./config
make && make install


3、安装nginx,安装nginx_upstream_jvm_route时,加上--add-module=jvm代码的目录
tar zxvf nginx-0.8.53.tar.gz
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module  --with-openssl=/home/wang/ openssl-1.0.0c
make && make install
注:--with-openssl=后面指定openssl源代码的包,即上面安装的openssl源路径。

4、创建nginx配置文件
依照自己的情况进行配置,
首行user www www 配置的www为configure中使用的www

创建www
/usr/sbin/useradd www -s /sbin/nologin -M 

5、启动nginx
/usr/local/nginx/sbin/nginx
注:默认安装的apache如果已启动的话,会占用80端口,导致nginx无法启动:
停止 httpd :
service httpd stop 
chkconfig httpd off


其他:
可通过 ulimit -SHn 4096配置连接数
通过/etc/rc.local配置开机启动
通过加上-s参数来进行其他操作,比如 nginx -s reload等

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值