LINUX源码包

概念:
源码包指的是开发编写好的程序源代码,但并没有将其编译为一个能正常使用的二进制工具。
c --> 源代码编译操作–<<二进制文件>>直接运行
为什么需要源码包:
1.部分软件官网仅提供源码包,需要自行编译并安装。
2部分软件在新版本有一些特性还没来得及制作成rpm包时,可以自行编译软件使用其新特性
3.源码包–>打包成一个rpm格式; rpm方式安装标准;

如何获取:
见的软件包都可以在官网获取源码包,比如 apache nginx mysql nginx
http://nginx.org/en/download.html
http://httpd.apache.org/download.cgi
https://www.zabbix.com/cn/download

在这里插入图片描述
此方法不是百分百通用于所有源码包,建议拿到源码包解压后,进入到目录找相关的README帮助文档

下面通过编译nginx源码包演示编译过程。

yum install -y  make  gcc  wget
wget  http://nginx.org/download/nginx-1.18.0.tar.gz


解压
root@localhost yum.repos.d]# tar -xf   nginx-1.18.0.tar.gz 
[root@localhost yum.repos.d]# cd nginx-1.18.0/
[root@localhost nginx-1.18.0]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  man  README  src

yum  install -y   make gcc  pcre pcre-devel   zlib-devel   openssl openssl-devel 

 ./configure --prefix=/opt/nginx-1.18.0

然后生成了makefile的记录
Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/opt/ngnix-1.18.0"
  nginx binary file: "/opt/ngnix-1.18.0/sbin/nginx"
  nginx modules path: "/opt/ngnix-1.18.0/modules"
  nginx configuration prefix: "/opt/ngnix-1.18.0/conf"
  nginx configuration file: "/opt/ngnix-1.18.0/conf/nginx.conf"
  nginx pid file: "/opt/ngnix-1.18.0/logs/nginx.pid"
  nginx error log file: "/opt/ngnix-1.18.0/logs/error.log"
  nginx http access log file: "/opt/ngnix-1.18.0/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"



  ./configure  --prefix=/usr/bin/local/nginx-1.18.0/     --with-http_stub_status_module   --with-http_ssl_module
make&&make install 

ln  -s  /usr/bin/local/nginx-1.18.0/sbin/nginx  /usr/bin/nignx


编译ok

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于安装 MySQL,你可以按照以下步骤使用源码Linux 上进行安装: 1. 首先,确保你的系统满足 MySQL 的依赖项。通常,需要安装以下软件:`gcc`、`make`、`cmake`、`bison`、`ncurses-devel` 和 `openssl-devel`。你可以使用适用于你的 Linux 发行版的管理器来安装这些软件。 2. 下载 MySQL 的源码。你可以从 MySQL 官方网站(https://dev.mysql.com/downloads/mysql/)下载最新版本的源码。 3. 将源码解压到你选择的位置。可以使用以下命令解压: ``` tar xvf mysql-<version>.tar.gz ``` 请将 `<version>` 替换为你下载的源码的版本号。 4. 进入解压后的源码目录: ``` cd mysql-<version> ``` 5. 创建一个用于构建的目录,并进入该目录: ``` mkdir build cd build ``` 6. 运行 CMake 命令来生成构建文件: ``` cmake .. ``` 7. 使用 `make` 命令编译 MySQL: ``` make ``` 这可能需要一些时间,取决于你的系统性能。 8. 在编译完成后,运行以下命令以安装 MySQL: ``` make install ``` 9. 安装完成后,你可以运行以下命令来初始化 MySQL 数据库: ``` mysql_install_db ``` 10. 最后,启动 MySQL 服务器: ``` mysqld ``` 现在,你已经成功安装并启动了 MySQL。你可以使用 `mysql` 命令行客户端或其他 MySQL 客户端来连接和管理数据库。 请注意,这只是安装 MySQL 的基本步骤。根据你的需求和环境,可能还需要进行其他配置和调整。建议查阅 MySQL 官方文档以获取更多详细信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值