Install Nginx in the Linux tar package and nginx in the linuxtar package

Source: Internet
Author: User

Install Nginx in the Linux tar package and nginx in the linuxtar package

1. First install the dependency package (there are a lot of dependency packages. We use yum to install them)

 yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel

2.upload nginx-1.7.6.tar.gz to/usr/local/

tar -zxvf nginx-1.7.6.tar.gz 

3. Rename the package name and change the nginx-1.7.6 to nginx

mv nginx-1.7.6 nginx

3. Compile

cd nginx

./configure 

make
make install
4. Test

/usr/local/nginx/nginx -t

5. Problem:

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: No such file or directory)2015/06/06 15:16:28 [emerg] 13663#0: open() "/usr/local/nginx/logs/access.log" failed (2: No such file or directory)

6. Solution

6.1 create a logs folder

 mkdir logs
6.2 create a file

 cd logs/

touch error.log

touch nginx.pid

7. Start

/usr/local/nginx/nginx

See

Welcome to nginx! It indicates that the nginx initial STARTUP configuration is successful!





My personal website: http://www.caicongyang.com

My CSDN blog: http://blog.csdn.net/caicongyang








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.