Download nginx-0.8.54.tar.gz, decompress and compile and install Nginx0.8.54, and download and fix the following three bug commands: uninstall to the relevant directory./configuremakesudomakeinstal
Download nginx-0.8.54.tar.gz, decompress and compile and install
Read more: Nginx 0.8.54 download and fix three bugs
Command description:
Tar (z-use gzip to compress or decompress the archive; x-expand the archive; v-display the processed files in detail; f-specify the archive or device)
Tar-zxvf nginx-0.8.54.tar.gz
Enter related directories
./Configure
Make
Sudo make install
If you want to be lucky, everything is OK, but I believe no one is lucky, haha. Ubuntu does not install any libraries by default. All dependent libraries must be manually installed. It is estimated that CentOS and other linux will be better.
Generally, errors occur. Let's take a look at the possible problems.
FAQs
Pcre library missing
./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 = Option.
Solution: download and install the pcre-8.12 to solve the problem, decompress the package and perform the following operations on pcre
./Configure
Make
Sudo make install
Make pcre errors
The gcc-c ++ and libtool are missing, that is, the c ++ compiling package.
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 '/home/guangbo/work/pcre-8.12'
Make: *** [all] Error 2
Www.linuxidc.com @ linuxidc-laptop :~ /Work/pcre-8.12 $ libtool-help-DHAVE_CONFIG_H
The program 'libtool' is currently not installed. You can install it by typing:
Sudo apt-get install libtool
Www.linuxidc.com @ linuxidc-laptop :~ /Work/pcre-8.12 $
Solution: Install libtool and gcc-c ++ first.
Sudo apt-get install libtool
Sudo apt-get install gcc-c ++
An error occurred while installing gcc-c ++.
Www.linuxidc.com @ linuxidc-laptop :~ /Soft/pcre-8.12 $ sudo apt-get install gcc-c ++
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package gcc-c
Solution: update the source and reinstall gcc-c ++.
Sudo apt-get install build-essential
Sudo apt-get update # update source
Sudo apt-get install gcc-c ++
Upgrade update takes a long time. If no error is reported, you can skip this step.
Sudo apt-get upgrade # Update installed packages for a long time
Openssl library missing
./Configure: error: the HTTP cache module requires md5 functions
From 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 = Options.
Solution:
Sudo apt-get install openssl
Zlib library missing
./Configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using -- without-http_gzip_module
Option, or install the zlib library into the system, or build the zlib library
Statically from the source with nginx by using -- with-zlib = Option.
Solution: Download a libssl-dev package to install openssl.
Sudo apt-get install libssl-dev
No nginx or logs directory access permission
[Alert]: cocould not open error log file: open () "/usr/local/nginx/logs/error. log" failed (13: Permission denied)
06:09:33 [emerg] 24855 #0: mkdir () "/usr/local/nginx/client_body_temp" failed (13: Permission denied)
Solution:
Sudo chmod a + rwx-R logs
Sudo chmod a + rwx-R/usr/local/nginx
Test whether the installation is successful
For nginx, after compilation and installation are complete, install and run
Sudo apt-get install nginx
/Usr/local/nginx/sbin/nginx
Open http: // localhost in the browser. The welcome page is displayed.
Disable nginx
./Sbin/nginx-s stop
Ubuntu Linux practical commands
Tar (z-use gzip to compress or decompress the archive; x-expand the archive; v-display the processed files in detail; f-specify the archive or device)
Tar-zxvf nginx-0.8.54.tar.gz
View ip Address
Ifconfig
Compile
Make
Install the compiled source code package
Make install
Edit File
Sudo gedit/etc/profile
Modify root limit: chmod description (u: has the same permissions as the file owner [a: Everyone]; +: adds permissions; rwx: readable, writable, and executable)
-R: recursion of all directories and files
Sudo chmod a + rwx-R logs
Check whether the library is successfully installed.
Dpkg -- list | grep openssl
Download the installation Library
Sudo apt-get install libtool
Check whether the service is started normally
Ps-ef | grep
Find the openssl installation path
Whereis openssl
Update Source
Sudo apt-get update
Update installed packages
Sudo apt-get upgrade