当前位置:网站首页>搭建PHP7私有仓库
搭建PHP7私有仓库
2022-07-28 05:28:00 【echo勇往直前】
搭建PHP7私有仓库
一、服务端配置
1. 编辑站点配置
# 1. 安装nginx
* ~ yum install nginx -y
# 2. 编辑配置文件
* ~ cat /etc/nginx/conf.d/file.conf
server {
server_tokens off;
listen 80;
server_name file.wangrengang.pro;
location / {
root /html/file;
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
}
}
# 3. 启动nginx
* ~ systemctl enable --now nginx
2. 创建仓库目录
* ~ mkdir -p /html/file/Package/
# 仓库目录放置在nginx配置的下载页面,以此提供http访问
3. 准备安装包
# 1. 配置第三方源
* ~ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
* ~ rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# 2. 下载PHP软件到仓库目录
* ~ yum install -y --downloadonly --downloaddir=/html/file php71w-cli php71w-common php71w-devel php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm php71w-mysqlnd php71w-opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb php71w-json php71w-pecl-apcu php71w-pecl-apcu-devel # 此操作只下载rpm包
4. 创建索引信息
# 1. 安装createrepo
* ~ yum install createrepo -y
# 2. 创建索引信息
* ~ createrepo /html/file/Package
# /html/file/Package目录为软件目录,此目录必须包含软件包,才可以正确生成repodata目录及数据信息
说明:
软件仓库必须包含
repodata(软件包索引信息,此目录名称必须为repodata)以及软件包目录(此目录对名称没有要求)在仓库目录创建
repodata,使其成为一个yum可以识别的仓库
二、客户端配置
1. 编写自建仓库文件
* ~ cat /etc/yum.repos.d/rengang.repo
[Rengang] # 仓库名称
name=rengang PHP7 repo # 仓库简介
baseurl=http://file.wangrengang.pro/Package/ # 仓库地址
enabled=1 # 启用仓库
gpgcheck=0 # 禁用签名验证
说明:repo仓库文件中,不要使用中文及注释,复制本文内容时,请删除中文信息
2. 生成仓库缓存
* ~ yum clean all
* ~ yum makecache
3. 检查仓库信息
* ~ yum repolist all
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
repo id repo name status
Rengang rengang PHP7 repo enabled: 31 # 仓库识别正常

4. 安装PHP7.1软件
* ~ yum install php71w-cli php71w-common php71w-devel php71w-embedded php71w-gd php71w-mcrypt php71w-mbstring php71w-pdo php71w-xml php71w-fpm php71w-mysqlnd php71w-opcache php71w-pecl-memcached php71w-pecl-redis php71w-pecl-mongodb php71w-json php71w-pecl-apcu php71w-pecl-apcu-devel

说明: 将repo文件上传到服务器,以后使用就可以直接下载,而不用编辑仓库文件了
# 1. 上传文件到服务器
* ~ scp -rp /etc/yum.repos.d/rengang.repo [email protected]:/html/file/Package
# 2. 客户端下载即可使用
* ~ wget -c -P /etc/yum.repos.d/ http://file.wangrengang.pro/rengang.repo
边栏推荐
猜你喜欢

Lancher deployment practice

JS逆向100题——第1题

Leetcode brush question diary sword finger offer II 055. binary search tree iterator

Redis cache design and performance optimization

图形管线基础(二)

AQS之ReentrantLock源码解析

yapi漏洞挂马程序chongfu.sh处理

Prometheus monitoring Nacos

Personal understanding of Chinese remainder theorem
![[C note] data type and storage](/img/3d/6b7a848dff5a8c0ccd0a54c19bce46.png)
[C note] data type and storage
随机推荐
什么是线性表?
关于Shader KeyWord的整理
feignclient @RequestMapping参数设置及请求头简易方式设置
Battle plague Cup -- strange shape
JS逆向100题——第1题
网络——网络层
OJ 1089 Spring Festival travel
测试人生 | 二线城市年薪超40W?疫情之下涨薪100% + 是怎么做到的?
JS reverse question 100 - question 1
Rain Scene Effect (I)
[C language] dynamic memory management
雨伞上的水滴效果
单元测试框架Jest搭配TypeScript的安装与配置
图形管线基础(番外篇)
Leetcode brush question diary sword finger offer II 055. binary search tree iterator
技术分享 | 服务端接口自动化测试, Requests 库的这些功能你了解吗?
redis缓存设计与性能优化
测试面试题集锦(五)| 自动化测试与性能测试篇(附答案)
技术分享 | 接口自动化测试中,如何做断言验证?
Using C language to realize three piece chess games