linux编译软件包,linux命令:编译安装软件包(举例安装tengine nginx)

编译安装的步骤:

1、下载源码包

2、解压缩下载的源码包

3、进入解压缩目录    *必须进入到解压缩目录中

4、./configure 软件配置与检查

1)定义需要的功能选项

2)检测系统环境是否符合安装要求

3)把定义好的功能选项和检测系统环境的信息都写入makefile文件,用于后续的编辑。

4)make编译  4.1)make clean清空编译文件

5)make install 编译安装

步骤:./configure --prefix=/usr/local/squid   --prefix指定软件安装位置

--sysconfdir=/PATH/TO/CONFFILE_PATH  --sysconfdir指定配置文件路径

--config-path=/PATH/TO/CONFFILE_PATH  指定配置文件路径

--help 获取配置帮助文件

make  编译    如有报错,执行make clean 删除编译临时文件

make install 编译安装

Usage: 编译安装squid

1、首先现在squid源码包

2、解压下载的源码包

3、进入源码包的解压缩目录

4、./configure --prefix=/usr/local/squid  指定安装路径

5、make 编译生成makefile文件   6、make install 编译安装完成

编译安装完成后必须注意的几个问题:

注:

1、修改PATH环境变量,以便能够识别此程序的二进制文件路径即把程序的执行程序的路径加入到PATH变量中 在/etc/profile 中添加PATH=$PATH:/usr/local/tengine/sbin

2、默认情况下,系统搜索哭文件的路径/lib,/usr/lib,要增加额外搜寻路径

在/etc/ld.so.conf.d/中创建以.conf为后缀名的文件,而后把要增添的路径直接写入至此      文件中;

#领导config通知系统重新搜寻库文件

-v:显示重新搜寻库的过程

3、头文件,输出给系统

默认:/usr/include

增添头文件搜寻路径,使用链接进行

/usr/local/tengine/include/   /usr/include/

两种方式:

ln -s /usr/local/tengine/include/* /usr/include/

或者 ln -s /usr/local/tengine/include /usr/include/tengine

4、man文件路径:安装在--prefix指定的目录下的man目录下;

两种方式:

1、man -M /PATH/TO/MAN_DIR  把生成的man文件加入到默认帮助文档中

2、在/etc/man.conf文档中添加MANPATH /PATH/TO/MAN_DIR

执行编译安装前提必须安装编译环境:(开发工具和开发函数库最好安装系统时选择安装)

必须安装有“Development Tools”和“Development Libraries”开发工具组和开发函数库

yum groupinstall "Development Tools"

yum groupinstall "Development Libraries"

实例:编译安装tengine

#tar xf tengine-1.5.1.tar.gz

#cd tegnine-1.5.1

#./configure -prefix=/usr/local/tengine --conf-path=/etc/tengine/tengine.con

#make

#make install

#/usr/local/tengine/sbin/nginx 执行程序

#tar zxvf tengine-1.5.1.tar.gz

[root@xuelinux ~]# cd tengine-1.5.1

[root@xuelinux tengine-1.5.1]# ls

AUTHORS.te  CHANGES.cn  conf       docs     Makefile  README           tests

auto        CHANGES.ru  configure  html     man       README.markdown  THANKS.te

CHANGES     CHANGES.te  contrib    LICENSE  objs      src

[root@xuelinux tengine-1.5.1]# ./configure --prefix=/usr/local/tengine-1.5.1

checking for OS

+ Linux 2.6.32-431.el6.i686 i686

checking for C compiler ... found

+ using GNU C compiler

+ gcc version: 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)

checking for gcc -pipe switch ... found

checking for gcc builtin atomic operations ... found

checking for C99 variadic macros ... found

checking for PCRE library in /opt/local/ ... not found

./configure: error: the HTTP rewrite module requires the PCRE library. #提示缺少pcre报错

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.

[root@xuelinux tengine-1.5.1]# yum install pcre-devel 安装相应的pcre函数库后再进行编译

Installed:

pcre-devel.i686 0:7.8-6.el6

Complete!

[root@xuelinux tengine-1.5.1]# ./configure --prefix=/usr/local/tengine-1.5.1 指定安装路径

checking for OS

+ Linux 2.6.32-431.el6.i686 i686

checking for C compiler ... found

nginx http uwsgi temporary files: "uwsgi_temp"

nginx http scgi temporary files: "scgi_temp"

[root@xuelinux tengine-1.5.1]# make  进行编译

make -f objs/Makefile

make[1]: Entering directory `/root/tengine-1.5.1'

make[1]: Entering directory `/root/tengine-1.5.1'

sed -e "s|%%PREFIX%%|/usr/local/tengine-1.5.1|" \

-e "s|%%PID_PATH%%|/usr/local/tengine-1.5.1/logs/nginx.pid|" \

-e "s|%%CONF_PATH%%|/usr/local/tengine-1.5.1/conf/nginx.conf|" \

-e "s|%%ERROR_LOG_PATH%%|/usr/local/tengine-1.5.1/logs/error.log|" \

< man/nginx.8 > objs/nginx.8

make[1]: Leaving directory `/root/tengine-1.5.1'    编译完成

[root@xuelinux tengine-1.5.1]# make install   执行编译安装

make -f objs/Makefile install

make[1]: Entering directory `/root/tengine-1.5.1'

cp objs/dso_tool '/usr/local/tengine-1.5.1/sbin/dso_tool'

chmod 0755 '/usr/local/tengine-1.5.1/sbin/dso_tool'

make[1]: Leaving directory `/root/tengine-1.5.1'    至此编译安装tengine完成

[root@xuelinux sbin]# nginx      执行该程序

-bash: nginx: command not found    提示没有找到命令因为环境变量未添加该执行程序路径

[root@xuelinux sbin]# vim /etc/profile  编辑环境变量配置文件把该路径添加进去

PATH=$PATH:/usr/local/tengine-1.5.1/sbin   添加该行

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

[root@xuelinux sbin]# source /etc/profile   重新读取该配置文件,使得修改生效

[root@xuelinux sbin]# nginx   执行后正常

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] still could not bind()  提示端口被占用

[root@xuelinux sbin]# fuser -n tcp 80   查看被占用端口的进程

80/tcp:              20340 20341

[root@xuelinux sbin]# kill -9 20340  终止占用端口的进程

[root@xuelinux sbin]# kill -9 20341  终止占用端口的进程

[root@xuelinux sbin]# nginx

[root@xuelinux sbin]# nginx

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] still could not bind()

[root@xuelinux sbin]# netstat -tlnp  查看监听端口

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name

tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1235/rpcbind

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      20340/nginx       已经取用了nginx

tcp        0      0 192.168.122.1:53            0.0.0.0:*                   LISTEN      1797/d

然后就可通过ip地址访问该地址了。

Linux-centos下安装nginxtengine 一、nginx安装环境nginx是C语言开发,建议在linux上运行。1)gcc安装nginx需要先将官网下载的源码进行编译编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c++ 2)PCREPCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库。nginx的http模块使用p... 阅读详情

相关推荐

TengineLinux安装和启动

选择的 Linux 系统为 CentOS7 1、下载tengine-2.3.3 2、解压tengine-2.3.3.tar.gz 一、安装 nginx 环境 执行下面4个命令 1、 yum install gcc-c++ 2、 yum install -y pcre pcre-devel 3、 yum install -y zlib zlib-devel 4、 yum install -y openssl openssl-devel 对于 gcc,因为安装nginx需要先将官网下载的源码进行编译编译

python全栈 4173

linux安装nginx详细步骤和make编译报错问题(保姆级)

保姆级教程

weixin_69306012的博客 1万+

淘宝TengineNginx的超级增强版

通过本文,我们对Tengine有了初步的认识,包括它的背景、主要特性以及如何安装和使用。如果你正在寻找一种能够满足大规模并发访问需求的Web服务器,Tengine无疑是一个值得考虑的选择。随着项目的不断发展,未来还将有更多激动人心的功能被加入进来。希望这篇文章能帮助你更好地理解Tengine,并为你的技术选型提供有价值的参考。如果有任何疑问或想要了解更多信息,请继续关注我的博客!请记得,虽然TengineNginx的强大替代品,但在采用之前,务必评估其与现有系统的兼容性和适用性。

技术分享 1374

Nginx yum安装和源码安装

常见web服务器: nginxtengine、httpd、tomcat、IIS、lighttpd httpd|IIS 政府类,银行用的居多 nginx|tomcat|tengine 社区,电商用的多 nginx 新浪 httpd 中国人民政府网站、兴业银行... IIS 招商银行、工商银行、农业银行... tengine(2012) 简书、csdn、淘宝... nginx ...

小楼一夜听春雨,深巷明朝卖杏花 1454

Linuxnginx安装

第一步:下载nginx压缩包 在这里可以去nginx官网下载 也可以直接使用wget命令下载,指令如下所示(请根据自己的需求进行下载): wget -c https://nginx.org/download/nginx-1.10.1.tar.gz 注意:这里建议选择官网发布的稳定版本 注意:这一步最好在自己的目标目录进行操作,我一般是把压缩包下载到/usr/local目录下。 第二步:配置nginx安装所需的环境 1. 安装gcc 安装 nginx 需要先将官网下载的源码进行编译编译依赖 gcc

lxw1005192401的博客 3478

linux编译安装命令,linux命令编译安装软件包(示例代码)

编译安装的步骤:1、下载源码包2、解压缩下载的源码包3、进入解压缩目录 *必须进入到解压缩目录中4、./configure 软件配置与检查1)定义需要的功能选项2)检测系统环境是否符合安装要求3)把定义好的功能选项和检测系统环境的信息都写入makefile文件,用于后续的编辑。4)make编译 4.1)make clean清空编译文件5)make install 编译安装步骤:./conf...

weixin_39887926的博客 1276

nginx安装过程

root@iZwz9eqh138yjkr9hllejfZ:/usr/nginx/nginx-1.14.0# ls auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src root@iZwz9eqh138yjkr9hllejfZ:/usr/nginx/nginx-1.14.0# ./co...

zxcvb12zxcvb12的博客 1182

linux命令编译安装软件包(举例安装tengine nginx)

编译安装的步骤: 1、下载源码包 2、解压缩下载的源码包 3、进入解压缩目录 *必须进入到解压缩目录中 4、./configure 软件配置与检查 1)定义需要的功能选项 2)检测系统环境是否符合安装要求 3)把定义好的功能选项和检测系统环境的信息都写入makefile文件,用于后续的编...

weixin_34122548的博客 160

Tengine安装及配置(目前最好的Nginx编译版本)

Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。它的目的是打造一个高效、安全的Web平台。 1、编译安装 1)下载 http://tengine.taobao.org/download.html 找到下载包并且下载(Tengine-2.3.2.tar.gz) wget https://tengine.taobao.org/download/tengine-2.3.2.tar.gz 2)解压 tar -zvxf tengine-2.3

weixin_48803304的博客 1901

linux 淘宝nginx(tengine)安装

5、指定配置文件启动 /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf。3、 停止nginx /usr/local/nginx/sbin/nginx -s stop或者quit。4 、重新加载nginx /usr/local/nginx/sbin/nginx -s reload。tengine官方网站https://tengine.taobao.org/

qq_42250832的博客 1809

Linux安装配置Tengine:Nginx

Linux安装配置Tengine:Nginx #yuxiangShi/学习/工具/Linux安装配置Tengine 简介 Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。 Tengine的性能和稳定性已经在大型的网站如淘宝、天猫等得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的Web平台。 步骤 从http://tengine.taobao.org/download.html上下载相应的版本,或者直接在Lin

雨夜的博客 248

Linux CentOS 7 & TengineNginx安装与配置

关于Linux CentOS 7 & Tengine安装与配置

小灯光环 1万+

tengine/nginx 安装geoip2模块

geoip是一个可以屏蔽ip的nginx模块,需要自行编译安装,安装后可以屏蔽某些国家和城市的ip访问网站,对网站安全还是很重要的。 一:安装geoip2扩展依赖 yum install libmaxminddb-devel -y #这个库是安装ngx_http_geoip2_module模块必须有的 yum -y install epel-release jemalloc pcre* openssl* unzip wget zip #安装其他nginx必须的库 二:下载ngx_

3870

Linux卸载tengine,编译安装Tengine

1.安装前准备:1.1下载http://tengine.taobao.org/download_cn.html1.2依赖 gcc openssl-devel pcre-devel zlib-devel1.3创建用户:useradd -r -M nginx2.编译安装,默认路径/usr/local/nginx$./configure$make#makeinstall3.服务脚本注意权限...

weixin_30480859的博客 861

安装与配置 Tengine 及自动脚本

Tengine 是一个基于 Nginx 的高性能 Web 服务器。本文将介绍如何下载、安装 Tengine,并配置自动启动脚本,使其在系统启动时自动运行。

灿嘿嘿的博客分享 3068

Linux安装tengine(centos)

文章目录Linux安装tengine步骤 Linux安装tengine步骤 首先linux需要安装 tengine 依赖的包(通过 yum 安装) [root@localhost ~]# yum -y install gcc openssl-devel pcre-devel zlib-devel 解压 tengine 包 [root@localhost ~]# tar -zxvf ten...

qq_41782149的博客 802

Linux安装Tengine(Nginx) 及相关环境配置

前言 Tengine是由TB发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。Tengine的性能和稳定性已经在一些大型的网站得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的Web平台。 官网http://tengine.taobao.org/ 安装步骤 1. 下载源码 http://tengine.taobao.org/download.html cd /opt wget http://tengine.ta...

nbme的博客 2857

Linux系统安装Nginx(tengine)详解

准备目录 [root@iZwz9488eeqkbsy2icrqoqZ /]# mkdir /usr/local/nginx [root@iZwz9488eeqkbsy2icrqoqZ /]# cd /usr/local/nginx 下载 http://tengine.taobao.org/download_cn.html 本次下载的版本是2.3.2,下载完成上传到linux目录(usr/local/nginx) 解压 [root@iZwz9488eeqkbsy2icrqoqZ nginx]# tar -zx

qq_34466889的博客 559
上一篇: linux的键盘命令用户登录,Linux下清空用户登录记录和命令历史的方法
下一篇: linux文件处理,Linux文本处理技巧分享
saintbeta
博客等级 码龄8年 23粉丝 84原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值