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