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.

Deleting Addon Domains

Discussion in 'General Discussion' started by rmatakajr, Jun 8, 2011.

  1. rmatakajr

    rmatakajr Member

    Joined:
    Jun 8, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Hey Guys

    I have a quick question about deleting addon domains. When I use the addon domain
    manager and delete the addon domain, I noticed that it does not delete the
    /public_html/domain.com root folder. Is this a setting of some sort?

    Thanks!
    Ricky
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thats right it does not delete the directory. I'm not aware of a setting to make it remove the directory.

    Guessing, the system should leave deleting something up to the end user. What if I forgot to get my website out of that directory when I killed the addon domain?
     
  3. rmatakajr

    rmatakajr Member

    Joined:
    Jun 8, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I kind of figured that... but what happens if a user then goes and creates the same addon domain will it make a /public_html/domain.com2 folder or just overwrite the existing folder. I guess it boils down to this, because I am using the API for non technical users and I can see this happening.

    Thanks!
    Ricky
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hmm, not sure if it'll do that or not. Can't hurt to test, have you tried to see what happens?
     
  5. rmatakajr

    rmatakajr Member

    Joined:
    Jun 8, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    No I havent .. lol I was just seeing if you knew. :) Thanks! I will test now and get back to you
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Make sure you got that website out of there first. ;)
     
  7. rmatakajr

    rmatakajr Member

    Joined:
    Jun 8, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    ok from my findings this is what I did

    1) Add an addon domain

    domain:/http://www.rewriteme.com
    User: rewriteme

    It created the domain and the subdomain

    2) I removed the addon domain
    the /public/ folder was intact and not deleted

    3) I added the same credentials again

    http://screencast.com/t/pWqdK7s8Ee

    But it DID make the addon domain not the subdomain this time
    and the directory was still inplace, nothing has changed to it

    So I added a test.txt file to the folder to see if the folder
    would be changed

    4) I deleted the addon domain and then I added it again
    but this time I added it with a different FTPUSER name

    http://screencast.com/t/29iOgneeAx

    As you can see the addon domain was added. But no subdomain
    was created ..

    Then I checked the folder to see if the folder was rewritten
    but it was not the test.txt file was still in place

    =====
    My whole thing here is i created a script that does this for the non
    tech user uploads website files etc...

    If they delete it from my interface then i remove the addon domain
    DB and Users ..

    Now the problem with this here is if I dont remove the public folder
    then when the user adds the same domain again it will do it all
    in cpanel then fail with the upload due to existing folders and files

    I will have to figure a way around this

    Thanks!
    Ricky
     
  8. kbob

    kbob Member

    Joined:
    May 30, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    @Ricky a perfect solution for your need is cPanel Hooks .

    You should be able to create a script in the form of the following file :

    or
    Which will be executed every time an addon domain is added or removed , the only question is if you are going to do it in Perl or PHP :) .
     
  9. rmatakajr

    rmatakajr Member

    Joined:
    Jun 8, 2011
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Hey

    Thanks for that reply I will have to explore the hooks there. I can write it in perl or
    PHP doesnt matter. But looks cool man! Thanks!

    Ricky
     
Loading...

Share This Page