The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

'cleaning' a cPanel image

Discussion in 'General Discussion' started by RandomMcBob, Jan 27, 2014.

  1. RandomMcBob

    RandomMcBob Registered

    Joined:
    Jan 27, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hello

    I work for a hosting company which provides both dedicated and virtualised servers and we have been trying to find a decent way to 'clean' old config from our cPanel VM image. To give a little more info, we maintain a cPanel image with all the config changes we like and just image a customer's VM with it when they order one - anything like hostnames etc are set by part of the setup action. This image has been updated on several different VMs and as a result of this has a lot of cruft related to those older machines - obviously this doesn't hinder the image working, but it would be good to remove all this so we are only left with the details of the current testing VM, rather than 4 or 5 older ones.

    I've done a lot of searching etc to find and remove references to these older VMs, but as the config files are spread all over the place, this proves very difficult. Is there any kind of script that anyone has ever come across which would 'clean' this information for us?

    Thanks in advance
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,706
    Likes Received:
    658
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You may want to consider simply making a new image with the existing custom changes you would prefer to preserve. This would ensure that previously saved configuration values that are no longer utilized do not exist.

    Thank you.
     
  3. RandomMcBob

    RandomMcBob Registered

    Joined:
    Jan 27, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hi Michael

    We have considered this, however it would be easier from our point of view to just remove old data if at all possible.
     
  4. ThinIce

    ThinIce Well-Known Member

    Joined:
    Apr 27, 2006
    Messages:
    346
    Likes Received:
    7
    Trophy Points:
    18
    Location:
    Disillusioned in England
    cPanel Access Level:
    Root Administrator
    I think this may be one of those kettles of fish I keep hearing about :) From what I've seen in practice and from discussions in the past there is no / no intent to produce a list of items that should / could be sanitised when deploying installs in this manner.

    There are plenty of people out there doing it, and I think the docs should either feature a "don't do it because..." statement (the opinion I now sit with), or include a list of things that at the absolute minimum should be wiped / set fresh for each new deployment of the image (i.e. obvious ones like the mysql root password - obvious obviously being a relative concept...)
     
  5. RandomMcBob

    RandomMcBob Registered

    Joined:
    Jan 27, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Yes, I'm afraid that I had assumed that this is the case. The cPanel filesystem is so spread out that I think an effort to catalog it would be an absolute nightmare. I've made use of a load of greps and I think I've managed to track down the majority of the references to old hostnames, so I think that's going to have to do.
     
  6. ThinIce

    ThinIce Well-Known Member

    Joined:
    Apr 27, 2006
    Messages:
    346
    Likes Received:
    7
    Trophy Points:
    18
    Location:
    Disillusioned in England
    cPanel Access Level:
    Root Administrator
    I suppose the log location and config file location posters could be used as a base for the minimum to grep through - I'd also wonder about caches though...
     
  7. RandomMcBob

    RandomMcBob Registered

    Joined:
    Jan 27, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    I ran a recursive grep through the entire filesystem and established what directories I needed to look in - these are all cleaned, but as you rightly pointed out, caches still return positive results. Is it safe to remove them? i.e. will they be recreated upon boot?
     
Loading...

Share This Page