You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by qwerty mobile <qw...@gmail.com> on 2014/03/06 12:49:58 UTC

[users@httpd] Changing rpm spec file to install httpd in a different directory

Hi,

I have a situation where I have to install httpd of v 2.X in a centos linux
machine where already older version of httpd is running there. For some
reasons, I couldn't make use of single upgraded httpd.

I have to push this install in production servers via rpm and yum. So I
have compiled rpm from source using spec file without much issues in it.
Now the problem is I have to change the install path else it will end with
conflict files.

I know it is not an easy one line change in rpm spec file to do this as we
have files in various folders as below,

/etc/httpd has conf directory etc...
/usr/lib/httpd has modules
/usr/sbin/has httpd binary executables
/etc/rc.d/init.d/ has init files
/var/log/httpd has log files
/var/run/httpd.pid

As most of the above files are already existing, I have changed the SPEC
file so as it will install files in a new directory 'http2' like this,

/etc/httpd2/ has conf, logs, modules etc...
/usr/lib/httpd2/ has modules
/usr/sbin/httpd2/ has binary executables (NOTE I have to add new folder
'httpd2' in this sbin directory for new executables)
/etc/rc.d/init.d/httpd2
/var/log/httpd2 has log files
/var/run/httpd2.pid

I have attached 2 files

1. httpd_original.spec (original spec file for version 2.2.24)
2. httpd_modified.spec (has my changes mentioned above)

Though the compiled rpm after this change installed without any conflict
issue, I am bit worried about much changes in SPEC file. Also you can see I
have to create a directory 'httpd2' under /usr/sbin/ to hold the
executables.

Another thing here is init scripts still expects binary file path as
normal. For example, in /etc/logrotate.d/httpd2 script, it still points to
/var/log/httpd/*log and /var/run/httpd.pid.
Also in /etc/init/httpd2, it still checks /usr/sbin/httpd and regular pid
file and so on..

Is there any another better way of doing this without complicating like
above. ?

Thanks in advance for your help on this.

Prabu