Install Nginx problem resolution under Mac

Source: Internet
Author: User

Need to install Nginx on the Mac, follow the following blog link installation step by step, but encountered some problems. Let's write down my solution.

(http://stevendu.iteye.com/blog/1535466)

1. Installing Pcre

Download latest PCRE. After download go-to-download directory from terminal.

$ cd ~/download $ tar xvzf pcre-8.12.tar.gz

$ CD pcre-8.12

$ sudo./configure--prefix=/usr/local

$ sudo make

$ sudo make install

-------------------------------------------------------------I'm a gorgeous split-line---------------------------------------------------- ------------

The above may not be an error or something unusual, but you can go to the directory/USR to see if there is a local directory, if there is no such directory, then build a local directory, follow the above steps to operate again

-------------------------------------------------------------I'm a gorgeous split-line---------------------------------------------------- ------------

2. Installing Nginx

Download latest nginx from nginx.org. After download, let install

$ cd ~/download $ tar xvzf nginx-1.0.0.tar.gz

$ CD nginx-1.0.0

$ sudo./configure--prefix=/usr/local--with-http_ssl_module--with-ld-opt= "-l/usr/local/lib"

$ sudo make

$ sudo make install

The error is as follows:

./configure:error:the HTTP Rewrite module requires the PCRE library.

You can either disable the module by using --without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

Statically from the source with Nginx by using--with-pcre=<path> option.

Then I'll follow the wrong instructions and use the option--without-http_rewrite_module to try it out:

$ sudo./configure--prefix=/usr/local--with-http_ssl_module--with-ld-opt= "-l/usr/local/lib"--without-http_ Rewrite_module

It worked!!!

3. Running Nginx

$ cd/usr/local/sbin

$ sudo./nginx

Visit http://localhost

(The first visit to http://localhost may fail, then restart your nginx, then visit to try it)

Successful pages:

4. Close Nginx

$ cd/usr/local/sbin

$ sudo./nginx-s stop

Install Nginx problem resolution under Mac

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.