Hello I asked this question to superuser but I did not get a good question there and i really need the answer. I know some of you here can answer this question.
I have installed nginx via yum. Now I want to add a module, but I have to compile the source again and include the the new module.
But i can’t find the source. Does someone know what I have to do to recompile the source and get the module in.
Update
I did everything in the answer from Patrick and it worked out great. However when now when I run the yum update it wants to update the installed rpm with the same version.
Can I just let it update, or should i specify that it is already up to date.
Redhat and related distributions (fedora, centos) keep their source rpms in a highly regular directory tree. for RHEL5 you want: ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/ for other releases, you can browse the ftp server until you find what you want. Otherwise, google for the exact version of nginx you have (
rpm -q nginx)Assuming you can find the srpm, install it with rpm:
This’ll put the sources and build files in
/usr/src/redhat/{BUILD,SPEC,SRC,SOURCES}. You can modify the.specfile in/usr/src/redhat/SPECto build the module you want along with the rest of nginx, or you can build nginx manually.Which module do you want to build? In fedora’s nginx.spec, several modules are specified when
configureis run. This may be as simple as adding a line here:After adding whatever changes to
nginx.spec, you can build the finalrpmwithrpmbuild:Assuming the package builds without error, rpmbuild will leave it in
/usr/src/redhat/RPMS/Update: yum will want to replace your nginx package as updates become available. You will probably want to rebuild each new package as it becomes available, using the same process as above. However, If security is not a concern, you can simple exclude nginx from the update list by adding the following to your yum config (probably
/etc/yum.repos.d/${repo}.repoor similar. Be sure to associate it with the right repo):Or running yum with the –exclude option