LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to stop config files I deleted from getting re-added after a yum upgrade (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-stop-config-files-i-deleted-from-getting-re-added-after-a-yum-upgrade-911655/)

veeruk101 11-03-2011 08:53 AM

How to stop config files I deleted from getting re-added after a yum upgrade
 
There are some httpd config files in /etc/httpd/conf.d/ that I don't want, such as ssl.conf, so I rename it from ssl.conf to ssl.conf.bak so that it doesn't get read by httpd. But when I do a 'sudo yum upgrade httpd', the file comes back (which seems about right). So if renaming or deleting a file that I don't want doesn't keep it gone after an upgrade, is there any other way to ensure it stays gone, or will I simply have to remember to rename these files again every time I upgrade?

MensaWater 11-03-2011 09:19 AM

It is the /etc/httpd/conf/httpd.conf file that tells Apache to use conf.d.

What you might want to do is create a new directory e.g. myconf.d to contain only the files you want from httpd.conf then modify the /etc/httpd/conf/httpd.conf to point to myhttpd.conf.d instead of httpd.conf.d. The relevant section in httpd.conf is:

Code:

#
# Load config files from the config directory "/etc/httpd/conf.d".
#
Include conf.d/*.conf


veeruk101 11-03-2011 09:28 AM

That's a great idea, I'll certainly do that. Out of curiosity, let's say for other packages that aren't httpd and aren't as flexible as this is in their configuration, would there be a way to maybe 'exclude' certain files from the yum upgrade or mark them as deleted? Or would I simply have to remember to delete the files after doing a yum upgrade?

MensaWater 11-03-2011 01:29 PM

I'm not aware of a way to do it with yum itself. It allows exclude of packages so you could exclude httpd entirely (see "man yum" and "man yum.conf") but not of files so far as I'm aware.

The files installed by yum are RPMs (RedHat Package Manager packages) and there is an exclude for files in rpm (I haven't used it but saw in "man rpm"). So one way to do it might be to download the htttpd package RPM from the repository then use rpm command to install it with the exclude option.


All times are GMT -5. The time now is 07:36 PM.