Install nginx1.6.1 in centos6.5

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.