Centos6.5Install nginx1.6.1
1 download
Wget http://nginx.org/download/nginx-1.6.1.tar.gz
2. Install gcc-C ++ and other components to be installed.
Yum install gcc-C ++
Yum-y install zlib-devel OpenSSL -- devel PCRE-devel
3. Search and delete the old version.
Find/-name nginx
Yum remove nginx
4. decompress and install
Tar-zxvf nginx-1.6.1.tar.gz
CD/usr/local/nginx-1.6.1
./Configure -- prefix =/usr/local/nginx -- conf-Path =/usr/local/nginx/CONF/nginx. conf
Compile configuration
5 make
6 make install
If an error is reported, see the attachment.
7. Start nginx
/Usr/local/nginx/sbin/nginx
Put nginx in the service and set it to automatic random start.
8. Add the startup script and execution permission.
Vim/etc/init. d/nginx
Chmod A + x/etc/init. d/nginx
For the startup script code, see the attachment.
9. Set it to boot.
Chkconfig -- add/etc/init. d/nginx
Chkconfig -- level 3 nginx on
10. Delete the decompressed file.
Rm-RF/usr/local/nginx-1.6.1-R
Error 1:
CP: 'conf/Koi-win' and '/usr/local/nginx/CONF/Koi-win' are the same file
Solution:
Add -- conf-Path =/usr/local/nginx/CONF/nginx. conf to the compilation path.
Nginx boot script:
The only possible change is the nginx_config path and nginx path.
Script attachment:
Http://files.cnblogs.com/wowotou/nginx_begin.zip
Install nginx1.6.1 in centos6.5