•编译安装
–配置文件:Makefile
–编译,安装命令:make
•案例:编译安装nginx
–下载源码
–tar xf 解压
–README
–./configure:创建Makefile
–make:编译
–make install clean 等
•注意:
–编译环境
–软件依赖
==========================================================
•1,下载源码包
•2,解压缩:tar xf filename
•3,cd:vi README
•4,./configure
–检查操作系统
–检查编译环境
•yum install gcc
–pcre 依赖库
•yum search pcre
•yum install pcre-devel
–openssl
•yum install opssl-devel
–./configure --help
•./configure --prefix=/opt/sxt/nginx
•5,Makefile
•6,make
•7,make install
•8,cd /opt/sxt/nginx/sbin ./nginx
•9,浏览器访问测试
[root@localhost ~]# tar xf tengine-2.1.0.tar.gz
[root@localhost ~]# ll
total 134136
-rw-------. 1 root root 900 Dec 21 16:18 anaconda-ks.cfg
-rw-r--r-- 1 root root 8816567 Oct 10 2016 apache-tomcat-7.0.61.tar.gz
-rw-r--r--. 1 root root 8815 Dec 21 16:18 install.log
-rw-r--r--. 1 root root 3384 Dec 21 16:17 install.log.syslog
-rw-r--r-- 1 root root 126857158 Sep 7 2016 jdk-7u67-linux-x64.rpm
drwxr-xr-x 11 50469 users 4096 Dec 19 2014 tengine-2.1.0
-rw-r--r-- 1 root root 1653240 Oct 10 2016 tengine-2.1.0.tar.gz
[root@localhost ~]# cd tengine-2.1.0
[root@localhost tengine-2.1.0]# ll
total 688
-rw-r--r-- 1 50469 users 889 Dec 16 2014 AUTHORS.te
drwxr-xr-x 6 50469 users 4096 Dec 16 2014 auto
-rw-r--r-- 1 50469 users 236013 Dec 16 2014 CHANGES
-rw-r--r-- 1 50469 users 16993 Dec 19 2014 CHANGES.cn
-rw-r--r-- 1 50469 users 359556 Dec 16 2014 CHANGES.ru
-rw-r--r-- 1 50469 users 22193 Dec 19 2014 CHANGES.te
drwxr-xr-x 2 50469 users 4096 Dec 16 2014 conf
-rwxr-xr-x 1 50469 users 2435 Dec 16 2014 configure
drwxr-xr-x 4 50469 users 4096 Dec 16 2014 contrib
drwxr-xr-x 3 50469 users 4096 Dec 16 2014 docs
drwxr-xr-x 2 50469 users 4096 Dec 16 2014 html
-rw-r--r-- 1 50469 users 1676 Dec 16 2014 LICENSE
drwxr-xr-x 2 50469 users 4096 Dec 16 2014 man
drwxr-xr-x 3 50469 users 4096 Dec 16 2014 packages
-rw-r--r-- 1 50469 users 3223 Dec 19 2014 README
-rw-r--r-- 1 50469 users 3661 Dec 19 2014 README.markdown
drwxr-xr-x 9 50469 users 4096 Dec 16 2014 src
drwxr-xr-x 4 50469 users 4096 Dec 16 2014 tests
-rw-r--r-- 1 50469 users 43 Dec 16 2014 THANKS.te
README会告诉你软件如何编译
[root@localhost tengine-2.1.0]# vi README
Installation
------------
Tengine can be downloaded at http://tengine.taobao.org/download/tengine.tar.gz . You can also checkout the latest source code from GitHub at https://github.com/alibaba/tengine
To install Tengine, just follow these three steps:
$ ./configure
$ make
# make install
帮助信息
[root@localhost tengine-2.1.0]# ./configure --help | more
[root@localhost tengine-2.1.0]# ./configure --prefix=/opt/hadoop/nginx 设置安装路径(/opt/hadoop/nginx)
checking for OS
+ Linux 2.6.32-431.el6.x86_64 x86_64
checking for C compiler ... not found
./configure: error: C compiler cc is not found
[root@localhost tengine-2.1.0]# yum install gcc
[root@localhost tengine-2.1.0]# ./configure --prefix=/opt/hadoop/nginx
./configure: error: the HTTP rewrite module requires the PCRE library.
[root@localhost tengine-2.1.0]# yum search pcre
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors.huaweicloud.com
========================================== N/S Matched: pcre ==========================================
pcre-devel.i686 : Development files for pcre
pcre-devel.x86_64 : Development files for pcre
pcre-static.x86_64 : Static library for pcre
pcre.x86_64 : Perl-compatible regular expression library
pcre.i686 : Perl-compatible regular expression library
Name and summary matches only, use "search all" for everything.
[root@localhost tengine-2.1.0]# yum install pcre-devel
[root@localhost tengine-2.1.0]# ./configure --prefix=/opt/hadoop/nginx
./configure: error: SSL modules require the OpenSSL library.
[root@localhost tengine-2.1.0]# yum search openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirrors.huaweicloud.com
======================================== N/S Matched: openssl =========================================
openssl-devel.i686 : Files for development of applications which will use OpenSSL
openssl-devel.x86_64 : Files for development of applications which will use OpenSSL
openssl-perl.x86_64 : Perl scripts provided with OpenSSL
openssl-static.x86_64 : Libraries for static linking of applications which will use OpenSSL
perl-Crypt-OpenSSL-Bignum.x86_64 : Perl interface to OpenSSL for Bignum
perl-Crypt-OpenSSL-RSA.x86_64 : Perl interface to OpenSSL for RSA
perl-Crypt-OpenSSL-Random.x86_64 : Perl interface to OpenSSL for Random
pyOpenSSL.x86_64 : Python wrapper module around the OpenSSL library
xmlsec1-openssl.i686 : OpenSSL crypto plugin for XML Security Library
xmlsec1-openssl.x86_64 : OpenSSL crypto plugin for XML Security Library
xmlsec1-openssl-devel.i686 : OpenSSL crypto plugin for XML Security Library
xmlsec1-openssl-devel.x86_64 : OpenSSL crypto plugin for XML Security Library
krb5-pkinit-openssl.x86_64 : The PKINIT module for Kerberos 5
m2crypto.x86_64 : Support for using OpenSSL in python scripts
nss_compat_ossl.i686 : Source-level compatibility library for OpenSSL to NSS porting
nss_compat_ossl.x86_64 : Source-level compatibility library for OpenSSL to NSS porting
openssl.x86_64 : A general purpose cryptography library with TLS implementation
openssl.i686 : A general purpose cryptography library with TLS implementation
openssl098e.i686 : A compatibility version of a general cryptography and TLS library
openssl098e.x86_64 : A compatibility version of a general cryptography and TLS library
perl-Crypt-SSLeay.x86_64 : Crypt::SSLeay - OpenSSL glue that provides LWP https support
perl-Net-SSLeay.x86_64 : Perl extension for using OpenSSL
qca-ossl.i686 : OpenSSL plugin for the Qt Cryptographic Architecture v2
qca-ossl.x86_64 : OpenSSL plugin for the Qt Cryptographic Architecture v2
[root@localhost tengine-2.1.0]# yum install openssl-devel
[root@localhost tengine-2.1.0]# ./configure --prefix=/opt/hadoop/nginx
没有报错接着执行
creating objs/Makefile
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
+ jemalloc library is disabled
nginx path prefix: "/opt/hadoop/nginx"
nginx binary file: "/opt/hadoop/nginx/sbin/nginx"
nginx configuration prefix: "/opt/hadoop/nginx/conf"
nginx configuration file: "/opt/hadoop/nginx/conf/nginx.conf"
nginx pid file: "/opt/hadoop/nginx/logs/nginx.pid"
nginx error log file: "/opt/hadoop/nginx/logs/error.log"
nginx http access log file: "/opt/hadoop/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx dso module path: "/opt/hadoop/nginx/modules/"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
[root@localhost tengine-2.1.0]# make (make单独使用就是编译)
[root@localhost tengine-2.1.0]# make install
[root@localhost tengine-2.1.0]# cd /opt/
[root@localhost opt]# ll
total 4
drwxr-xr-x 3 root root 4096 Dec 22 19:04 hadoop
[root@localhost opt]# cd hadoop/
[root@localhost hadoop]# ll
total 4
drwxr-xr-x 8 root root 4096 Dec 22 19:04 nginx
[root@localhost hadoop]# cd nginx/
[root@localhost nginx]# ll
total 24
drwxr-xr-x 2 root root 4096 Dec 22 19:04 conf
drwxr-xr-x 2 root root 4096 Dec 22 19:04 html
drwxr-xr-x 2 root root 4096 Dec 22 19:04 include
drwxr-xr-x 2 root root 4096 Dec 22 19:04 logs
drwxr-xr-x 2 root root 4096 Dec 22 19:04 modules
drwxr-xr-x 2 root root 4096 Dec 22 19:04 sbin
[root@localhost nginx]# cd sbin/
[root@localhost sbin]# ll
total 6116
-rwxr-xr-x 1 root root 17181 Dec 22 19:04 dso_tool
-rwxr-xr-x 1 root root 6238237 Dec 22 19:04 nginx
[root@localhost sbin]# ./nginx
http://192.168.106.5:80 编译安装都成功了