Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nginx-centos-6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
Zhang Huanjie
nginx-centos-6
Commits
95f47906
Unverified
Commit
95f47906
authored
6 years ago
by
Zhang Huanjie
Browse files
Options
Downloads
Patches
Plain Diff
yum
parent
c0acbc95
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+36
-1
36 additions, 1 deletion
README.md
with
36 additions
and
1 deletion
README.md
+
36
−
1
View file @
95f47906
...
...
@@ -15,7 +15,7 @@ epel中的nginx版本比较低,下面是CentOS 6.10 编译nginx.1.42.2并包
```
rpm -i https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install git gcc rpm-build rpmdevtools geoip-devel gd-devel pcre-devel
yum -y install perl-devel perl-ExtUtils-Embed libxslt-devel
yum -y install perl-devel perl-ExtUtils-Embed libxslt-devel
createrepo
yum update
reboot
```
...
...
@@ -50,6 +50,41 @@ rpmbuild -ba SPECS/nginx.spec
```
编译好的文件在 /root/rpmbuild/RPMS/x86_64 和 /root/rpmbuild/RPMS/noarch 目录。
## 6. 搭建yum库
编译好的rpm包可以安装,但是自己手工安装需要处理依赖关系,比较麻烦。
下面是搭建yum库的方法。
```
mkdir -p /var/www/html/local-yum/x86_64/RPMS
cp /root/rpmbuild/RPMS/x86_64/* /root/rpmbuild/RPMS/noarch/* /var/www/html/local-yum/x86_64/RPMS
createrepo /var/www/html/local-yum/x86_64/
```
## 7. 使用本地yum源
如果是本地使用,在/etc/yum.repos.d 下建立文件 local.repo,内容为:
```
[local-yum]
name=local-yum
baseurl=file:///var/www/html/local-yum/x86_64
enabled=1
gpgcheck=0
```
之后就可以使用自己本地源。
## 8. 使用远程 yum 源
如果把 /var/www/html/local-yum/ 目录通过web服务器对外提供,其他机器只要 建立文件 local.repo 即可使用。
```
[local-yum]
name=local-yum
baseurl=http://my-yum.ustc.edu.cn/local-yum/x86_64
enabled=1
gpgcheck=0
```
## 附录:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment