Linux FPM 기반 RPM 패키지 만 들 기 (Nginx 의 경우)
온라인 yum 소스 설치
[root@localhost ~]# rpm -ivh epel-release-latest-7.noarch.rpm //
[root@localhost yum.repos.d]# ls
a epel-release-latest-7.noarch.rpm epel-testing.repo Centos-7.repo epel.repo
[root@localhost ~]# ls /etc/yum.repos.d/
backup CentOS-Base.repo CentOS-Media.repo epel.repo epel-testing.repo
epel.repo
[root@Crushlinux yum.repos.d]# yum clean all && yum makecache // yum
2. ruby 환경 과 gem 명령 설치 (gem 명령 은 ruby gem 창고 에서 소프트웨어 를 설치 하고 yum 창고 에서 소프트웨어 를 설치 하 는 것 과 유사 합 니 다)
, 3
[root@localhost yum.repos.d]# yum -y install ruby rubygems ruby-devel
[root@localhost ~]# gem update --system // rubygems
[root@localhost ~]# gem install rubygems-update -v 2.3.0 //
[root@localhost ~]# gem update --system //
[root@localhost ~]# gem sources -a http://mirrors.aliyun.com/rubygems/ //
[root@localhost ~]# gem sources --remove https://rubygems.org/ //
[root@localhost ~]# gem sources -l //
[root@localhost ~]# gem install fpm // fpm
3. nginx 를 컴 파일 하여 nginx 가 설치 되 었 음 을 보증 하 는 토대 에서 포장 하고 nginx 의 80 포트 를 봅 니 다.
[root@localhost ~]# netstat -anpt | grep :80 // nginx
4, 포장 nginx 패키지 생 성 rpm 패키지
[root@localhost ~]# vim nginx.sh
#!/bin/bash
useradd -M -s /sbin/nologin nginx //
ln -s /usr/local/nginx/sbin/nginx/ /sbin //
echo www.crushlinux.com > /usr/local/nginx/html/index.html //
/usr/local/nginx/sbin/nginx // nginx
포장
[root@localhost ~]# fpm -s dir -t rpm -n nginx -v 1.16.1 -d 'pcre-devel,zlib-devel' -f --post-install /root/nginx.sh /usr/local/nginx/
Need executable 'rpmbuild' to convert dir to rpm {:level=>:error}
[root@localhost ~]# yum list | grep build
[root@localhost ~]# yum -y install rpm-build
[root@localhost ~]# fpm -s dir -t rpm -n nginx -v 1.16.1 -d 'pcre-devel,zlib-devel' -f --post-install /root/nginx.sh /usr/local/nginx/
, rpm
Created package {:path=>"nginx-1.16.1-1.x86_64.rpm"}
5. 자신 이 만 든 패 키 지 를 설치 하고 포트 보기
설치 하기 전에 설치 한 nginx 를 마 운 트 해제 해 야 합 니 다.
rm -rf /usr/local/nginx
rm -rf /usr/src/nginx-1.16.1/
rm -rf /usr/local/nginx/sbin/nginx
userdel -r nginx
[root@localhost ~]# rpm -ivh nginx-1.16.1-1.x86_64.rpm //
[root@localhost ~]# netstat -anpt | grep 80 //
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.