wget http://nginx.org/download/nginx-1.7.4.tar.gztar -zxvf nginx-1.7.4.tar.gz yum install pcre-devel.i686yum -y install make zlib zlib-devel gcc-c++ libtoolyum -y install zlib zlib-devel openssl openssl--devel pcre pcre-develyum -y install subversion yum -y install openssl openssl-develyum install subversionsvn checkout http://code.taobao.org/svn/nginx_concat_module/trunk/ $NGINX_CONCAT_MODULE
sudo yum install build-essential m4 autoconf automake makesudo yum install libgd2-noxpm-dev libcurl4-openssl-dev libpcre3-devsudo yum install gd-devel pcre-devel libcurl-develcd nginx-1.7.4/ yum install gitgit clone git://github.com/alibaba/nginx-http-concat.gitsvn checkout http://code.taobao.org/svn/nginx_concat_module/trunk/ $NGINX_CONCAT_MODULEyum svn yum install subversion svn co http://code.taobao.org/svn/nginx_concat_module/trunk nginx_concat_module wget https://github.com/3078825/nginx-image/archive/master.zip unzip master.zip yum -y install openssl openssl-devel ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_gzip_static_module --with-http_sub_module --add-module=nginx_concat_module --add-module=./ngx_image_thumb-master make && make install
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_gzip_static_module --with-http_sub_module --add-module=nginx_concat_module --add-module=ngx_image_thumb-master
make && make install
yum install gitgit clone git://github.com/alibaba/nginx-http-concat.gitsvn checkout http://code.taobao.org/svn/nginx_concat_module/trunk/ $NGINX_CONCAT_MODULE cd ..cd root/nginx-1.7.4/./configure --prefix=/usr/local/nginx --with-http_concat_modulenginx -V 96 ./nginx -V 97 ./configure --prefix=/usr/local/nginx --with-http_concat_module 98 svn co http://code.taobao.org/svn/nginx_concat_module/trunk nginx_concat_module 99 yum svn 100 yum install subversion 101 svn co http://code.taobao.org/svn/nginx_concat_module/trunk nginx_concat_module 102 ./configure --prefix=/usr/local/nginx --with-http_concat_module 103 ./configure --prefix=/usr/local/nginx --with-http_concat 104 --add-module=/home/user/install/nginx-http-concat 105 ./configure --prefix=/usr/local/nginx --with-http_concat_module 106 ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_gzip_static_module --with-http_sub_module --add-module=../nginx-http-concat 107 ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_gzip_static_module --with-http_sub_module --add-module=nginx_concat_module
**
正确的配置 文件的位置要正确**
yum -y install openssl openssl-devel ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_spdy_module --with-http_gzip_static_module --with-http_sub_module --add-module=nginx_concat_module make && make install
111 history
nginx.sh 脚本 放在/usr/local/nginx 文件夹 运行即可
#!/bin/sh#CWD='pwd'case "$1" in 'start') sbin/nginx ;; 'stop') kill -2 `cat nginx.pid` ;; 'restart') cd "$CMD" $0 stop $0 start ;; 'reload') sbin/nginx -s reload ;; *) echo $"Usage: $0 {start|stop|restart|reload}" exit 1 esac exit 0
在配置nginx 时提示如下错误时: nginx: [emerg] getpwnam(“www”) failed
解决方案一
在nginx.conf中 把user nobody的注释去掉既可
解决方案二
错误的原因是没有创建www这个用户,应该在服务器系统中添加www用户组和用户www,如下命令:
1 2
/usr/sbin/groupadd -f www/usr/sbin/useradd -g www www