Name:nginx
Version:1.22.1
Release:10
Summary:nginx is a web server software
Group:
License: GPL
URL: www.test.com
Source0:nginx-1.22.1.tar.gz
#BuildRequires:
Requires:pcre-devel openssl-devel
%description
nginx is an HTTP and reverse proxy server.
%post
useradd nginx
%prep
%setup -q
%build
./configure
make %{?_smp_mflags}
%install
makeinstallDESTDIR=%{buildroot}
%files
%doc
/usr/local/nginx/*
%changelog
用配置文件创建RPM包
[root@py-redis SPECS]# yum install -y pcre-devel gcc make openssl-devel[root@py-redis SPECS]# rpmbuild -ba /root/rpmbuild/SPECS/nginx.spec [root@py-redis SPECS]# ls /root/rpmbuild/RPMS/x86_64/nginx-1.22.1-10.x86_64.rpm
安装测试
[root@py-redis SPECS]# yum install -y /root/rpmbuild/RPMS/x86_64/nginx-1.22.1-10.x86_64.rpm [root@py-redis SPECS]# /usr/local/nginx/sbin/nginx [root@py-redis SPECS]# curl 192.168.88.11<!DOCTYPE html><html><head><title>Welcome to nginx!</title><style>
html { color-scheme: light dark;}
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;}</style></head><body><h1>Welcome to nginx!</h1><p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p><p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p></body></html>