Linux系统源码安装

本文详细记录了在Linux系统中通过源码安装Tengine的过程,包括解压安装包、配置、编译及启动Nginx等步骤,适合系统管理员和开发者参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编辑搜图

请点击输入图片描述

编辑搜图

请点击输入图片描述

编辑搜图

 

请点击输入图片描述

[root@centos7-1 ~]# ll

总用量 286432

-rw-r--r-- 1 root root         0 11月 22 13:54 a

-rw-r--r-- 1 root root         0 11月 22 13:54 ab

-rw-r--r-- 1 root root         0 11月 22 13:54 abc

-rw-r--r-- 1 root root       135 11月 27 17:34 awk.txt

-rw-r--r-- 1 root root       111 11月 22 15:50 grep.txt

-rw-r--r-- 1 root root       511 11月 24 00:11 inittab

-rw-r--r-- 1 root root 138090286 11月 28 18:02 jdk-7u80-linux-x64.rpm

-rw-r--r-- 1 root root 153530841 11月 28 18:02 jdk-7u80-linux-x64.tar.gz

-rw-r--r-- 1 root root      2347 11月 27 16:49 passwd

-rwxr-xr-x 1 root root      1833 11月 22 12:28 profile

-rw-r--r-- 1 root root        38 11月 24 00:09 sort.txt

-rw-r--r-- 1 root root   1653240 11月 28 18:02 tengine-2.1.0.tar.gz

[root@centos7-1 ~]# tar xf tengine-2.1.0.tar.gz

[root@centos7-1 ~]# ll

总用量 286432

-rw-r--r--  1 root  root          0 11月 22 13:54 a

-rw-r--r--  1 root  root          0 11月 22 13:54 ab

-rw-r--r--  1 root  root          0 11月 22 13:54 abc

-rw-r--r--  1 root  root        135 11月 27 17:34 awk.txt

-rw-r--r--  1 root  root        111 11月 22 15:50 grep.txt

-rw-r--r--  1 root  root        511 11月 24 00:11 inittab

-rw-r--r--  1 root  root  138090286 11月 28 18:02 jdk-7u80-linux-x64.rpm

-rw-r--r--  1 root  root  153530841 11月 28 18:02 jdk-7u80-linux-x64.tar.gz

-rw-r--r--  1 root  root       2347 11月 27 16:49 passwd

-rwxr-xr-x  1 root  root       1833 11月 22 12:28 profile

-rw-r--r--  1 root  root         38 11月 24 00:09 sort.txt

drwxr-xr-x 11 50469 users       330 12月 19 2014 tengine-2.1.0

-rw-r--r--  1 root  root    1653240 11月 28 18:02 tengine-2.1.0.tar.gz

[root@centos7-1 ~]# cd tengine-2.1.0

[root@centos7-1 tengine-2.1.0]# ll

总用量 652

-rw-r--r-- 1 50469 users    889 12月 16 2014 AUTHORS.te

drwxr-xr-x 6 50469 users    297 12月 16 2014 auto

-rw-r--r-- 1 50469 users 236013 12月 16 2014 CHANGES

-rw-r--r-- 1 50469 users  16993 12月 19 2014 CHANGES.cn

-rw-r--r-- 1 50469 users 359556 12月 16 2014 CHANGES.ru

-rw-r--r-- 1 50469 users  22193 12月 19 2014 CHANGES.te

drwxr-xr-x 2 50469 users    184 12月 16 2014 conf

-rwxr-xr-x 1 50469 users   2435 12月 16 2014 configure

drwxr-xr-x 4 50469 users    109 12月 16 2014 contrib

drwxr-xr-x 3 50469 users     21 12月 16 2014 docs

drwxr-xr-x 2 50469 users     40 12月 16 2014 html

-rw-r--r-- 1 50469 users   1676 12月 16 2014 LICENSE

drwxr-xr-x 2 50469 users     21 12月 16 2014 man

drwxr-xr-x 3 50469 users     20 12月 16 2014 packages

-rw-r--r-- 1 50469 users   3223 12月 19 2014 README

-rw-r--r-- 1 50469 users   3661 12月 19 2014 README.markdown

drwxr-xr-x 9 50469 users     89 12月 16 2014 src

drwxr-xr-x 4 50469 users     43 12月 16 2014 tests

-rw-r--r-- 1 50469 users     43 12月 16 2014 THANKS.te

[root@centos7-1 tengine-2.1.0]# vi README

[root@centos7-1 tengine-2.1.0]# vi README

[root@centos7-1 tengine-2.1.0]# ./configure

checking for OS

 + Linux 3.10.0-957.el7.x86_64 x86_64

checking for C compiler ... not found

 

./configure: error: C compiler cc is not found

 

[root@centos7-1 tengine-2.1.0]# ./configure --help | more

 

  --help                             print this message

 

  --prefix=PATH                      set installation prefix

  --sbin-path=PATH                   set nginx binary pathname

  --conf-path=PATH                   set nginx.conf pathname

  --error-log-path=PATH              set error log pathname

  --pid-path=PATH                    set nginx.pid pathname

  --lock-path=PATH                   set nginx.lock pathname

 

  --user=USER                        set non-privileged user for

                                     worker processes

  --group=GROUP                      set non-privileged group for

                                     worker processes

 

  --builddir=DIR                     set build directory

 

  --enable-mods-shared=all           enable all the modules to be shared

  --enable-mods-static=all           enable all the modules to be static

 

  --dso-path=DIR                     set dso default load path

  --dso-tool-path=DIR                set dso_tool pathname

  --dso-max-modules=*)               set max dso module(default is 256)

  --includedir=DIR                   set C header files[PREFIX/include]

 

  --with-rtsig_module                enable rtsig module

  --with-select_module               enable select module

  --without-select_module            disable select module

  --with-poll_module                 enable poll module

  --without-poll_module              disable poll module

 

  --without-procs                    disable procs module

 

  --with-file-aio                    enable file AIO support

  --with-ipv6                        enable IPv6 support

 

  --without-syslog                   disable syslog logging

 

  --without-dso                      disable dso module load

 

  --with-http_spdy_module            enable ngx_http_spdy_module

  --with-http_realip_module          enable ngx_http_realip_module

  --with-http_addition_module        enable ngx_http_addition_filter_module

  --with-http_xslt_module            enable ngx_http_xslt_filter_module

  --with-http_image_filter_module    enable ngx_http_image_filter_module

  --with-http_geoip_module           enable ngx_http_geoip_module

  --with-http_sub_module             enable ngx_http_sub_filter_module

  --with-http_dav_module             enable ngx_http_dav_module

  --with-http_flv_module             enable ngx_http_flv_module

  --with-http_slice_module           enable ngx_http_slice_module

  --with-http_mp4_module             enable ngx_http_mp4_module

  --with-http_gunzip_module          enable ngx_http_gunzip_module

  --with-http_gzip_static_module     enable ngx_http_gzip_static_module

  --with-http_auth_request_module    enable ngx_http_auth_request_module

  --with-http_concat_module          enable ngx_http_concat_module

  --with-http_random_index_module    enable ngx_http_random_index_module

  --with-http_secure_link_module     enable ngx_http_secure_link_module

  --with-http_degradation_module     enable ngx_http_degradation_module

  --with-http_sysguard_module        enable ngx_http_sysguard_module

 

  --with-http_addition_module=shared enable ngx_http_addition_filter_module (shared)

  --with-http_xslt_module=shared     enable ngx_http_xslt_filter_module (shared)

  --with-http_image_filter_module=shared

                                     enable ngx_http_image_filter_module (shared)

  --with-http_geoip_module=shared    enable ngx_http_geoip_module

  --with-http_sub_module=shared      enable ngx_http_sub_filter_module (shared)

  --with-http_flv_module=shared      enable ngx_http_flv_module (shared)

  --with-http_slice_module=shared    enable ngx_http_slice_module (shared)

  --with-http_mp4_module=shared      enable ngx_http_mp4_module (shared)

  --with-http_concat_module=shared   enable ngx_http_concat_module (shared)

  --with-http_random_index_module=shared

                                     enable ngx_http_random_index_module (shared)

  --with-http_secure_link_module=shared

                                     enable ngx_http_secure_link_module (shared)

  --with-http_sysguard_module=shared enable ngx_http_sysguard_module (shared)

  --with-http_charset_filter_module=shared

                                     enable ngx_http_charset_filter_module (shared)

  --with-http_userid_filter_module=shared

                                     enable ngx_http_userid_filter_module (shared)

  --with-http_footer_filter_module=shared

                                     enable ngx_http_footer_filter_module (shared)

  --with-http_trim_filter_module=shared

                                     enable ngx_http_trim_filter_module (shared)

  --with-http_access_module=shared   enable ngx_http_access_module (shared)

  --with-http_autoindex_module=shared

                                     enable ngx_http_autoindex_module (shared)

  --with-http_map_module=shared      enable ngx_http_map_module (shared)

  --with-http_split_clients_module=shared

                                     enable ngx_http_split_clients_module (shared)

  --with-http_referer_module=shared  enable ngx_http_referer_module (shared)

  --with-http_rewrite_module=shared  enable ngx_http_rewrite_module (shared)

  --with-http_fastcgi_module=shared  enable ngx_http_fastcgi_module (shared)

  --with-http_uwsgi_module=shared    enable ngx_http_uwsgi_module (shared)

  --with-http_scgi_module=shared     enable ngx_http_scgi_module (shared)

  --with-http_memcached_module=shared

                                     enable ngx_http_memcached_module (shared)

  --with-http_limit_conn_module=shared

                                     enable ngx_http_limit_conn_module (shared)

  --with-http_limit_req_module=shared

                                     enable ngx_http_limit_req_module (shared)

  --with-http_empty_gif_module=shared

                                     enable ngx_http_empty_gif_module (shared)

  --with-http_browser_module=shared  enable ngx_http_browser_module (shared)

  --with-http_user_agent_module=shared

                                     enable ngx_http_user_agent_module (shared)

  --with-http_upstream_ip_hash_module=shared

                                     enable ngx_http_upstream_ip_hash_module (shared)

  --with-http_upstream_least_conn_module=shared

                                     enable ngx_http_upstream_least_conn_module (shared)

  --with-http_upstream_session_sticky_module=shared

                                     enable ngx_http_upstream_session_sticky_module (shared)

  --with-http_reqstat_module=shared  enable ngx_http_reqstat_module (shared)

 

  --without-http_charset_module      disable ngx_http_charset_filter_module

  --without-http_gzip_module         disable ngx_http_gzip_filter_module

  --without-http_ssi_module          disable ngx_http_ssi_module

  --without-http_ssl_module          disable ngx_http_ssl_module

  --without-http_userid_module       disable ngx_http_userid_filter_module

  --without-http_footer_filter_module

                                     disable ngx_http_footer_filter_module

  --without-http_trim_filter_module  disable ngx_http_trim_filter_module

  --without-http_access_module       disable ngx_http_access_module

  --without-http_auth_basic_module   disable ngx_http_auth_basic_module

  --without-http_autoindex_module    disable ngx_http_autoindex_module

  --without-http_geo_module          disable ngx_http_geo_module

  --without-http_map_module          disable ngx_http_map_module

  --without-http_split_clients_module

                                     disable ngx_http_split_clients_module

  --without-http_referer_module      disable ngx_http_referer_module

  --without-http_rewrite_module      disable ngx_http_rewrite_module

  --without-http_proxy_module        disable ngx_http_proxy_module

  --without-http_fastcgi_module      disable ngx_http_fastcgi_module

  --without-http_uwsgi_module        disable ngx_http_uwsgi_module

  --without-http_scgi_module         disable ngx_http_scgi_module

  --without-http_memcached_module    disable ngx_http_memcached_module

  --without-http_limit_conn_module   disable ngx_http_limit_conn_module

  --without-http_limit_req_module    disable ngx_http_limit_req_module

  --without-http_empty_gif_module    disable ngx_http_empty_gif_module

  --without-http_browser_module      disable ngx_http_browser_module

  --without-http_upstream_check_module

                                     disable ngx_http_upstream_check_module

  --without-http_upstream_least_conn_module

                                     disable ngx_http_upstream_least_conn_module

  --without-http_upstream_session_sticky_module

                                     disable ngx_http_upstream_session_sticky_module

  --without-http_upstream_keepalive_module

                                     disable ngx_http_upstream_keepalive_module

  --without-http_upstream_dynamic_module

                                     disable ngx_http_upstream_dynamic_module

  --without-http_upstream_ip_hash_module

                                     disable ngx_http_upstream_ip_hash_module

  --without-http_upstream_consistent_hash_module

                                     disable ngx_http_upstream_consistent_hash_module

  --without-http_user_agent_module   disable ngx_http_user_agent_module

  --without-http_stub_status_module  disable ngx_http_stub_status_module

  --without-http_reqstat_module      disable ngx_http_reqstat_module

 

  --with-http_perl_module            enable ngx_http_perl_module

  --with-perl_modules_path=PATH      set Perl modules path

  --with-perl=PATH                   set perl binary pathname

 

  --without-http-upstream-rbtree     disable using rbtree for upstream lookup

 

  --with-http_lua_module             enable ngx_http_lua_module (will also enable --with-md5 an

d --with-sha1)

  --with-http_lua_module=shared      enable ngx_http_lua_module (shared) (will also enable --wi

th-md5 and --with-sha1)

  --with-luajit-inc=PATH             set LuaJIT headers path (where lua.h/lauxlib.h/... are loc

ated)

  --with-luajit-lib=PATH             set LuaJIT library path (where libluajit-5.1.{a,so} are lo

cated)

  --with-lua-inc=PATH                set Lua headers path (where lua.h/lauxlib.h/... are locate

d)

  --with-lua-lib=PATH                set Lua library path (where liblua.{a,so} are located, onl

y support Lua-5.1.x)

 

  --with-http_tfs_module             enable ngx_http_tfs_module (will also enable --with-md5)

  --with-http_tfs_module=shared      enable ngx_http_tfs_module (shared) (will also enable --wi

th-md5)

  --with-libyajl-inc=PATH            set libyajl headers path (where yajl.h is located)

  --with-libyajl-lib=PATH            set libyajl library path (where libyajl.{a,so} is located)

 

  --http-log-path=PATH               set http access log pathname

  --http-client-body-temp-path=PATH  set path to store

                                     http client request body temporary files

  --http-proxy-temp-path=PATH        set path to store

                                     http proxy temporary files

  --http-fastcgi-temp-path=PATH      set path to store

                                     http fastcgi temporary files

  --http-uwsgi-temp-path=PATH        set path to store

                                     http uwsgi temporary files

  --http-scgi-temp-path=PATH         set path to store

                                     http scgi temporary files

 

  --without-http                     disable HTTP server

  --without-http-cache               disable HTTP cache

 

  --with-mail                        enable POP3/IMAP4/SMTP proxy module

  --with-mail_ssl_module             enable ngx_mail_ssl_module

  --without-mail_pop3_module         disable ngx_mail_pop3_module

  --without-mail_imap_module         disable ngx_mail_imap_module

  --without-mail_smtp_module         disable ngx_mail_smtp_module

 

  --with-google_perftools_module     enable ngx_google_perftools_module

  --with-cpp_test_module             enable ngx_cpp_test_module

  --with-backtrace_module            enable ngx_backtrace_module

 

  --add-module=PATH                  enable an external module

 

  --with-cc=PATH                     set C compiler pathname

  --with-cpp=PATH                    set C preprocessor pathname

  --with-cc-opt=OPTIONS              set additional C compiler options

  --with-ld-opt=OPTIONS              set additional linker options

  --with-cpu-opt=CPU                 build for the specified CPU, valid values:

                                     pentium, pentiumpro, pentium3, pentium4,

                                     athlon, opteron, sparc32, sparc64, ppc64

 

  --without-pcre                     disable PCRE library usage

  --with-pcre                        force PCRE library usage

  --with-pcre=DIR                    set path to PCRE library sources

  --with-pcre-opt=OPTIONS            set additional build options for PCRE

  --with-pcre-jit                    build PCRE with JIT compilation support

 

  --with-md5=DIR                     set path to md5 library sources

  --with-md5-opt=OPTIONS             set additional build options for md5

  --with-md5-asm                     use md5 assembler sources

 

  --with-sha1=DIR                    set path to sha1 library sources

  --with-sha1-opt=OPTIONS            set additional build options for sha1

  --with-sha1-asm                    use sha1 assembler sources

 

  --with-zlib=DIR                    set path to zlib library sources

  --with-zlib-opt=OPTIONS            set additional build options for zlib

  --with-zlib-asm=CPU                use zlib assembler sources optimized

                                     for the specified CPU, valid values:

                                     pentium, pentiumpro

 

  --with-libatomic                   force libatomic_ops library usage

  --with-libatomic=DIR               set path to libatomic_ops library sources

 

  --with-jemalloc                    force jemalloc library usage

  --with-jemalloc=DIR                set path to jemalloc library files

 

  --with-openssl=DIR                 set path to OpenSSL library sources

  --with-openssl-opt=OPTIONS         set additional build options for OpenSSL

 

  --with-debug                       enable debug logging

 

[root@centos7-1 tengine-2.1.0]# ./configure --prefix=/opt/vickie/nginx

checking for OS

 + Linux 3.10.0-957.el7.x86_64 x86_64

checking for C compiler ... not found

 

./configure: error: C compiler cc is not found

 

[root@centos7-1 tengine-2.1.0]# yum install gcc

 

已加载插件:fastestmirror, langpacks

Determining fastest mirrors

 * base: mirrors.aliyun.com

 * extras: mirrors.aliyun.com

 * updates: mirrors.aliyun.com

base                                                                    | 3.6 kB  00:00:00     

extras                                                                  | 2.9 kB  00:00:00     

updates                                                                 | 2.9 kB  00:00:00     

updates/7/x86_64/primary_db                                             | 4.2 MB  00:00:01     

正在解决依赖关系

--> 正在检查事务

---> 软件包 gcc.x86_64.0.4.8.5-39.el7 将被 安装

--> 正在处理依赖关系 libgomp = 4.8.5-39.el7,它被软件包 gcc-4.8.5-39.el7.x86_64 需要

--> 正在处理依赖关系 cpp = 4.8.5-39.el7,它被软件包 gcc-4.8.5-39.el7.x86_64 需要

--> 正在处理依赖关系 libgcc >= 4.8.5-39.el7,它被软件包 gcc-4.8.5-39.el7.x86_64 需要

--> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-39.el7.x86_64 需要

--> 正在检查事务

---> 软件包 cpp.x86_64.0.4.8.5-39.el7 将被 安装

---> 软件包 glibc-devel.x86_64.0.2.17-292.el7 将被 安装

--> 正在处理依赖关系 glibc-headers = 2.17-292.el7,它被软件包 glibc-devel-2.17-292.el7.x86_64 需要

--> 正在处理依赖关系 glibc = 2.17-292.el7,它被软件包 glibc-devel-2.17-292.el7.x86_64 需要

--> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-292.el7.x86_64 需要

---> 软件包 libgcc.x86_64.0.4.8.5-36.el7 将被 升级

---> 软件包 libgcc.x86_64.0.4.8.5-39.el7 将被 更新

---> 软件包 libgomp.x86_64.0.4.8.5-36.el7 将被 升级

---> 软件包 libgomp.x86_64.0.4.8.5-39.el7 将被 更新

--> 正在检查事务

---> 软件包 glibc.x86_64.0.2.17-260.el7 将被 升级

--> 正在处理依赖关系 glibc = 2.17-260.el7,它被软件包 glibc-common-2.17-260.el7.x86_64 需要

---> 软件包 glibc.x86_64.0.2.17-292.el7 将被 更新

---> 软件包 glibc-headers.x86_64.0.2.17-292.el7 将被 安装

--> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-292.el7.x86_64 需要

--> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-292.el7.x86_64 需要

--> 正在检查事务

---> 软件包 glibc-common.x86_64.0.2.17-260.el7 将被 升级

---> 软件包 glibc-common.x86_64.0.2.17-292.el7 将被 更新

---> 软件包 kernel-headers.x86_64.0.3.10.0-1062.4.3.el7 将被 安装

--> 解决依赖关系完成

 

依赖关系解决

 

===============================================================================================

 Package                 架构            版本                           源                大小

===============================================================================================

正在安装:

 gcc                     x86_64          4.8.5-39.el7                   base              16 M

为依赖而安装:

 cpp                     x86_64          4.8.5-39.el7                   base             5.9 M

 glibc-devel             x86_64          2.17-292.el7                   base             1.1 M

 glibc-headers           x86_64          2.17-292.el7                   base             687 k

 kernel-headers          x86_64          3.10.0-1062.4.3.el7            updates          8.7 M

为依赖而更新:

 glibc                   x86_64          2.17-292.el7                   base             3.6 M

 glibc-common            x86_64          2.17-292.el7                   base              11 M

 libgcc                  x86_64          4.8.5-39.el7                   base             102 k

 libgomp                 x86_64          4.8.5-39.el7                   base             158 k

 

事务概要

===============================================================================================

安装  1 软件包 (+4 依赖软件包)

升级           ( 4 依赖软件包)

 

总计:48 M

总下载量:33 M

Is this ok [y/d/N]: Exiting on user command

您的事务已保存,请执行:

 yum load-transaction /tmp/yum_save_tx.2019-11-28.18-16.7RcyAd.yumtx 重新执行该事务

[root@cen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值