Linux/centos installation Nginx common errors and solutions

Source: Internet
Author: User
Tags install openssl openssl openssl library openssl version

1. Can not be accessed after installation is complete Nginx?

Just installed Nginx A common problem is unable to stand outside the access, native wget, Telnet are normal. Outside the server, the site is inaccessible to other hosts on the LAN or to hosts on the Internet. If using Telnet, prompt:

Connecting to 192.168.0.xxx ... Cannot open connection to host on port 80: Connection Failed

If you use the wget command, prompt:

Connecting to 192.168.0.100:80 ... Failed:no route to host.

If it is the above phenomenon, it is likely that the CentOS firewall to the 80 port stopped, try to execute the following command, open 80 port:

Iptables-i input-p TCP--dport 80-j ACCEPT

Then use:

/etc/init.d/iptables status

Review the current firewall rules, if one is found:

ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 TCP dpt:80

This means that the firewall rules have been added successfully, and then access outside the station is normal.

2. Compile Pcre error (source installation Nginx must first install pcre)

libtool:compile:unrecognized option '-dhave_config_h '

Libtool:compile:Try ' Libtool--help ' for more information.

MAKE[1]: * * * [Pcrecpp.lo] Error 1

MAKE[1]: Leaving directory '/usr/local/src/pcre-8.21 '

Make: * * * [ALL] Error 2

Workaround: Install g++, don't forget to re-configure

Apt-get Install g++

Apt-get Install Build-essential

Make clean

./configure

Make

3. Make error

Make: * * * No rule to do target ' build ', needed by ' default '. Stop.

./CONFIGURE:ERROR:SSL modules require the OpenSSL library.

You can either does not enable the modules, or install the OpenSSL library

Into the system, or build the OpenSSL library statically from the source

With Nginx by using--with-openssl=<path> option.

Solutions under Ubuntu:

Apt-get Install OpenSSL

Apt-get Install Libssl-dev

Solutions under CentOS:

Yum-y Install OpenSSL Openssl-devel

4. Dependent software Prce,ssl,zlib not installed error

1) If the error

./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.

Need to install Pcre package

Pcre

Tar zxvf pcre-8.12.tar.gz

CD pcre-8.12

./configure

Make

Make install

2) If the error

./configure:error:the HTTP Cache module requires MD5 functions

From the OpenSSL library. You can either disable the module by using

--without-http-cache option, or install the OpenSSL library into the system,

or build the OpenSSL library statically from the source with Nginx by using

--with-http_ssl_module--with-openssl=<path> Options.

Need to install OpenSSL

Tar zxvf openssl-0.9.8g.tar.gz

CD openssl-0.9.8g

./config--prefix=/usr/local/--openssldir=/usr/local/openssl-g3 gkfx zlib-dynamic Enable-camellia

Make

Make install

Test for installation success: OpenSSL version

3) If the error

Configure:error:zlib not found.

Installation Required: gzip.tar.gz

Tar zxvf gzip.tar.gz

./configure

Make

Make install


This article from the "IT System Architecture" blog, declined reprint!

Linux/centos installation Nginx common errors and solutions

Related Article

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.